riched20: Reduced screen flicker by using proper update region invalidation.
[wine/hacks.git] / programs / view / winmain.c
blob1dba678f6a98ec252b47671e769a3a8dd7fda932
1 /*
2 * Copyright 1998 Douglas Ridgway
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include <windows.h> /* required for all Windows applications */
20 #include "globals.h" /* prototypes specific to this application */
23 int APIENTRY WinMain(HINSTANCE hInstance,
24 HINSTANCE hPrevInstance,
25 LPSTR lpCmdLine,
26 int nCmdShow)
28 MSG msg;
29 HANDLE hAccelTable;
31 /* Other instances of app running? */
32 if (!hPrevInstance)
34 /* stuff to be done once */
35 if (!InitApplication(hInstance))
37 return FALSE; /* exit */
41 /* stuff to be done every time */
42 if (!InitInstance(hInstance, nCmdShow))
44 return FALSE;
47 hAccelTable = LoadAccelerators(hInstance, szAppName);
49 /* Main loop */
50 /* Acquire and dispatch messages until a WM_QUIT message is received */
51 while (GetMessage(&msg, NULL, 0, 0))
53 /* Add other Translation functions (for modeless dialogs
54 and/or MDI windows) here. */
56 if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
58 TranslateMessage(&msg);
59 DispatchMessage(&msg);
63 /* Add module specific instance free/delete functions here */
65 /* Returns the value from PostQuitMessage */
66 return msg.wParam;