reactos/rostests/apitests/user32/CreateWindowEx.c
Thomas Faber dde60eb9ef [USER32_APITEST]
- Add some tests for other WS_CHILD/WS_POPUP combinations

svn path=/trunk/; revision=69710
2015-10-26 12:12:01 +00:00

68 lines
2.5 KiB
C

/*
* PROJECT: ReactOS API tests
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Test for CreateWindowEx
* PROGRAMMERS: Thomas Faber <thomas.faber@reactos.org>
*/
#include <apitest.h>
#include <winuser.h>
START_TEST(CreateWindowEx)
{
HWND hWnd;
DWORD dwError;
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd != NULL, "hWnd = %p\n", hWnd);
ok(dwError == 0, "error = %lu\n", dwError);
DestroyWindow(hWnd);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, 0, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd == NULL, "hWnd = %p\n", hWnd);
ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd == NULL, "hWnd = %p\n", hWnd);
ok(dwError == ERROR_TLW_WITH_WSCHILD, "error = %lu\n", dwError);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd == NULL, "hWnd = %p\n", hWnd);
ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd != NULL, "hWnd = %p\n", hWnd);
ok(dwError == 0, "error = %lu\n", dwError);
DestroyWindow(hWnd);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_POPUP, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd == NULL, "hWnd = %p\n", hWnd);
ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD|WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd != NULL, "hWnd = %p\n", hWnd);
ok(dwError == 0, "error = %lu\n", dwError);
DestroyWindow(hWnd);
SetLastError(0x1234);
hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD|WS_POPUP, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
dwError = GetLastError();
ok(hWnd == NULL, "hWnd = %p\n", hWnd);
ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
}