reactos/modules/rostests/apitests/win32nt/ntuser/NtUserCallHwnd.c
Serge Gautherie a5c3bb5bce
[WIN32KNT_APITEST] 2 minor code improvements and a first fix (#5980)
- Update .rc filename; addendum to 7ad21a4 (r70458).
- Move one '#include "resource.h"' around to where it is needed.
  Addendum to e1b2e7a (r29284) then ec5e0ea (r48103).
- Adjust all '#include <win32nt.h>'
2023-11-16 21:57:10 +01:00

61 lines
1.5 KiB
C

/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtUserCallHwnd
* PROGRAMMERS:
*/
#include "../win32nt.h"
void
Test_HwndRoutine_DeregisterShellHookWindow(HWND hWnd)
{
TEST(NtUserCallHwnd(hWnd, _HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW) == TRUE);
}
void
Test_HwndRoutine_GetWindowContextHelpId (HWND hWnd)
{
TEST(NtUserCallHwndParam(hWnd, 0xbadb00b, _HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID) == TRUE);
TEST(NtUserCallHwnd(hWnd, _HWND_ROUTINE_GETWNDCONTEXTHLPID) == 0xbadb00b);
}
void
Test_HwndRoutine_SetMsgBox(HWND hWnd)
{
TEST(NtUserCallHwnd(hWnd, 0x49) != FALSE);
}
START_TEST(NtUserCallHwnd)
{
HWND hWnd;
hWnd = CreateWindowA("BUTTON",
"Test",
BS_PUSHBUTTON | WS_VISIBLE,
0,
0,
50,
30,
NULL,
NULL,
g_hInstance,
0);
ASSERT(hWnd);
SetLastError(ERROR_SUCCESS);
TEST(NtUserCallHwnd(hWnd, 0x44) == FALSE);
Test_HwndRoutine_DeregisterShellHookWindow(hWnd); /* 0x45 */
TEST(NtUserCallHwnd(hWnd, 0x46) == FALSE); // DWP_GetEnabledPopup
Test_HwndRoutine_GetWindowContextHelpId (hWnd); /* 0x47 */
TEST(NtUserCallHwnd(hWnd, 0x48) == TRUE);
Test_HwndRoutine_SetMsgBox(hWnd); /* 0x49 */
TEST(GetLastError() == ERROR_SUCCESS);
DestroyWindow(hWnd);
}