示例#1
0
        private static unsafe void Main()
        {
            MainWindow mainWindow = new MainWindow();

            MSG message = new MSG();
            while (message.message != NativeConstants.WM_QUIT)
            {
                if (NativeMethods.PeekMessage(&message, IntPtr.Zero, 0, 0, NativeConstants.PM_REMOVE))
                {
                    NativeMethods.TranslateMessage(&message);
                    NativeMethods.DispatchMessage(&message);
                }
            }
        }
示例#2
0
 public static extern int TranslateAccelerator(HWND hwnd, HANDLE hAccTable, ref MSG lpMsg);
示例#3
0
 public static extern int PeekMessage(ref MSG lpMsg, HWND hwnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg);
示例#4
0
 public static extern int IsDialogMessage(HANDLE hDlg, ref MSG lpMsg);
示例#5
0
 public static extern int GetMessage(ref MSG lpMsg, HWND hwnd, int wMsgFilterMin, int wMsgFilterMax);
示例#6
0
 public static extern int DispatchMessage(ref MSG lpMsg);
示例#7
0
 public static extern int CallMsgFilter(ref MSG lpMsg, int ncode);
示例#8
0
 public static unsafe extern BOOL PeekMessage(MSG* lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg);
示例#9
0
 public static extern bool GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax);
示例#10
0
        public int Run()
        {
            Functions.ShowWindow(gameWindow.Handle, SW.SHOW);
            Functions.UpdateWindow(gameWindow.Handle);

            timer.Start();

            MSG msg = new MSG();

            while (msg.Message != WM.QUIT)
            {
                if (Functions.PeekMessage(out msg, IntPtr.Zero, 0, 0, PM.REMOVE))
                {
                    //messages++;
                    //Functions.SetWindowText(gameWindow.Handle, string.Format("Message #{0}: {1}", messages.ToString(), msg.Message.ToString()));

                    Functions.TranslateMessage(ref msg);
                    Functions.DispatchMessage(ref msg);
                }
                else
                {
                    gameWindow.OnNewFrame();
                    timer.UpdateTime();

                    if (NewFrame != null)
                    {
                        NewFrame(timer.RealTime);
                    }
                }

            }

            return msg.WParam.ToInt32();
        }
示例#11
0
 public static extern bool PeekMessage(
     out MSG lpMsg,
     IntPtr hWnd,
     int wMsgFilterMin,
     int wMsgFilterMax,
     PM wRemoveMsg
     );
示例#12
0
 public static extern bool PeekMessage(out MSG message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags);
示例#13
0
 public static extern bool PeekMessage(out MSG message, IntPtr handle, uint filterMin, uint filterMax, PM flags);
示例#14
0
 public static unsafe extern BOOL TranslateMessage(MSG* lpMsg);
示例#15
0
 public static extern int TranslateMDISysAccel(HWND hwndClient, ref MSG lpMsg);
示例#16
0
 public static extern int TranslateMessage(ref MSG lpMsg);
示例#17
0
 public static unsafe extern IntPtr DispatchMessage(MSG* lpMsg);