mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
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. svn path=/trunk/; revision=5080
This commit is contained in:
parent
6d1c6531b5
commit
fb2b3f263e
4 changed files with 18 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
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>
|
2003-07-11 Casper S. Hornstrup <chorns@users.sourceforge.net>
|
||||||
|
|
||||||
* lib/user32/controls/button.c (PB_Paint, GB_Paint): Declare variables
|
* lib/user32/controls/button.c (PB_Paint, GB_Paint): Declare variables
|
||||||
|
|
|
@ -22,9 +22,11 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
||||||
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
||||||
LPTSTR lpCmdLine, int nCmdShow)
|
LPTSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
|
WNDCLASS wc;
|
||||||
|
MSG msg;
|
||||||
|
|
||||||
HInst = HInstance;
|
HInst = HInstance;
|
||||||
|
|
||||||
WNDCLASS wc;
|
|
||||||
memset(&wc, 0, sizeof(WNDCLASS));
|
memset(&wc, 0, sizeof(WNDCLASS));
|
||||||
|
|
||||||
wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
|
wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
|
||||||
|
@ -51,7 +53,6 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
||||||
ShowWindow(HWnd, nCmdShow);
|
ShowWindow(HWnd, nCmdShow);
|
||||||
UpdateWindow(HWnd);
|
UpdateWindow(HWnd);
|
||||||
|
|
||||||
MSG msg;
|
|
||||||
while (GetMessage(&msg, NULL, 0, 0))
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
|
|
|
@ -18,11 +18,12 @@ WinMain(HINSTANCE hInstance,
|
||||||
LPSTR lpszCmdLine,
|
LPSTR lpszCmdLine,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
hInst = hInstance;
|
|
||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
|
|
||||||
|
hInst = hInstance;
|
||||||
|
|
||||||
wc.lpszClassName = "IconTestClass";
|
wc.lpszClassName = "IconTestClass";
|
||||||
wc.lpfnWndProc = MainWndProc;
|
wc.lpfnWndProc = MainWndProc;
|
||||||
wc.style = CS_VREDRAW | CS_HREDRAW;
|
wc.style = CS_VREDRAW | CS_HREDRAW;
|
||||||
|
|
|
@ -24,6 +24,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
||||||
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
||||||
LPTSTR lpCmdLine, int nCmdShow)
|
LPTSTR lpCmdLine, int nCmdShow)
|
||||||
{
|
{
|
||||||
|
MSG msg;
|
||||||
WNDCLASS wc;
|
WNDCLASS wc;
|
||||||
memset(&wc, 0, sizeof(WNDCLASS));
|
memset(&wc, 0, sizeof(WNDCLASS));
|
||||||
|
|
||||||
|
@ -47,7 +48,6 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
||||||
ShowWindow(HWnd, nCmdShow);
|
ShowWindow(HWnd, nCmdShow);
|
||||||
UpdateWindow(HWnd);
|
UpdateWindow(HWnd);
|
||||||
|
|
||||||
MSG msg;
|
|
||||||
while (GetMessage(&msg, NULL, 0, 0))
|
while (GetMessage(&msg, NULL, 0, 0))
|
||||||
{
|
{
|
||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
|
@ -63,17 +63,20 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
|
||||||
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
||||||
LPARAM LParam)
|
LPARAM LParam)
|
||||||
{
|
{
|
||||||
|
const char* text = "Persistent Text";
|
||||||
|
|
||||||
switch (Msg)
|
switch (Msg)
|
||||||
{
|
{
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
// determine the invalidated area of the window
|
// determine the invalidated area of the window
|
||||||
RECT RUpdate;
|
RECT RUpdate;
|
||||||
|
HDC Hdc;
|
||||||
GetUpdateRect(HWnd, &RUpdate, NULL);
|
GetUpdateRect(HWnd, &RUpdate, NULL);
|
||||||
|
|
||||||
// grab a handle to our window's
|
// grab a handle to our window's
|
||||||
// common display device context
|
// common display device context
|
||||||
HDC Hdc = GetDC(HWnd);
|
Hdc = GetDC(HWnd);
|
||||||
#if 0
|
#if 0
|
||||||
try
|
try
|
||||||
#endif
|
#endif
|
||||||
|
@ -93,7 +96,6 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
|
||||||
FillRect(Hdc, &RClient, NULL);
|
FillRect(Hdc, &RClient, NULL);
|
||||||
|
|
||||||
// render the persistent text
|
// render the persistent text
|
||||||
const char* text = "Persistent Text";
|
|
||||||
SetTextColor(Hdc, PALETTERGB(0, 0, 255));
|
SetTextColor(Hdc, PALETTERGB(0, 0, 255));
|
||||||
DrawText(Hdc, text, strlen(text), &RClient,
|
DrawText(Hdc, text, strlen(text), &RClient,
|
||||||
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
|
Loading…
Reference in a new issue