1 /*
2  * PROJECT:         ReactOS api tests
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * PURPOSE:         Test for NtUserCallHwnd
5  * PROGRAMMERS:
6  */
7 
8 #include "../win32nt.h"
9 
10 void
11 Test_HwndRoutine_DeregisterShellHookWindow(HWND hWnd)
12 {
13     TEST(NtUserCallHwnd(hWnd, _HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW) == TRUE);
14 
15 }
16 
17 void
18 Test_HwndRoutine_GetWindowContextHelpId (HWND hWnd)
19 {
20     TEST(NtUserCallHwndParam(hWnd, 0xbadb00b, _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID) == TRUE);
21     TEST(NtUserCallHwnd(hWnd, _HWND_ROUTINE_GETWNDCONTEXTHLPID) == 0xbadb00b);
22 
23 }
24 
25 void
26 Test_HwndRoutine_SetMsgBox(HWND hWnd)
27 {
28     TEST(NtUserCallHwnd(hWnd, 0x49) != FALSE);
29 
30 }
31 
32 
33 START_TEST(NtUserCallHwnd)
34 {
35     HWND hWnd;
36 
37     hWnd = CreateWindowA("BUTTON",
38                          "Test",
39                          BS_PUSHBUTTON | WS_VISIBLE,
40                          0,
41                          0,
42                          50,
43                          30,
44                          NULL,
45                          NULL,
46                          g_hInstance,
47                          0);
48     ASSERT(hWnd);
49 
50     SetLastError(ERROR_SUCCESS);
51     TEST(NtUserCallHwnd(hWnd, 0x44) == FALSE);
52     Test_HwndRoutine_DeregisterShellHookWindow(hWnd); /* 0x45 */
53     TEST(NtUserCallHwnd(hWnd, 0x46) == FALSE); // DWP_GetEnabledPopup
54     Test_HwndRoutine_GetWindowContextHelpId (hWnd); /* 0x47 */
55     TEST(NtUserCallHwnd(hWnd, 0x48) == TRUE);
56     Test_HwndRoutine_SetMsgBox(hWnd); /* 0x49 */
57     TEST(GetLastError() == ERROR_SUCCESS);
58 
59     DestroyWindow(hWnd);
60 }
61