1 /* 2 * PROJECT: ReactOS api tests 3 * LICENSE: GPL - See COPYING in the top level directory 4 * PURPOSE: Test for NtUserCallHwndLock 5 * PROGRAMMERS: 6 */ 7 8 #include <win32nt.h> 9 10 11 12 13 HMENU g_hMenu; 14 15 void 16 Test_HwndLockRoutine_WindowHasShadow(HWND hWnd) /* 0x53 */ 17 { 18 // TEST(NtUserCallHwndLock(hWnd, 0x53) == 0); 19 20 } 21 22 23 void 24 Test_HwndLockRoutine_ArrangeIconicWindows(HWND hWnd) /* 0x54 */ 25 { 26 // TEST(NtUserCallHwndLock(hWnd, _HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS) == 0); 27 28 } 29 30 void 31 Test_HwndLockRoutine_DrawMenuBar(HWND hWnd) /* 0x55 */ 32 { 33 TEST(NtUserCallHwndLock(hWnd, 0x55) == 1); 34 return APISTATUS_NORMAL; 35 } 36 37 void 38 Test_HwndLockRoutine_CheckImeShowStatusInThread(HWND hWnd) /* 0x56 */ 39 { 40 TEST(NtUserCallHwndLock(hWnd, 0x56) != 0); 41 42 } 43 44 void 45 Test_HwndLockRoutine_GetSysMenuHandle(HWND hWnd) /* 0x57 */ 46 { 47 NtUserCallHwndLock(hWnd, 0x5c); 48 // HMENU hMenu = (HMENU)NtUserCallHwndLock(hWnd, 0x57); 49 // TEST(hMenu != 0); 50 51 } 52 53 void 54 Test_HwndLockRoutine_RedrawFrame(HWND hWnd) /* 0x58 */ 55 { 56 // TEST(NtUserCallHwndLock(hWnd, 0x68) != 0); 57 58 } 59 60 void 61 Test_HwndLockRoutine_UpdateWindow(HWND hWnd) /* 0x5e */ 62 { 63 TEST(NtUserCallHwndLock(hWnd, 0x5e) == 1); 64 65 } 66 67 START_TEST(NtUserCallHwndLock) 68 { 69 HWND hWnd; 70 g_hMenu = CreateMenu(); 71 72 hWnd = CreateWindowA("BUTTON", 73 "Test", 74 BS_PUSHBUTTON | WS_VISIBLE, 75 0, 76 0, 77 50, 78 30, 79 NULL, 80 g_hMenu, 81 g_hInstance, 82 0); 83 ASSERT(hWnd); 84 85 SetLastError(ERROR_SUCCESS); 86 TEST(NtUserCallHwndLock((HWND)-22, 999) == 0); 87 TEST(GetLastError() == ERROR_INVALID_WINDOW_HANDLE); 88 89 SetLastError(ERROR_SUCCESS); 90 TEST(NtUserCallHwndLock((HWND)0, 0x55) == 0); 91 TEST(GetLastError() == ERROR_INVALID_WINDOW_HANDLE); 92 93 SetLastError(ERROR_SUCCESS); 94 TEST(NtUserCallHwndLock(hWnd, 999) == 0); 95 TEST(GetLastError() == ERROR_SUCCESS); 96 97 Test_HwndLockRoutine_WindowHasShadow (hWnd); /* 0x53 */ 98 Test_HwndLockRoutine_ArrangeIconicWindows(hWnd); 99 Test_HwndLockRoutine_DrawMenuBar(hWnd); 100 Test_HwndLockRoutine_CheckImeShowStatusInThread(hWnd); 101 Test_HwndLockRoutine_GetSysMenuHandle(hWnd); 102 Test_HwndLockRoutine_RedrawFrame(hWnd); 103 104 Test_HwndLockRoutine_UpdateWindow(hWnd); 105 106 DestroyWindow(hWnd); 107 108 } 109