internal static extern bool TranslateMessage([In] ref SafeNativeMethods.MSG lpMsg);
internal static extern int DispatchMessage([In] ref SafeNativeMethods.MSG lpmsg);
// Implements the message loop for the hidden window. internal void MessageLoop() { SafeNativeMethods.MSG msg = new SafeNativeMethods.MSG(); int bRet; // Start the message loop. while ((bRet = NativeMethods.GetMessage(out msg, _handle, 0, 0)) != 0) { if (bRet == -1) { throw new Win32Exception("Error in GetMessage."); } // Pass messages to the window's WndProc. NativeMethods.TranslateMessage(ref msg); NativeMethods.DispatchMessage(ref msg); } return; }
internal static extern int GetMessage( out SafeNativeMethods.MSG lpMsg, SafeWindowHandle hWnd, uint wMsgFilterMin, uint wMsgFilterMax);
internal static extern int GetMessage( out SafeNativeMethods.MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax);