reactos/modules/rostests/apitests/win32nt/ntuser/NtUserGetTitleBarInfo.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

48 lines
1.2 KiB
C

/*
* PROJECT: ReactOS api tests
* LICENSE: GPL - See COPYING in the top level directory
* PURPOSE: Test for NtUserGetTitleBarInfo
* PROGRAMMERS:
*/
#include "../win32nt.h"
START_TEST(NtUserGetTitleBarInfo)
{
HINSTANCE hinst = GetModuleHandle(NULL);
HWND hWnd;
TITLEBARINFO tbi;
hWnd = CreateWindowA("BUTTON",
"Test",
BS_PUSHBUTTON | WS_VISIBLE,
0,
0,
50,
30,
NULL,
NULL,
hinst,
0);
ASSERT(hWnd);
/* FALSE case */
/* no windows handle */
TEST(NtUserGetTitleBarInfo(NULL, &tbi) == FALSE);
/* no TITLEBARINFO struct */
TEST(NtUserGetTitleBarInfo(hWnd, NULL) == FALSE);
/* nothing */
TEST(NtUserGetTitleBarInfo(NULL, NULL) == FALSE);
/* wrong size */
tbi.cbSize = 0;
TEST(NtUserGetTitleBarInfo(hWnd, &tbi) == FALSE);
/* TRUE case */
tbi.cbSize = sizeof(TITLEBARINFO);
TEST(NtUserGetTitleBarInfo(hWnd, &tbi) == TRUE);
DestroyWindow(hWnd);
}