Disable some misleading service tests because a test cannot determine wheter or not...
[reactos.git] / rostests / apitests / user32 / GetPeekMessage.c
1 /*
2 * PROJECT: ReactOS api tests
3 * LICENSE: GPL - See COPYING in the top level directory
4 * PURPOSE: Test for GetMessage/PeekMessage
5 * PROGRAMMERS: Thomas Faber
6 */
7
8 #include <stdio.h>
9 #include <wine/test.h>
10 #include <windows.h>
11
12 void Test_GetMessage(HWND hWnd)
13 {
14 MSG msg;
15
16 SetLastError(DNS_ERROR_RCODE_NXRRSET);
17
18 ok(GetMessage(&msg, hWnd, 0, 0) == -1, "\n");
19 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetLastError() = %lu\n", GetLastError());
20 }
21
22 void Test_PeekMessage(HWND hWnd)
23 {
24 MSG msg;
25
26 SetLastError(DNS_ERROR_RCODE_NXRRSET);
27
28 ok(PeekMessage(&msg, hWnd, 0, 0, PM_NOREMOVE) == 0, "\n");
29 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "GetLastError() = %lu\n", GetLastError());
30 }
31
32 START_TEST(GetPeekMessage)
33 {
34 HWND hWnd = CreateWindowExW(0, L"EDIT", L"miau", 0, CW_USEDEFAULT, CW_USEDEFAULT,
35 CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), NULL);
36 ok(hWnd != INVALID_HANDLE_VALUE, "\n");
37 /* make sure we pass an invalid handle to GetMessage/PeekMessage */
38 ok(DestroyWindow(hWnd), "\n");
39
40 Test_GetMessage(hWnd);
41 Test_PeekMessage(hWnd);
42 }