Beispiel #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);
                }
            }
        }
Beispiel #2
0
 public static extern int TranslateAccelerator(HWND hwnd, HANDLE hAccTable, ref MSG lpMsg);
Beispiel #3
0
 public static extern int PeekMessage(ref MSG lpMsg, HWND hwnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg);
Beispiel #4
0
 public static extern int IsDialogMessage(HANDLE hDlg, ref MSG lpMsg);
Beispiel #5
0
 public static extern int GetMessage(ref MSG lpMsg, HWND hwnd, int wMsgFilterMin, int wMsgFilterMax);
Beispiel #6
0
 public static extern int DispatchMessage(ref MSG lpMsg);
Beispiel #7
0
 public static extern int CallMsgFilter(ref MSG lpMsg, int ncode);
Beispiel #8
0
 public static unsafe extern BOOL PeekMessage(MSG* lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax, uint wRemoveMsg);
Beispiel #9
0
 public static extern bool GetMessage(out MSG lpMsg, IntPtr hWnd, uint wMsgFilterMin, uint wMsgFilterMax);
Beispiel #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();
        }
Beispiel #11
0
 public static extern bool PeekMessage(
     out MSG lpMsg,
     IntPtr hWnd,
     int wMsgFilterMin,
     int wMsgFilterMax,
     PM wRemoveMsg
     );
Beispiel #12
0
 public static extern bool PeekMessage(out MSG message, IntPtr hwnd, uint messageFilterMin, uint messageFilterMax, uint flags);
Beispiel #13
0
 public static extern bool PeekMessage(out MSG message, IntPtr handle, uint filterMin, uint filterMax, PM flags);
Beispiel #14
0
 public static unsafe extern BOOL TranslateMessage(MSG* lpMsg);
Beispiel #15
0
 public static extern int TranslateMDISysAccel(HWND hwndClient, ref MSG lpMsg);
Beispiel #16
0
 public static extern int TranslateMessage(ref MSG lpMsg);
Beispiel #17
0
 public static unsafe extern IntPtr DispatchMessage(MSG* lpMsg);