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); } }
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); } }
void IPlugin.InitializePlugin(Windawesome windawesome) { windawesome.RegisterMessage(NativeMethods.WM_HOTKEY, (ref Message m) => registeredHotkeys[m.WParam.ToInt32()]()); }