13#define WND_PARENT_ID 1
74#define GET_PROC(dll, func) \
75 p ## func = (void*)GetProcAddress(dll, #func); \
77 trace("GetProcAddress(%s) failed\n", #func); \
98#define add_message(msg) add_message_(__LINE__, msg);
131 static const char *
const CBT_code_name[10] =
144 const char *code_name = (
msg->message <=
HCBT_SETFOCUS ? CBT_code_name[
msg->message] :
"Unknown");
147 msg->descr,
msg->message, code_name,
msg->wParam,
msg->lParam);
156 if (
msg->message >= 0xc000)
171 int min_timeout = 100;
196 unsigned int count = 0;
275#define ok_sequence(exp, contx, todo) \
276 ok_sequence_((exp), (contx), (todo), __FILE__, __LINE__)
285 int failcount = 0,
dump = 0;
286 unsigned int count = 0;
307 "%s: %u: in msg 0x%04x expecting wParam 0x%x got 0x%x\n",
314 "%s: %u: in msg 0x%04x expecting wParam 0x%x got 0x%x\n",
331 "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
338 "%s: %u: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
360 "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
367 "%s: %u: the msg 0x%04x should %shave been sent by DefWindowProc\n",
374 "%s: %u: the msg 0x%04x should %shave been sent by BeginPaint\n",
380 "%s: %u: the msg 0x%04x should have been %s\n",
386 "%s: %u: the msg 0x%04x was expected in %s\n",
392 "%s: %u: the msg 0x%04x should have been sent by a hook\n",
398 "%s: %u: the msg 0x%04x should have been sent by a winevent hook\n",
404 "%s: %u: the msg 0x%04x should have been sent by a keyboard hook\n",
425 ok_(
file,
line) (
FALSE,
"%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
432 ok_(
file,
line) (
FALSE,
"%s: %u: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
456 ok_(
file,
line) (
FALSE,
"%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
466 ok_(
file,
line) (
FALSE,
"%s: %u: the msg sequence is not complete: expected %04x - actual %04x\n",
470 if (
todo && !failcount)
483#define expect(EXPECTED,GOT) ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
489 static LONG defwndproc_counter = 0;
490 static LONG beginpaint_counter = 0;
503 msg.descr =
"MsgCheckProc";
506 defwndproc_counter++;
509 defwndproc_counter--;
639 { WM_UNINITMENUPOPUP,
sent |
lparam, 0, 0x20000000 },
656 message == WM_UNINITMENUPOPUP ||
673 msg.descr =
"parent_menu_proc";
703 100, 100, 200, 200, 0, 0, 0,
NULL);
709 trace(
"testing system menu\n");
733#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f)
752 win_skip(
"cannot set global hook, will skip hook tests\n");
764 ok(!pUnhookWinEvent(
hEvent_hook),
"UnhookWinEvent succeeded\n");
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
#define HeapFree(x, y, z)
#define ERROR_INVALID_HANDLE
BOOL WINAPI QueryActCtxW(IN DWORD dwFlags, IN HANDLE hActCtx, IN PVOID pvSubInstance, IN ULONG ulInfoClass, IN PVOID pvBuffer, IN SIZE_T cbBuffer, IN OUT SIZE_T *pcbWrittenOrRequired OPTIONAL)
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
DWORD WINAPI GetTickCount(VOID)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
GLuint GLuint GLsizei count
GLenum GLuint GLenum GLsizei const GLchar * buf
#define trace_(file, line,...)
#define sprintf(buf, format,...)
static HWINEVENTHOOK(WINAPI *pSetWinEventHook)(DWORD
static void dump(const void *ptr, unsigned len)
#define WS_OVERLAPPEDWINDOW
const char * winetest_platform
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK)
DWORD WINAPI GetLastError(void)
DWORD WINAPI GetCurrentThreadId(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
HGDIOBJ WINAPI GetStockObject(_In_ int)
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
HWND WINAPI CreateWindowExA(_In_ DWORD dwExStyle, _In_opt_ LPCSTR lpClassName, _In_opt_ LPCSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
#define WM_DWMNCRENDERINGCHANGED
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define MOUSEEVENTF_RIGHTUP
#define GetWindowLongPtrA
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
HHOOK WINAPI SetWindowsHookExA(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)
#define HCBT_CLICKSKIPPED
VOID WINAPI keybd_event(_In_ BYTE, _In_ BYTE, _In_ DWORD, _In_ ULONG_PTR)
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define MOUSEEVENTF_RIGHTDOWN
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyWindow(_In_ HWND)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)