Alexandre Julliard | a11d7b1 | 1998-03-01 20:05:02 +0000 | [diff] [blame] | 1 | #include <windows.h> /* required for all Windows applications */ |
| 2 | #include "globals.h" /* prototypes specific to this application */ |
| 3 | |
| 4 | |
| 5 | int APIENTRY WinMain(HINSTANCE hInstance, |
| 6 | HINSTANCE hPrevInstance, |
| 7 | LPSTR lpCmdLine, |
| 8 | int nCmdShow) |
| 9 | { |
| 10 | MSG msg; |
| 11 | HANDLE hAccelTable; |
| 12 | |
| 13 | /* Other instances of app running? */ |
| 14 | if (!hPrevInstance) |
| 15 | { |
| 16 | /* stuff to be done once */ |
| 17 | if (!InitApplication(hInstance)) |
| 18 | { |
| 19 | return FALSE; /* exit */ |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | /* stuff to be done every time */ |
| 24 | if (!InitInstance(hInstance, nCmdShow)) |
| 25 | { |
| 26 | return FALSE; |
| 27 | } |
| 28 | |
| 29 | hAccelTable = LoadAccelerators(hInstance, szAppName); |
| 30 | |
| 31 | /* Main loop */ |
| 32 | /* Acquire and dispatch messages until a WM_QUIT message is received */ |
| 33 | while (GetMessage(&msg, NULL, 0, 0)) |
| 34 | { |
| 35 | /* Add other Translation functions (for modeless dialogs |
| 36 | and/or MDI windows) here. */ |
| 37 | |
| 38 | if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) |
| 39 | { |
| 40 | TranslateMessage(&msg); |
| 41 | DispatchMessage(&msg); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | /* Add module specific instance free/delete functions here */ |
| 46 | |
| 47 | /* Returns the value from PostQuitMessage */ |
| 48 | return msg.wParam; |
| 49 | } |