コード例 #1
0
ファイル: LocalWindowsHook.cs プロジェクト: mryp/kkde
        // Default filter function
        public int CoreHookProc(int code, IntPtr wParam, IntPtr lParam)
        {
            if (code < 0)
            {
                return(CallNextHookEx(m_hhook, code, wParam, lParam));
            }

            // Let clients determine what to do
            HookEventArgs e = new HookEventArgs();

            e.HookCode = code;
            e.wParam   = wParam;
            e.lParam   = lParam;
            OnHookInvoked(e);

            // Yield to the next hook in the chain
            return(CallNextHookEx(m_hhook, code, wParam, lParam));
        }
コード例 #2
0
        // Windows hook event handler
        private void HookEventHandler(object sender, HookEventArgs e)
        {
            if (InRefreshingActiveWindow)
            {
                return;
            }

            Win32.CWPRETSTRUCT cwpret = (Win32.CWPRETSTRUCT)Marshal.PtrToStructure(e.lParam, typeof(Win32.CWPRETSTRUCT));
            int msg = cwpret.message;

            if (msg == (int)Win32.Msgs.WM_KILLFOCUS)
            {
                DockPane pane = GetPaneFromHandle((IntPtr)cwpret.wParam);
                if (pane == null)
                {
                    User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
                }
            }
            else if (msg == (int)Win32.Msgs.WM_SETFOCUS)
            {
                User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
            }
        }
コード例 #3
0
		// Default filter function
		public int CoreHookProc(int code, IntPtr wParam, IntPtr lParam)
		{
			if (code < 0)
				return CallNextHookEx(m_hhook, code, wParam, lParam);

			// Let clients determine what to do
			HookEventArgs e = new HookEventArgs();
			e.HookCode = code;
			e.wParam = wParam;
			e.lParam = lParam;
			OnHookInvoked(e);

			// Yield to the next hook in the chain
			return CallNextHookEx(m_hhook, code, wParam, lParam);
		}
コード例 #4
0
		protected void OnHookInvoked(HookEventArgs e)
		{
			if (HookInvoked != null)
				HookInvoked(this, e);
		}
コード例 #5
0
ファイル: DockPanel.cs プロジェクト: xuchuansheng/GenXSource
		// Windows hook event handler
		private void HookEventHandler(object sender, HookEventArgs e)
		{
			if (InRefreshingActiveWindow)
				return;

			Win32.Msgs msg = (Win32.Msgs)Marshal.ReadInt32(e.lParam, IntPtr.Size * 3);
 
			if (msg == Win32.Msgs.WM_KILLFOCUS)
			{
				IntPtr wParam = Marshal.ReadIntPtr(e.lParam, IntPtr.Size * 2);
				DockPane pane = GetPaneFromHandle(wParam);
				if (pane == null)
					User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
			}
			else if (msg == Win32.Msgs.WM_SETFOCUS)
				User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
		}
コード例 #6
0
ファイル: DockPanel.cs プロジェクト: heon21st/flashdevelop
		// Windows hook event handler
		private void HookEventHandler(object sender, HookEventArgs e)
		{
			if (InRefreshingActiveWindow)
				return;

			Win32.CWPRETSTRUCT cwpret = (Win32.CWPRETSTRUCT)Marshal.PtrToStructure(e.lParam, typeof(Win32.CWPRETSTRUCT));
			int msg = cwpret.message;

			if (msg == (int)Win32.Msgs.WM_KILLFOCUS)
			{
				DockPane pane = GetPaneFromHandle((IntPtr)cwpret.wParam);
				if (pane == null)
					User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
			}
			else if (msg == (int)Win32.Msgs.WM_SETFOCUS)
				User32.PostMessage(this.Handle, WM_REFRESHACTIVEWINDOW, 0, 0);
		}