public bool PreFilterMessage(ref Message m) { if (BypassedMessages.Contains(m.Msg)) { if (m.Msg == (int)WM.ACTIVATE) { if (m.WParam == IntPtr.Zero) { OnDeactivate(EventArgs.Empty); } else { OnActivated(EventArgs.Empty); } } m.Result = MyWindowsAPIWrapper.DefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam); return(true); } return(false); }
public bool PreFilterMessage(ref Message m) { if (m.Msg == (int)WinApi.WM.MOUSEMOVE) { return(false); } if (m.Msg == (int)WinApi.WM.CHAR) { return(false); } if (m.Msg == (int)WinApi.WM.SYSKEYDOWN) { return(true); } if (m.Msg == (int)WinApi.WM.SYSKEYUP) { return(true); } if (m.Msg == (int)WinApi.WM.SYSCHAR) { return(true); } if (m.Msg == (int)WinApi.WM.SYSDEADCHAR) { return(true); } if (m.Msg == (int)WinApi.WM.KEYUP) { return(true); } if (m.Msg == (int)WinApi.WM.KEYDOWN) { return(true); } if (m.Msg == (int)WinApi.WM.SYSCOMMAND) { //http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx WinApi.SystemCommands correctWParam = (WinApi.SystemCommands)((int)m.WParam & 0xFFF0); if (correctWParam == WinApi.SystemCommands.SC_MOUSEMENU) { return(true); } } if (m.Msg == (int)WinApi.WM.NCRBUTTONDOWN) { return(true); } //if (m.Msg == (int)WM.ACTIVATE || m.Msg == (int)WM.SIZE || m.Msg == (int)WM.ACTIVATEAPP || m.Msg == (int)WM.SETFOCUS) //{ // Debug.WriteLine((WM)m.Msg); //} if (MyFakes.ENABLE_DX11_RENDERER) { if (m.Msg == (int)WinApi.WM.ACTIVATE && MyRenderProxy.RenderThread.CurrentSettings.WindowMode == MyWindowModeEnum.Fullscreen) { MyRenderProxy.RenderThread.UpdateSize(MyWindowModeEnum.FullscreenWindow); } if (m.Msg == (int)WinApi.WM.SETFOCUS && MyRenderProxy.RenderThread.CurrentSettings.WindowMode == MyWindowModeEnum.Fullscreen) { MyRenderProxy.RenderThread.UpdateSize(MyWindowModeEnum.Fullscreen); MyRenderProxy.RestoreDXGISwapchainFullscreenMode(); } } if (BypassedMessages.Contains(m.Msg)) { if (m.Msg == (int)WinApi.WM.ACTIVATE) { if (m.WParam == IntPtr.Zero) { OnDeactivate(EventArgs.Empty); } else { OnActivated(EventArgs.Empty); } } if (m.Msg == (int)WinApi.WM.MOUSEMOVE) { OnMouseMove(m_emptyMouseEventArgs); } m.Result = WinApi.DefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam); return(true); } return(false); }
public bool PreFilterMessage(ref Message m) { if (m.Msg == (int)WinApi.WM.MOUSEMOVE) { return(false); } if (m.Msg == (int)WinApi.WM.CHAR) { return(false); } if (m.Msg == (int)WinApi.WM.SYSKEYDOWN) { return(true); } if (m.Msg == (int)WinApi.WM.SYSKEYUP) { return(true); } if (m.Msg == (int)WinApi.WM.SYSCHAR) { return(true); } if (m.Msg == (int)WinApi.WM.SYSDEADCHAR) { return(true); } if (m.Msg == (int)WinApi.WM.KEYUP) { return(true); } if (m.Msg == (int)WinApi.WM.KEYDOWN) { return(true); } if (m.Msg == (int)WinApi.WM.SYSCOMMAND) { //http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx WinApi.SystemCommands correctWParam = (WinApi.SystemCommands)((int)m.WParam & 0xFFF0); if (correctWParam == WinApi.SystemCommands.SC_MOUSEMENU) { return(true); } } if (m.Msg == (int)WinApi.WM.NCRBUTTONDOWN) { return(true); } if (m.Msg == (int)WinApi.WM.ACTIVATE) { MyRenderProxy.HandleFocusMessage(MyWindowFocusMessage.Activate); } if (m.Msg == (int)WinApi.WM.SETFOCUS) { MyRenderProxy.HandleFocusMessage(MyWindowFocusMessage.SetFocus); } if (BypassedMessages.Contains(m.Msg)) { if (m.Msg == (int)WinApi.WM.ACTIVATE) { if (m.WParam == IntPtr.Zero) { OnDeactivate(EventArgs.Empty); } else { OnActivated(EventArgs.Empty); } } if (m.Msg == (int)WinApi.WM.MOUSEMOVE) { OnMouseMove(m_emptyMouseEventArgs); } m.Result = WinApi.DefWindowProc(m.HWnd, m.Msg, m.WParam, m.LParam); return(true); } return(false); }