+2003-07-11 Casper S. Hornstrup <chorns@users.sourceforge.net>
+
+ * apps/tests/bitblt/bitblt.c (MainWndProc): Declare variables
+ before any statements are processed in the scope.
+ * apps/tests/icontest/icontest.c (WinMain): Ditto.
+ * apps/tests/wm_paint/wm_paint.c (WinMain, MainWndProc): Ditto.
+
2003-07-11 Casper S. Hornstrup <chorns@users.sourceforge.net>
* lib/user32/controls/button.c (PB_Paint, GB_Paint): Declare variables
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
+ WNDCLASS wc;
+ MSG msg;
+
HInst = HInstance;
- WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
ShowWindow(HWnd, nCmdShow);
UpdateWindow(HWnd);
- MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
+ MSG msg;
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
ShowWindow(HWnd, nCmdShow);
UpdateWindow(HWnd);
- MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam)
{
+ const char* text = "Persistent Text";
+
switch (Msg)
{
case WM_PAINT:
{
// determine the invalidated area of the window
- RECT RUpdate;
+ RECT RUpdate;
+ HDC Hdc;
GetUpdateRect(HWnd, &RUpdate, NULL);
// grab a handle to our window's
// common display device context
- HDC Hdc = GetDC(HWnd);
+ Hdc = GetDC(HWnd);
#if 0
try
#endif
FillRect(Hdc, &RClient, NULL);
// render the persistent text
- const char* text = "Persistent Text";
SetTextColor(Hdc, PALETTERGB(0, 0, 255));
DrawText(Hdc, text, strlen(text), &RClient,
DT_CENTER | DT_VCENTER | DT_SINGLELINE);