コード例 #1
0
        void IWidget.StaticInitializeWidget(Windawesome windawesome)
        {
            // system tray hook
            if (NativeMethods.RegisterSystemTrayHook(windawesome.Handle))
            {
                if (SystemAndProcessInformation.isAtLeastVista && SystemAndProcessInformation.isRunningElevated)
                {
                    if (SystemAndProcessInformation.isAtLeast7)
                    {
                        NativeMethods.ChangeWindowMessageFilterEx(windawesome.Handle, NativeMethods.WM_COPYDATA, NativeMethods.MSGFLTEx.MSGFLT_ALLOW, IntPtr.Zero);
                    }
                    else
                    {
                        NativeMethods.ChangeWindowMessageFilter(NativeMethods.WM_COPYDATA, NativeMethods.MSGFLT.MSGFLT_ADD);
                    }
                }

                windawesome.RegisterMessage(NativeMethods.WM_COPYDATA, OnSystemTrayMessage);
            }
        }
コード例 #2
0
        void IWidget.StaticInitializeWidget(Windawesome windawesome)
        {
            if (NativeMethods.RegisterGlobalShellHook(windawesome.Handle))
            {
                globalShellHookMessage = NativeMethods.RegisterWindowMessage("GLOBAL_SHELL_HOOK");
                if (SystemAndProcessInformation.isAtLeastVista && SystemAndProcessInformation.isRunningElevated)
                {
                    if (SystemAndProcessInformation.isAtLeast7)
                    {
                        NativeMethods.ChangeWindowMessageFilterEx(windawesome.Handle, globalShellHookMessage, NativeMethods.MSGFLTEx.MSGFLT_ALLOW, IntPtr.Zero);
                    }
                    else
                    {
                        NativeMethods.ChangeWindowMessageFilter(globalShellHookMessage, NativeMethods.MSGFLT.MSGFLT_ADD);
                    }
                }

                windawesome.RegisterMessage((int)globalShellHookMessage, OnGlobalShellHookMessage);
            }
        }
コード例 #3
0
 void IPlugin.InitializePlugin(Windawesome windawesome)
 {
     windawesome.RegisterMessage(NativeMethods.WM_HOTKEY,
                                 (ref Message m) => registeredHotkeys[m.WParam.ToInt32()]());
 }