Esempio n. 1
0
        protected override void OnStart()
        {
            _msgIdGetMsg       = RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_GETMSG");
            _msgIdGetMsgParams = RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_GETMSG_PARAMS");

            if (Environment.OSVersion.Version.Major >= 6)
            {
                ChangeWindowMessageFilter(_msgIdGetMsg, Constants.MSGFLT_ADD);
                ChangeWindowMessageFilter(_msgIdGetMsgParams, Constants.MSGFLT_ADD);
            }
            NativeHookMethods.InitializeGetMsgHook(0, _handle, _dragByMouseMenuItem);
        }
Esempio n. 2
0
        protected override void OnStart()
        {
            msgID_GetMsg_HookReplaced = NativeMethods.RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_GETMSG_REPLACED");
            msgID_GetMsg        = NativeMethods.RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_GETMSG");
            msgID_GetMsg_Params = NativeMethods.RegisterWindowMessage("SMART_SYSTEM_MENU_HOOK_GETMSG_PARAMS");

            if (Environment.OSVersion.Version.Major >= 6)
            {
                NativeMethods.ChangeWindowMessageFilter(msgID_GetMsg_HookReplaced, NativeConstants.MSGFLT_ADD);
                NativeMethods.ChangeWindowMessageFilter(msgID_GetMsg, NativeConstants.MSGFLT_ADD);
                NativeMethods.ChangeWindowMessageFilter(msgID_GetMsg_Params, NativeConstants.MSGFLT_ADD);
            }
            NativeHookMethods.InitializeGetMsgHook(0, handle);
        }