- Fix warnings in ros' tests

svn path=/trunk/; revision=38887
This commit is contained in:
Stefan Ginsberg 2009-01-18 12:20:51 +00:00
parent 26a6195563
commit eef79b36ef
11 changed files with 23 additions and 27 deletions

View file

@ -15,7 +15,6 @@ WinMain(HINSTANCE hInstance,
int nCmdShow)
{
WNDCLASSW wc;
MSG msg;
HWND hWnd;
WCHAR WindowTextW[256];
char WindowTextA[256];
@ -32,11 +31,11 @@ WinMain(HINSTANCE hInstance,
wc.cbWndExtra = 0;
if (RegisterClassW(&wc) == 0)
{
fprintf(stderr, "RegisterClassW failed (last error 0x%X)\n",
fprintf(stderr, "RegisterClassW failed (last error 0x%lu)\n",
GetLastError());
return 1;
}
printf("Unicode class registered, WndProc = 0x%08x\n", wc.lpfnWndProc);
printf("Unicode class registered, WndProc = 0x%p\n", wc.lpfnWndProc);
hWnd = CreateWindowA("UnicodeClass",
"Unicode Window",
@ -51,7 +50,7 @@ WinMain(HINSTANCE hInstance,
NULL);
if (hWnd == NULL)
{
fprintf(stderr, "CreateWindowA failed (last error 0x%X)\n",
fprintf(stderr, "CreateWindowA failed (last error 0x%lu)\n",
GetLastError());
return 1;
}
@ -61,7 +60,7 @@ WinMain(HINSTANCE hInstance,
printf("Calling GetWindowTextW\n");
if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))
{
fprintf(stderr, "GetWindowTextW failed (last error 0x%X)\n", GetLastError());
fprintf(stderr, "GetWindowTextW failed (last error 0x%lu)\n", GetLastError());
return 1;
}
printf("GetWindowTextW returned Unicode string \"%S\"\n", WindowTextW);
@ -69,43 +68,43 @@ WinMain(HINSTANCE hInstance,
printf("Calling GetWindowTextA\n");
if (! GetWindowTextA(hWnd, WindowTextA, sizeof(WindowTextA) / sizeof(WindowTextA[0])))
{
fprintf(stderr, "GetWindowTextA failed (last error 0x%X)\n", GetLastError());
fprintf(stderr, "GetWindowTextA failed (last error 0x%lu)\n", GetLastError());
return 1;
}
printf("GetWindowTextA returned Ansi string \"%s\"\n", WindowTextA);
printf("\n");
SavedWndProcW = (WNDPROC) GetWindowLongW(hWnd, GWL_WNDPROC);
printf("GetWindowLongW returned 0x%08x\n", SavedWndProcW);
printf("GetWindowLongW returned 0x%p\n", SavedWndProcW);
SavedWndProcA = (WNDPROC) GetWindowLongA(hWnd, GWL_WNDPROC);
printf("GetWindowLongA returned 0x%08x\n", SavedWndProcA);
printf("GetWindowLongA returned 0x%p\n", SavedWndProcA);
printf("\n");
printf("Subclassing window using SetWindowLongW, new WndProc 0x%08x\n", UnicodeSubclassProc);
printf("Subclassing window using SetWindowLongW, new WndProc 0x%p\n", UnicodeSubclassProc);
SetWindowLongW(hWnd, GWL_WNDPROC, (LONG) UnicodeSubclassProc);
printf("After subclass, IsWindowUnicode %s, WndProcA 0x%08x, WndProcW 0x%08x\n",
printf("After subclass, IsWindowUnicode %s, WndProcA 0x%lx, WndProcW 0x%lx\n",
IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongA(hWnd, GWL_WNDPROC),
GetWindowLongW(hWnd, GWL_WNDPROC));
printf("Calling GetWindowTextW\n");
if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))
{
fprintf(stderr, "GetWindowTextW failed (last error 0x%X)\n", GetLastError());
fprintf(stderr, "GetWindowTextW failed (last error 0x%lu)\n", GetLastError());
return 1;
}
printf("GetWindowTextW returned Unicode string \"%S\"\n", WindowTextW);
printf("\n");
printf("Subclassing window using SetWindowLongA, new WndProc 0x%08x\n", AnsiSubclassProc);
printf("Subclassing window using SetWindowLongA, new WndProc 0x%p\n", AnsiSubclassProc);
SetWindowLongA(hWnd, GWL_WNDPROC, (LONG) AnsiSubclassProc);
printf("After subclass, IsWindowUnicode %s, WndProcA 0x%08x, WndProcW 0x%08x\n",
printf("After subclass, IsWindowUnicode %s, WndProcA 0x%lx, WndProcW 0x%lx\n",
IsWindowUnicode(hWnd) ? "TRUE" : "FALSE", GetWindowLongA(hWnd, GWL_WNDPROC),
GetWindowLongW(hWnd, GWL_WNDPROC));
printf("Calling GetWindowTextW\n");
if (! GetWindowTextW(hWnd, WindowTextW, sizeof(WindowTextW) / sizeof(WindowTextW[0])))
{
fprintf(stderr, "GetWindowTextW failed (last error 0x%X)\n", GetLastError());
fprintf(stderr, "GetWindowTextW failed (last error 0x%lu)\n", GetLastError());
return 1;
}
printf("GetWindowTextW returned Unicode string \"%S\"\n", WindowTextW);

View file

@ -1,4 +1,4 @@
<module name="subclass" type="win32gui" installbase="bin" installname="subclass.exe" allowwarnings="true">
<module name="subclass" type="win32gui" installbase="bin" installname="subclass.exe">
<define name="__USE_W32API" />
<library>kernel32</library>
<library>user32</library>