ReactOS 0.4.15-dev-6055-g36cdd34
msg.c File Reference
#include <assert.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "dbt.h"
#include "wine/test.h"
Include dependency graph for msg.c:

Go to the source code of this file.

Classes

struct  DRAW_ITEM_STRUCT
 
struct  MEASURE_ITEM_STRUCT
 
struct  message
 
struct  recvd_message
 
struct  wnd_event
 
struct  timer_info
 
struct  sendmsg_info
 
struct  peekmsg_info
 
struct  rbuttonup_thread_data
 
struct  layered_window_info
 

Macros

#define MDI_FIRST_CHILD_ID   2004
 
#define SWP_NOCLIENTSIZE   0x0800
 
#define SWP_NOCLIENTMOVE   0x1000
 
#define SWP_STATECHANGED   0x8000
 
#define SW_NORMALNA   0xCC /* undoc. flag in MinMaximize */
 
#define WM_KEYF1   0x004d
 
#define WM_SYSTIMER   0x0118
 
#define WND_PARENT_ID   1
 
#define WND_POPUP_ID   2
 
#define WND_CHILD_ID   3
 
#define WM_LBTRACKPOINT   0x0131
 
#define ARCH   "none"
 
#define GET_PROC(dll, func)
 
#define DUMP(flag)   do { if (flags & flag) { strcat( buffer, "|" #flag ); flags &= ~flag; } } while(0)
 
#define add_message(msg)   add_message_(__LINE__,msg);
 
#define ok_sequence(exp, contx, todo)    ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)
 
#define expect(EXPECTED, GOT)   ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))
 
#define test_msg_setpos(expected_list, flags, todo)    test_msg_setpos_( (expected_list), (flags), (todo), __FILE__, __LINE__)
 
#define ID_BUTTON   0x000e
 
#define ID_RADIO1   501
 
#define ID_RADIO2   502
 
#define ID_RADIO3   503
 
#define ID_TEXT   504
 
#define test_radio(r1, s1, r2, s2, r3, s3)   test_radio_dbg(r1, s1, r2, s2, r3, s3, __LINE__)
 
#define ID_COMBOBOX   0x000f
 
#define check_update_rgn(hwnd, hrgn)   check_update_rgn_( __LINE__, hwnd, hrgn )
 
#define TIMER_ID   0x19
 
#define TIMER_COUNT_EXPECTED   100
 
#define TIMER_COUNT_TOLERANCE   10
 
#define ID_EDIT   0x1234
 
#define EV_STOP   0
 
#define EV_SENDMSG   1
 
#define EV_ACK   2
 
#define STEP   5
 
#define track_hover(track_hwnd, track_hover_time)
 
#define track_query(expected_track_flags, expected_track_hwnd, expected_hover_time)
 
#define track_hover_cancel(track_hwnd)
 
#define WS_BASE   (WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_POPUP|WS_CLIPSIBLINGS)
 
#define set_selection(hctl, start, end)
 
#define check_selection(hctl, start, end)
 
#define ID_LISTBOX   0x000f
 
#define check_lb_state(a1, a2, a3, a4, a5)   check_lb_state_dbg(a1, a2, a3, a4, a5, __LINE__)
 
#define clear_clipboard(hwnd)   clear_clipboard_(__LINE__, (hwnd))
 
#define expect_HWND(expected, got)   expect_HWND_(__LINE__, (expected), (got))
 
#define X(f)   p##f = (void*)GetProcAddress(hKernel32, #f)
 

Typedefs

typedef BOOL(WINAPIIS_WINEVENT_HOOK_INSTALLED) (DWORD)
 

Enumerations

enum  msg_flags_t {
  sent = 0x1 , posted = 0x2 , parent = 0x4 , wparam = 0x8 ,
  lparam = 0x10 , defwinproc = 0x20 , beginpaint = 0x40 , optional = 0x80 ,
  hook = 0x100 , winevent_hook =0x200 , id = 0x400 , custdraw = 0x800 ,
  sent = 0x1 , posted = 0x2 , parent = 0x4 , wparam = 0x8 ,
  lparam = 0x10 , defwinproc = 0x20 , beginpaint = 0x40 , optional = 0x80 ,
  hook = 0x100 , winevent_hook =0x200 , id = 0x400 , sent =0x1 ,
  posted =0x2 , parent =0x4 , wparam =0x8 , lparam =0x10 ,
  defwinproc =0x20 , beginpaint =0x40 , optional =0x80 , hook =0x100 ,
  winevent_hook =0x200 , sent =0x1 , posted =0x2 , parent =0x4 ,
  wparam =0x8 , lparam =0x10 , defwinproc =0x20 , beginpaint =0x40 ,
  optional =0x80 , hook =0x100 , winevent_hook =0x200 , kbd_hook =0x400
}
 

Functions

static BOOL (WINAPI *pActivateActCtx)(HANDLE
 
static ULONG_PTR *static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW)
 
static void void SIZE_T *static void (WINAPI *pReleaseActCtx)(HANDLE)
 
static LRESULT WINAPI ParentMsgCheckProcA (HWND, UINT, WPARAM, LPARAM)
 
static HWND (WINAPI *pGetAncestor)(HWND
 
static HWINEVENTHOOK (WINAPI *pSetWinEventHook)(DWORD
 
static HMONITOR (WINAPI *pMonitorFromPoint)(POINT
 
static UINT_PTR (WINAPI *pSetSystemTimer)(HWND
 
static void init_procs (void)
 
static const charget_winpos_flags (UINT flags)
 
static BOOL ignore_message (UINT message)
 
static unsigned hash_Ly_W (const WCHAR *str)
 
static unsigned hash_Ly (const char *str)
 
static void add_message_ (int line, const struct recvd_message *msg)
 
static void flush_events (void)
 
static void flush_sequence (void)
 
static void dump_sequence (const struct message *expected, const char *context, const char *file, int line)
 
static void ok_sequence_ (const struct message *expected_list, const char *context, BOOL todo, const char *file, int line)
 
static LRESULT WINAPI mdi_client_hook_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI mdi_child_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI mdi_frame_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL mdi_RegisterWindowClasses (void)
 
static void test_mdi_messages (void)
 
static void test_WM_SETREDRAW (HWND hwnd)
 
static INT_PTR CALLBACK TestModalDlgProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK TestModalDlgProc2 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_hv_scroll_1 (HWND hwnd, INT ctl, DWORD clear, DWORD set, INT min, INT max)
 
static void test_hv_scroll_2 (HWND hwnd, INT ctl, DWORD clear, DWORD set, INT min, INT max)
 
static void test_scroll_messages (HWND hwnd)
 
static void test_showwindow (void)
 
static void test_recursive_activation (void)
 
static void test_sys_menu (void)
 
static void CALLBACK apc_test_proc (ULONG_PTR param)
 
static void test_MsgWaitForMultipleObjects (HWND hwnd)
 
static void test_WM_DEVICECHANGE (HWND hwnd)
 
static DWORD CALLBACK show_window_thread (LPVOID arg)
 
static void test_msg_setpos_ (const struct message *expected_list, UINT flags, BOOL todo, const char *file, int line)
 
static void test_messages (void)
 
static void test_setwindowpos (void)
 
static void invisible_parent_tests (void)
 
static LRESULT CALLBACK button_hook_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void subclass_button (void)
 
static void test_button_messages (void)
 
static void test_button_bm_get_set_image (void)
 
static INT_PTR WINAPI radio_test_dlg_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void test_autoradio_BM_CLICK (void)
 
static void test_radio_dbg (HWND radio1, int state1, HWND radio2, int state2, HWND radio3, int state3, int line)
 
static void set_radio (HWND radio1, int state1, HWND radio2, int state2, HWND radio3, int state3)
 
static void test_autoradio_kbd_move (void)
 
static LRESULT CALLBACK static_hook_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void subclass_static (void)
 
static void test_static_messages (void)
 
static LRESULT CALLBACK combobox_edit_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK combobox_lbox_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK combobox_hook_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void subclass_combobox (void)
 
static void test_combobox_messages (void)
 
static LRESULT WINAPI wmime_keydown_procA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void register_wmime_keydown_class (void)
 
static void test_wmime_keydown_message (void)
 
void dump_region (HRGN hrgn)
 
static void check_update_rgn_ (int line, HWND hwnd, HRGN hrgn)
 
static void test_paint_messages (void)
 
static DWORD WINAPI thread_proc (void *param)
 
static DWORD CALLBACK create_grand_child_thread (void *param)
 
static DWORD CALLBACK create_child_thread (void *param)
 
static void create_manifest_file (const char *filename, const char *manifest)
 
static HANDLE test_create (const char *file)
 
static void test_interthread_messages (void)
 
static void pump_msg_loop (HWND hwnd, HACCEL hAccel)
 
static void test_accelerators (void)
 
static LRESULT MsgCheckProc (BOOL unicode, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI MsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI MsgCheckProcW (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI PopupMsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static INT_PTR CALLBACK StopQuitMsgCheckProcA (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
static LRESULT WINAPI TestDlgProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI ShowWindowProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI recursive_activation_wndprocA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI PaintLoopProcA (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI HotkeyMsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL RegisterWindowClasses (void)
 
static BOOL is_our_logged_class (HWND hwnd)
 
static LRESULT CALLBACK cbt_hook_proc (int nCode, WPARAM wParam, LPARAM lParam)
 
static void CALLBACK win_event_proc (HWINEVENTHOOK hevent, DWORD event, HWND hwnd, LONG object_id, LONG child_id, DWORD thread_id, DWORD event_time)
 
static LRESULT CALLBACK MsgConversionProcW (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK get_text_len_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void test_message_conversion (void)
 
static VOID CALLBACK tfunc (HWND hwnd, UINT uMsg, UINT_PTR id, DWORD dwTime)
 
static void CALLBACK callback_count (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
 
static void CALLBACK callback_exception (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
 
static DWORD WINAPI timer_thread_proc (LPVOID x)
 
static void test_timers (void)
 
static void test_timers_no_wnd (void)
 
static void test_timers_exception (DWORD code)
 
static void test_timers_exceptions (void)
 
static void CALLBACK win_event_global_hook_proc (HWINEVENTHOOK hevent, DWORD event, HWND hwnd, LONG object_id, LONG child_id, DWORD thread_id, DWORD event_time)
 
static LRESULT CALLBACK cbt_global_hook_proc (int nCode, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI win_event_global_thread_proc (void *param)
 
static DWORD WINAPI cbt_global_hook_thread_proc (void *param)
 
static DWORD WINAPI mouse_ll_global_thread_proc (void *param)
 
static void test_winevents (void)
 
static void test_set_hook (void)
 
static LRESULT WINAPI rec_get_message_hook (int code, WPARAM w, LPARAM l)
 
static void test_recursive_hook (void)
 
static void test_scrollwindowex (void)
 
static void test_DestroyWindow (void)
 
static LRESULT WINAPI DispatchMessageCheckProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_DispatchMessage (void)
 
static DWORD CALLBACK send_msg_thread (LPVOID arg)
 
static void wait_for_thread (HANDLE thread)
 
static LRESULT WINAPI send_msg_delay_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_SendMessageTimeout (void)
 
static LRESULT CALLBACK edit_hook_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void subclass_edit (void)
 
static void test_edit_messages (void)
 
static DWORD CALLBACK send_msg_thread_2 (void *param)
 
static void test_PeekMessage (void)
 
static void wait_move_event (HWND hwnd, int x, int y)
 
static void test_PeekMessage2 (void)
 
static void test_PeekMessage3 (void)
 
static INT_PTR CALLBACK wm_quit_dlg_proc (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
static void test_quit_message (void)
 
static void test_notify_message (void)
 
static void pump_msg_loop_timeout (DWORD timeout, BOOL inject_mouse_move)
 
static void test_TrackMouseEvent (void)
 
static void test_SetWindowRgn (void)
 
static void test_ShowWindow (void)
 
static INT_PTR WINAPI test_dlg_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI dlg_creation_edit_proc (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
static INT_PTR WINAPI test_dlg_proc2 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static INT_PTR WINAPI test_dlg_proc3 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI test_dlg_proc4 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_dialog_messages (void)
 
static void test_enddialog_seq (HWND dialog, HWND owner)
 
static void test_enddialog_seq2 (HWND dialog, HWND owner)
 
static void test_EndDialog (void)
 
static void test_nullCallback (void)
 
static void test_SetActiveWindow (void)
 
static void test_SetForegroundWindow (void)
 
static DWORD get_input_codepage (void)
 
static void test_dbcs_wm_char (void)
 
static void test_unicode_wm_char (void)
 
static LRESULT (WINAPI *listbox_orig_proc)(HWND
 
static LRESULT WINAPI listbox_hook_proc (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
static void check_lb_state_dbg (HWND listbox, int count, int cur_sel, int caret_index, int top_index, int line)
 
static void test_listbox_messages (void)
 
static LRESULT WINAPI parent_menu_proc (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
static void set_menu_style (HMENU hmenu, DWORD style)
 
static DWORD get_menu_style (HMENU hmenu)
 
static void test_menu_messages (void)
 
static void test_paintingloop (void)
 
static DWORD CALLBACK post_rbuttonup_msg (void *arg)
 
static void test_defwinproc (void)
 
static void test_desktop_winproc (void)
 
static void clear_clipboard_ (int line, HWND hWnd)
 
static void expect_HWND_ (int line, HWND expected, HWND got)
 
static LRESULT CALLBACK recursive_viewer_proc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_clipboard_viewers (void)
 
static void test_PostMessage (void)
 
static LRESULT WINAPI broadcast_test_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_broadcast (void)
 
static DWORD CALLBACK do_wait_idle_child_thread (void *arg)
 
static void do_wait_idle_child (int arg)
 
static LRESULT CALLBACK wait_idle_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static DWORD CALLBACK wait_idle_thread (void *arg)
 
static void test_WaitForInputIdle (char *argv0)
 
static void test_SetParent (void)
 
static void test_keyflags (void)
 
static LRESULT CALLBACK KeyboardHookProc (int nCode, WPARAM wParam, LPARAM lParam)
 
static void test_hotkey (void)
 
static void test_SetFocus (void)
 
static DWORD CALLBACK update_layered_proc (void *param)
 
static void test_layered_window (void)
 
static LRESULT WINAPI cancel_popup_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI cancel_init_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_TrackPopupMenu (void)
 
static void test_TrackPopupMenuEmpty (void)
 
static DWORD WINAPI SendMessage_thread_1 (void *param)
 
static DWORD WINAPI SendMessage_thread_2 (void *param)
 
static void test_SendMessage_other_thread (int thread_n)
 
static LRESULT CALLBACK insendmessage_wnd_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void CALLBACK msg_callback (HWND hwnd, UINT msg, ULONG_PTR arg, LRESULT result)
 
static DWORD WINAPI send_message_thread (void *arg)
 
static void test_InSendMessage (void)
 
static void test_DoubleSetCapture (void)
 
static void test_restore_messages (void)
 
static void test_invalid_window (void)
 
static void init_funcs (void)
 
 START_TEST (msg)
 
static void init_tests ()
 
static void cleanup_tests ()
 
 START_TEST (msg_queue)
 
 START_TEST (msg_messages)
 
 START_TEST (msg_focus)
 
 START_TEST (msg_winpos)
 
 START_TEST (msg_paint)
 
 START_TEST (msg_input)
 
 START_TEST (msg_timer)
 
 START_TEST (msg_hook)
 
 START_TEST (msg_menu)
 
 START_TEST (msg_mdi)
 
 START_TEST (msg_controls)
 
 START_TEST (msg_layered_window)
 
 START_TEST (msg_dialog)
 
 START_TEST (msg_clipboard)
 

Variables

static ULONG_PTR
 
static HANDLE
 
static void ULONG
 
static void void SIZE_T
 
static BOOL test_DestroyWindow_flag
 
static BOOL test_context_menu
 
static HWINEVENTHOOK hEvent_hook
 
static HHOOK hKBD_hook
 
static HHOOK hCBT_hook
 
static DWORD cbt_hook_thread_id
 
static const WCHAR testWindowClassW []
 
static const struct message WmEmptySeq []
 
static const struct message WmCreateOverlappedSeq []
 
static const struct message WmSWP_ShowOverlappedSeq []
 
static const struct message WmSWP_HideOverlappedSeq []
 
static const struct message WmSWP_ResizeSeq []
 
static const struct message WmSWP_ResizePopupSeq []
 
static const struct message WmSWP_MoveSeq []
 
static const struct message WmSWP_ResizeNoZOrder []
 
static const struct message WmSwitchChild []
 
static const struct message WmSwitchNotMaximizedChild []
 
static const struct message WmSWP_FrameChanged_clip []
 
static const struct message WmSWP_FrameChangedDeferErase []
 
static const struct message WmSWP_FrameChanged_noclip []
 
static const struct message WmShowOverlappedSeq []
 
static const struct message WmShowMaxOverlappedSeq []
 
static const struct message WmShowRestoreMaxOverlappedSeq []
 
static const struct message WmShowRestoreMinOverlappedSeq []
 
static const struct message WmShowMinOverlappedSeq []
 
static const struct message WmHideOverlappedSeq []
 
static const struct message WmDestroyOverlappedSeq []
 
static const struct message WmCreateMaxPopupSeq []
 
static const struct message WmCreateInvisibleMaxPopupSeq []
 
static const struct message WmShowMaxPopupResizedSeq []
 
static const struct message WmShowMaxPopupSeq []
 
static const struct message WmCreatePopupSeq []
 
static const struct message WmShowVisMaxPopupSeq []
 
static const struct message WmCreateChildPopupSeq []
 
static const struct message WmCreateInvisiblePopupSeq []
 
static const struct message WmShowVisiblePopupSeq_2 []
 
static const struct message WmShowVisiblePopupSeq_3 []
 
static const struct message WmShowPopupExtremeLocationSeq []
 
static const struct message WmShowPopupFirstDrawSeq_1 []
 
static const struct message WmShowPopupFirstDrawSeq_2 []
 
static const struct message WmFirstDrawSetWindowPosSeq1 []
 
static const struct message WmFirstDrawSetWindowPosSeq2 []
 
static const struct message WmFirstDrawSetWindowPosSeq3 []
 
static const struct message WmFirstDrawSetWindowPosSeq4 []
 
static const struct message WmFirstDrawSetWindowPosSeq5 []
 
static const struct message WmFirstDrawChildSeq1 []
 
static const struct message WmFirstDrawChildSeq2 []
 
static const struct message WmCreateChildSeq []
 
static const struct message WmCreateMaximizedChildSeq []
 
static const struct message WmCreateVisibleChildSeq []
 
static const struct message WmShowChildSeq []
 
static const struct message WmHideChildSeq []
 
static const struct message WmHideChildSeq2 []
 
static const struct message WmShowChildSeq_2 []
 
static const struct message WmShowChildSeq_3 []
 
static const struct message WmShowChildSeq_4 []
 
static const struct message WmShowChildInvisibleParentSeq_1 []
 
static const struct message WmShowChildInvisibleParentSeq_1r []
 
static const struct message WmShowChildInvisibleParentSeq_2 []
 
static const struct message WmShowChildInvisibleParentSeq_2r []
 
static const struct message WmShowChildInvisibleParentSeq_3 []
 
static const struct message WmShowChildInvisibleParentSeq_3r []
 
static const struct message WmShowChildInvisibleParentSeq_4 []
 
static const struct message WmShowChildInvisibleParentSeq_4r []
 
static const struct message WmShowChildInvisibleParentSeq_5 []
 
static const struct message WmHideChildInvisibleParentSeq []
 
static const struct message WmShowChildInvisibleParentSeq_6 []
 
static const struct message WmHideChildInvisibleParentSeq_2 []
 
static const struct message WmDestroyChildSeq []
 
static const struct message WmExitThreadSeq []
 
static const struct message WmDestroyInvisibleChildSeq []
 
static const struct message WmResizingChildWithMoveWindowSeq []
 
static const struct message WmCreateCustomDialogSeq []
 
static const struct message WmEndCustomDialogSeq []
 
static const struct message WmShowCustomDialogSeq []
 
static const struct message WmModalDialogSeq []
 
static const struct message WmModalDialogSeq_2 []
 
static const struct message WmSetMenuNonVisibleSizeChangeSeq []
 
static const struct message WmSetMenuNonVisibleNoSizeChangeSeq []
 
static const struct message WmSetMenuVisibleSizeChangeSeq []
 
static const struct message WmSetMenuVisibleNoSizeChangeSeq []
 
static const struct message WmDrawMenuBarSeq []
 
static const struct message WmSetRedrawFalseSeq []
 
static const struct message WmSetRedrawTrueSeq []
 
static const struct message WmEnableWindowSeq_1 []
 
static const struct message WmEnableWindowSeq_2 []
 
static const struct message WmEnableWindowSeq_3 []
 
static const struct message WmEnableWindowSeq_4 []
 
static const struct message WmGetScrollRangeSeq []
 
static const struct message WmGetScrollInfoSeq []
 
static const struct message WmSetScrollRangeSeq []
 
static const struct message WmSetScrollRangeHSeq_empty []
 
static const struct message WmSetScrollRangeVSeq_empty []
 
static const struct message WmSetScrollRangeHVSeq []
 
static const struct message WmSetScrollRangeHV_NC_Seq []
 
static const struct message WmSHOWNAChildInvisParInvis []
 
static const struct message WmSHOWNAChildVisParInvis []
 
static const struct message WmSHOWNAChildVisParVis []
 
static const struct message WmSHOWNAChildInvisParVis []
 
static const struct message WmSHOWNATopVisible []
 
static const struct message WmSHOWNATopInvisible []
 
static const struct message WmTrackPopupMenu []
 
static const struct message WmTrackPopupMenuEsc []
 
static const struct message WmTrackPopupMenuCapture []
 
static const struct message WmTrackPopupMenuEmpty []
 
static const struct message WmTrackPopupMenuAbort []
 
static BOOL after_end_dialog
 
static BOOL test_def_id
 
static BOOL paint_loop_done
 
static int sequence_cnt
 
static int sequence_size
 
static struct recvd_messagesequence
 
static int log_all_parent_messages
 
static CRITICAL_SECTION sequence_cs
 
static UINT
 
static LPCMENUINFO
 
static HWND
 
static LONG
 
static DWORD
 
static HMODULE
 
static WINEVENTPROC
 
static LPMONITORINFO
 
static HDC
 
static POINT SIZE POINT COLORREF
 
static UINT_PTR
 
static TIMERPROC
 
static LPCPINFOEXA
 
static const struct message WmCreateMDIframeSeq []
 
static const struct message WmDestroyMDIframeSeq []
 
static const struct message WmCreateMDIclientSeq []
 
static const struct message WmShowMDIclientSeq []
 
static const struct message WmHideMDIclientSeq []
 
static const struct message WmDestroyMDIclientSeq []
 
static const struct message WmCreateMDIchildVisibleSeq []
 
static const struct message WmChildActivateDisabledWindowSeq []
 
static const struct message WmChildActivateWindowSeq []
 
static const struct message WmCreateMDIchildInvisibleParentSeq []
 
static const struct message WmDestroyMDIchildVisibleSeq []
 
static const struct message WmCreateMDIchildInvisibleSeq []
 
static const struct message WmDestroyMDIchildInvisibleSeq []
 
static const struct message WmCreateMDIchildVisibleMaxSeq1 []
 
static const struct message WmCreateMDIchildVisibleMaxSeq2 []
 
static const struct message WmCreateMDIchildVisibleMaxSeq3 []
 
static const struct message WmCreateMDIchildInvisibleMaxSeq4 []
 
static const struct message WmDestroyMDIchildVisibleMaxSeq2 []
 
static const struct message WmDestroyMDIchildVisibleMaxSeq1 []
 
static const struct message WmMaximizeMDIchildInvisibleSeq []
 
static const struct message WmMaximizeMDIchildInvisibleSeq2 []
 
static const struct message WmMaximizeMDIchildInvisibleParentSeq []
 
static const struct message WmMaximizeMDIchildVisibleSeq []
 
static const struct message WmRestoreMDIchildVisibleSeq []
 
static const struct message WmRestoreMDIchildVisibleSeq_2 []
 
static const struct message WmMinimizeMDIchildVisibleSeq []
 
static const struct message WmRestoreMDIchildInvisibleSeq []
 
static HWND mdi_client
 
static WNDPROC old_mdi_client_proc
 
static const struct message WmSetIcon_1 []
 
static const struct message WmSetIcon_2 []
 
static const struct message WmInitEndSession []
 
static const struct message WmInitEndSession_2 []
 
static const struct message WmInitEndSession_3 []
 
static const struct message WmInitEndSession_4 []
 
static const struct message WmInitEndSession_5 []
 
static const struct message WmOptionalPaint []
 
static const struct message WmZOrder []
 
static const struct message WmSetFocusButtonSeq []
 
static const struct message WmKillFocusButtonSeq []
 
static const struct message WmSetFocusStaticSeq []
 
static const struct message WmKillFocusStaticSeq []
 
static const struct message WmSetFocusOwnerdrawSeq []
 
static const struct message WmKillFocusOwnerdrawSeq []
 
static const struct message WmLButtonDownSeq []
 
static const struct message WmLButtonDownStaticSeq []
 
static const struct message WmLButtonUpSeq []
 
static const struct message WmLButtonUpStaticSeq []
 
static const struct message WmLButtonUpAutoSeq []
 
static const struct message WmLButtonUpBrokenSeq []
 
static const struct message WmSetFontButtonSeq []
 
static const struct message WmSetFontStaticSeq []
 
static const struct message WmSetTextButtonSeq []
 
static const struct message WmSetTextStaticSeq []
 
static const struct message WmSetTextGroupSeq []
 
static const struct message WmSetTextInvisibleSeq []
 
static const struct message WmSetStyleButtonSeq []
 
static const struct message WmSetStyleStaticSeq []
 
static const struct message WmSetStyleUserSeq []
 
static const struct message WmSetStyleOwnerdrawSeq []
 
static const struct message WmSetStateButtonSeq []
 
static const struct message WmSetStateStaticSeq []
 
static const struct message WmSetStateUserSeq []
 
static const struct message WmSetStateOwnerdrawSeq []
 
static const struct message WmClearStateButtonSeq []
 
static const struct message WmDisableButtonSeq []
 
static const struct message WmClearStateOwnerdrawSeq []
 
static const struct message WmSetCheckIgnoredSeq []
 
static const struct message WmSetCheckStaticSeq []
 
static WNDPROC old_button_proc
 
static const struct message auto_radio_button_BM_CLICK []
 
static const struct message auto_radio_button_VK_UP_child []
 
static const struct message auto_radio_button_VK_UP_parent []
 
static const struct message auto_radio_button_VK_UP_dialog []
 
static const struct message auto_radio_button_VK_DOWN_dialog []
 
static const struct message auto_radio_button_VK_DOWN_radio3 []
 
static const struct message auto_radio_button_VK_UP_radio1 []
 
static const struct message WmSetFontStaticSeq2 []
 
static WNDPROC old_static_proc
 
static const struct message SetCurSelComboSeq []
 
static const struct message SetCurSelComboSeq2 []
 
static const struct message SetCurSelComboSeq_edit []
 
static const struct message WmKeyDownComboSeq []
 
static const struct message WmSetPosComboSeq []
 
static const struct message WMSetFocusComboBoxSeq []
 
static const struct message SetFocusButtonSeq []
 
static const struct message SetFocusComboBoxSeq []
 
static const struct message SetFocusButtonSeq2 []
 
static WNDPROC old_combobox_proc
 
static WNDPROC edit_window_proc
 
static WNDPROC lbox_window_proc
 
static const struct message WmImeKeydownMsgSeq_0 []
 
static const struct message WmImeKeydownMsgSeq_1 []
 
static const struct message WmInvalidateRgn []
 
static const struct message WmGetUpdateRect []
 
static const struct message WmInvalidateFull []
 
static const struct message WmInvalidateErase []
 
static const struct message WmInvalidatePaint []
 
static const struct message WmInvalidateErasePaint []
 
static const struct message WmInvalidateErasePaint2 []
 
static const struct message WmErase []
 
static const struct message WmPaint []
 
static const struct message WmParentOnlyPaint []
 
static const struct message WmInvalidateParent []
 
static const struct message WmInvalidateParentChild []
 
static const struct message WmInvalidateParentChild2 []
 
static const struct message WmParentPaint []
 
static const struct message WmParentPaintNc []
 
static const struct message WmChildPaintNc []
 
static const struct message WmParentErasePaint []
 
static const struct message WmParentOnlyNcPaint []
 
static const struct message WmSetParentStyle []
 
static const char manifest_dep []
 
static const char manifest_main []
 
static const struct message WmVkN []
 
static const struct message WmShiftVkN []
 
static const struct message WmCtrlVkN []
 
static const struct message WmCtrlVkN_2 []
 
static const struct message WmAltVkN []
 
static const struct message WmAltVkN_2 []
 
static const struct message WmCtrlAltVkN []
 
static const struct message WmCtrlShiftVkN []
 
static const struct message WmCtrlAltShiftVkN []
 
static const struct message WmAltPressRelease []
 
static const struct message WmShiftMouseButton []
 
static const struct message WmF1Seq []
 
static const struct message WmVkAppsSeq []
 
static const struct message WmVkF10Seq []
 
static const struct message WmShiftF10Seq []
 
static const WCHAR wszUnicode [] = {'U','n','i','c','o','d','e',0}
 
static const WCHAR wszAnsi [] = {'U',0}
 
static const struct message WmGetTextLengthAfromW []
 
static const WCHAR dummy_window_text [] = {'d','u','m','m','y',' ','t','e','x','t',0}
 
static int count = 0
 
static DWORD exception
 
static const struct message WmWinEventsSeq []
 
static const struct message WmWinEventCaretSeq []
 
static const struct message WmWinEventCaretSeq_2 []
 
static const struct message WmWinEventAlertSeq []
 
static const struct message WmWinEventAlertSeq_2 []
 
static const struct message WmGlobalHookSeq_1 []
 
static const struct message WmGlobalHookSeq_2 []
 
static const struct message WmMouseLLHookSeq []
 
static HHOOK hCBT_global_hook
 
static DWORD cbt_global_hook_thread_id
 
static HWND hook_hwnd
 
static HHOOK recursive_hook
 
static int hook_depth
 
static int max_hook_depth
 
static const struct message ScrollWindowPaint1 []
 
static const struct message ScrollWindowPaint2 []
 
static const struct message destroy_window_with_children []
 
static const struct message WmDispatchPaint []
 
static const struct message WmUser []
 
static const struct message sl_edit_setfocus []
 
static const struct message sl_edit_invisible []
 
static const struct message ml_edit_setfocus []
 
static const struct message sl_edit_killfocus []
 
static const struct message sl_edit_lbutton_dblclk []
 
static const struct message sl_edit_lbutton_down []
 
static const struct message ml_edit_lbutton_down []
 
static const struct message sl_edit_lbutton_up []
 
static const struct message ml_edit_lbutton_up []
 
static WNDPROC old_edit_proc
 
static const struct message WmKeyDownSkippedSeq []
 
static const struct message WmKeyDownWasDownSkippedSeq []
 
static const struct message WmKeyUpSkippedSeq []
 
static const struct message WmUserKeyUpSkippedSeq []
 
static const struct message WmQuitDialogSeq []
 
static const struct message WmStopQuitSeq []
 
static const struct message WmNotifySeq []
 
static const struct message WmMouseHoverSeq []
 
static const struct message WmSetWindowRgn []
 
static const struct message WmSetWindowRgn_no_redraw []
 
static const struct message WmSetWindowRgn_clear []
 
static const struct message WmShowNormal []
 
static const struct message WmShow []
 
static const struct message WmShowNoActivate_1 []
 
static const struct message WmShowNoActivate_2 []
 
static const struct message WmShowNA_1 []
 
static const struct message WmShowNA_2 []
 
static const struct message WmRestore_1 []
 
static const struct message WmRestore_2 []
 
static const struct message WmRestore_3 []
 
static const struct message WmRestore_4 []
 
static const struct message WmRestore_5 []
 
static const struct message WmHide_1 []
 
static const struct message WmHide_2 []
 
static const struct message WmHide_3 []
 
static const struct message WmShowMinimized_1 []
 
static const struct message WmMinimize_1 []
 
static const struct message WmMinimize_2 []
 
static const struct message WmMinimize_3 []
 
static const struct message WmShowMinNoActivate []
 
static const struct message WmMinMax_1 []
 
static const struct message WmMinMax_2 []
 
static const struct message WmMinMax_3 []
 
static const struct message WmMinMax_4 []
 
static const struct message WmShowMaximized_1 []
 
static const struct message WmShowMaximized_2 []
 
static const struct message WmShowMaximized_3 []
 
static WNDPROC orig_edit_proc
 
static const struct message WmDefDlgSetFocus_1 []
 
static const struct message WmDefDlgSetFocus_2 []
 
static const struct message WmCreateDialogParamSeq_0 []
 
static const struct message WmCreateDialogParamSeq_1 []
 
static const struct message WmCreateDialogParamSeq_2 []
 
static const struct message WmCreateDialogParamSeq_3 []
 
static const struct message WmCreateDialogParamSeq_4 []
 
static const struct message SetActiveWindowSeq0 []
 
static const struct message SetActiveWindowSeq1 []
 
static const struct message SetActiveWindowSeq2 []
 
static const struct message SetActiveWindowSeq3 []
 
static const struct message SetActiveWindowSeq4 []
 
static const struct message SetForegroundWindowSeq []
 
static const struct message wm_lb_setcursel_0 []
 
static const struct message wm_lb_setcursel_1 []
 
static const struct message wm_lb_setcursel_2 []
 
static const struct message wm_lb_click_0 []
 
static const struct message wm_lb_deletestring []
 
static const struct message wm_lb_deletestring_reset []
 
static const struct message wm_lb_addstring []
 
static const struct message wm_lb_addstring_ownerdraw []
 
static const struct message wm_lb_addstring_sort_ownerdraw []
 
static WPARAM
 
static LPARAM
 
static const struct message wm_popup_menu_1 []
 
static const struct message wm_popup_menu_2 []
 
static const struct message wm_popup_menu_3 []
 
static const struct message wm_single_menu_item []
 
static const struct message NCRBUTTONDOWNSeq []
 
static const struct message NCXBUTTONUPSeq1 []
 
static const struct message NCXBUTTONUPSeq2 []
 
static const struct message WmRestoreMinimizedOverlappedSeq []
 
static struct message WmContextMenuSeq []
 
static WNDPROC pOldViewerProc
 
static LPARAM g_broadcast_lparam
 
struct {
   DWORD   exp
 
   DWORD   broken
 
   BOOL   todo
 
wait_idle_expect []
 
static const struct message WmSetParentSeq_1 []
 
static const struct message WmSetParentSeq_2 []
 
static const struct message WmKeyReleaseOnly []
 
static const struct message WmKeyPressNormal []
 
static const struct message WmKeyPressRepeat []
 
static const struct message WmKeyReleaseNormal []
 
static const struct message WmHotkeyPressLWIN []
 
static const struct message WmHotkeyPress []
 
static const struct message WmHotkeyRelease []
 
static const struct message WmHotkeyReleaseLWIN []
 
static const struct message WmHotkeyCombined []
 
static const struct message WmHotkeyPrevious []
 
static const struct message WmHotkeyNew []
 
static int hotkey_letter
 
static const struct message WmSetFocus_1 []
 
static const struct message WmSetFocus_2 []
 
static const struct message WmSetFocus_3 []
 
static const struct message WmSetLayeredStyle []
 
static const struct message WmSetLayeredStyle2 []
 
static HMENU hpopupmenu
 
static const struct message send_message_1 []
 
static const struct message send_message_2 []
 
static const struct message send_message_3 []
 
static const struct message DoubleSetCaptureSeq []
 
static const struct message WmRestoreMinimizedSeq []
 

Macro Definition Documentation

◆ add_message

#define add_message (   msg)    add_message_(__LINE__,msg);

Definition at line 2109 of file msg.c.

◆ ARCH

#define ARCH   "none"

Definition at line 71 of file msg.c.

◆ check_lb_state

#define check_lb_state (   a1,
  a2,
  a3,
  a4,
  a5 
)    check_lb_state_dbg(a1, a2, a3, a4, a5, __LINE__)

Definition at line 14858 of file msg.c.

◆ check_selection

#define check_selection (   hctl,
  start,
  end 
)
Value:
ret = SendMessageA(hctl, EM_GETSEL, 0, 0); \
ok(ret == MAKELRESULT(start, end), "wrong selection (%d - %d)\n", LOWORD(ret), HIWORD(ret));
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
int ret
#define EM_GETSEL
Definition: winuser.h:1987
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELRESULT(l, h)
Definition: winuser.h:4000

◆ check_update_rgn

#define check_update_rgn (   hwnd,
  hrgn 
)    check_update_rgn_( __LINE__, hwnd, hrgn )

Definition at line 7716 of file msg.c.

◆ clear_clipboard

#define clear_clipboard (   hwnd)    clear_clipboard_(__LINE__, (hwnd))

Definition at line 15713 of file msg.c.

◆ DUMP

#define DUMP (   flag)    do { if (flags & flag) { strcat( buffer, "|" #flag ); flags &= ~flag; } } while(0)

◆ EV_ACK

#define EV_ACK   2

Definition at line 11762 of file msg.c.

◆ EV_SENDMSG

#define EV_SENDMSG   1

Definition at line 11761 of file msg.c.

◆ EV_STOP

#define EV_STOP   0

Definition at line 11760 of file msg.c.

◆ expect

#define expect (   EXPECTED,
  GOT 
)    ok((GOT)==(EXPECTED), "Expected %d, got %d\n", (EXPECTED), (GOT))

Definition at line 2575 of file msg.c.

◆ expect_HWND

#define expect_HWND (   expected,
  got 
)    expect_HWND_(__LINE__, (expected), (got))

Definition at line 15725 of file msg.c.

◆ GET_PROC

#define GET_PROC (   dll,
  func 
)
Value:
p ## func = (void*)GetProcAddress(dll, #func); \
if(!p ## func) { \
trace("GetProcAddress(%s) failed\n", #func); \
}
#define GetProcAddress(x, y)
Definition: compat.h:753
GLenum func
Definition: glext.h:6028
GLfloat GLfloat p
Definition: glext.h:8902
static HMODULE dll
Definition: str.c:188

◆ ID_BUTTON

#define ID_BUTTON   0x000e

Definition at line 5893 of file msg.c.

◆ ID_COMBOBOX

#define ID_COMBOBOX   0x000f

Definition at line 7249 of file msg.c.

◆ ID_EDIT

#define ID_EDIT   0x1234

Definition at line 11482 of file msg.c.

◆ ID_LISTBOX

#define ID_LISTBOX   0x000f

Definition at line 14745 of file msg.c.

◆ ID_RADIO1

#define ID_RADIO1   501

Definition at line 6726 of file msg.c.

◆ ID_RADIO2

#define ID_RADIO2   502

Definition at line 6727 of file msg.c.

◆ ID_RADIO3

#define ID_RADIO3   503

Definition at line 6728 of file msg.c.

◆ ID_TEXT

#define ID_TEXT   504

Definition at line 6729 of file msg.c.

◆ MDI_FIRST_CHILD_ID

#define MDI_FIRST_CHILD_ID   2004

Definition at line 37 of file msg.c.

◆ ok_sequence

#define ok_sequence (   exp,
  contx,
  todo 
)     ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__)

Definition at line 2389 of file msg.c.

◆ set_selection

#define set_selection (   hctl,
  start,
  end 
)
Value:
ok(ret == 1, "EM_SETSEL returned %ld\n", ret);
#define EM_SETSEL
Definition: winuser.h:2008

◆ STEP

#define STEP   5

Definition at line 12311 of file msg.c.

◆ SW_NORMALNA

#define SW_NORMALNA   0xCC /* undoc. flag in MinMaximize */

Definition at line 44 of file msg.c.

◆ SWP_NOCLIENTMOVE

#define SWP_NOCLIENTMOVE   0x1000

Definition at line 41 of file msg.c.

◆ SWP_NOCLIENTSIZE

#define SWP_NOCLIENTSIZE   0x0800

Definition at line 40 of file msg.c.

◆ SWP_STATECHANGED

#define SWP_STATECHANGED   0x8000

Definition at line 42 of file msg.c.

◆ test_msg_setpos

#define test_msg_setpos (   expected_list,
  flags,
  todo 
)     test_msg_setpos_( (expected_list), (flags), (todo), __FILE__, __LINE__)

Definition at line 5089 of file msg.c.

◆ test_radio

#define test_radio (   r1,
  s1,
  r2,
  s2,
  r3,
  s3 
)    test_radio_dbg(r1, s1, r2, s2, r3, s3, __LINE__)

Definition at line 6975 of file msg.c.

◆ TIMER_COUNT_EXPECTED

#define TIMER_COUNT_EXPECTED   100

Definition at line 10218 of file msg.c.

◆ TIMER_COUNT_TOLERANCE

#define TIMER_COUNT_TOLERANCE   10

Definition at line 10219 of file msg.c.

◆ TIMER_ID

#define TIMER_ID   0x19

Definition at line 10217 of file msg.c.

◆ track_hover

#define track_hover (   track_hwnd,
  track_hover_time 
)
Value:
tme.cbSize = sizeof(tme); \
tme.dwFlags = TME_HOVER; \
tme.hwndTrack = track_hwnd; \
tme.dwHoverTime = track_hover_time; \
SetLastError(0xdeadbeef); \
ret = pTrackMouseEvent(&tme); \
ok(ret, "TrackMouseEvent(TME_HOVER) error %d\n", GetLastError())
#define TME_HOVER
Definition: commctrl.h:4980
DWORD WINAPI GetLastError(void)
Definition: except.c:1040

◆ track_hover_cancel

#define track_hover_cancel (   track_hwnd)
Value:
tme.cbSize = sizeof(tme); \
tme.dwFlags = TME_HOVER | TME_CANCEL; \
tme.hwndTrack = track_hwnd; \
tme.dwHoverTime = 0xdeadbeef; \
SetLastError(0xdeadbeef); \
ret = pTrackMouseEvent(&tme); \
ok(ret, "TrackMouseEvent(TME_HOVER | TME_CANCEL) error %d\n", GetLastError())
#define TME_CANCEL
Definition: commctrl.h:4984

◆ track_query

#define track_query (   expected_track_flags,
  expected_track_hwnd,
  expected_hover_time 
)
Value:
tme.cbSize = sizeof(tme); \
tme.dwFlags = TME_QUERY; \
tme.hwndTrack = (HWND)0xdeadbeef; \
tme.dwHoverTime = 0xdeadbeef; \
SetLastError(0xdeadbeef); \
ret = pTrackMouseEvent(&tme); \
ok(ret, "TrackMouseEvent(TME_QUERY) error %d\n", GetLastError());\
ok(tme.cbSize == sizeof(tme), "wrong tme.cbSize %u\n", tme.cbSize); \
ok(tme.dwFlags == (expected_track_flags), \
"wrong tme.dwFlags %08x, expected %08x\n", tme.dwFlags, (expected_track_flags)); \
ok(tme.hwndTrack == (expected_track_hwnd), \
"wrong tme.hwndTrack %p, expected %p\n", tme.hwndTrack, (expected_track_hwnd)); \
ok(tme.dwHoverTime == (expected_hover_time), \
"wrong tme.dwHoverTime %u, expected %u\n", tme.dwHoverTime, (expected_hover_time))
static HWND
Definition: msg.c:2007
#define TME_QUERY
Definition: commctrl.h:4983

◆ WM_KEYF1

#define WM_KEYF1   0x004d

Definition at line 47 of file msg.c.

◆ WM_LBTRACKPOINT

#define WM_LBTRACKPOINT   0x0131

Definition at line 59 of file msg.c.

◆ WM_SYSTIMER

#define WM_SYSTIMER   0x0118

Definition at line 51 of file msg.c.

◆ WND_CHILD_ID

#define WND_CHILD_ID   3

Definition at line 56 of file msg.c.

◆ WND_PARENT_ID

#define WND_PARENT_ID   1

Definition at line 54 of file msg.c.

◆ WND_POPUP_ID

#define WND_POPUP_ID   2

Definition at line 55 of file msg.c.

◆ WS_BASE

◆ X

#define X (   f)    p##f = (void*)GetProcAddress(hKernel32, #f)

Typedef Documentation

◆ IS_WINEVENT_HOOK_INSTALLED

typedef BOOL(WINAPI * IS_WINEVENT_HOOK_INSTALLED) (DWORD)

Definition at line 18177 of file msg.c.

Enumeration Type Documentation

◆ msg_flags_t

Enumerator
sent 
posted 
parent 
wparam 
lparam 
defwinproc 
beginpaint 
optional 
hook 
winevent_hook 
id 
custdraw 
sent 
posted 
parent 
wparam 
lparam 
defwinproc 
beginpaint 
optional 
hook 
winevent_hook 
id 
sent 
posted 
parent 
wparam 
lparam 
defwinproc 
beginpaint 
optional 
hook 
winevent_hook 
sent 
posted 
parent 
wparam 
lparam 
defwinproc 
beginpaint 
optional 
hook 
winevent_hook 
kbd_hook 

Definition at line 136 of file msg.c.

136 {
137 sent=0x1,
138 posted=0x2,
139 parent=0x4,
140 wparam=0x8,
141 lparam=0x10,
142 defwinproc=0x20,
143 beginpaint=0x40,
144 optional=0x80,
145 hook=0x100,
146 winevent_hook=0x200,
147 kbd_hook=0x400
msg_flags_t
Definition: msg.c:136
@ sent
Definition: msg.c:137
@ beginpaint
Definition: msg.c:143
@ defwinproc
Definition: msg.c:142
@ kbd_hook
Definition: msg.c:147
@ parent
Definition: msg.c:139
@ posted
Definition: msg.c:138
@ lparam
Definition: msg.c:141
@ hook
Definition: msg.c:145
@ winevent_hook
Definition: msg.c:146
@ wparam
Definition: msg.c:140
@ optional
Definition: msg.c:144

Function Documentation

◆ add_message_()

static void add_message_ ( int  line,
const struct recvd_message msg 
)
static

Definition at line 2110 of file msg.c.

2111{
2112 struct recvd_message *seq;
2113
2115 if (!sequence)
2116 {
2117 sequence_size = 10;
2119 }
2121 {
2122 sequence_size *= 2;
2124 }
2126
2127 seq = &sequence[sequence_cnt++];
2128 seq->hwnd = msg->hwnd;
2129 seq->message = msg->message;
2130 seq->flags = msg->flags;
2131 seq->wParam = msg->wParam;
2132 seq->lParam = msg->lParam;
2133 seq->line = line;
2134 seq->descr = msg->descr;
2135 seq->output[0] = 0;
2137
2138 if (msg->descr)
2139 {
2140 if (msg->flags & hook)
2141 {
2142 static const char * const CBT_code_name[10] =
2143 {
2144 "HCBT_MOVESIZE",
2145 "HCBT_MINMAX",
2146 "HCBT_QS",
2147 "HCBT_CREATEWND",
2148 "HCBT_DESTROYWND",
2149 "HCBT_ACTIVATE",
2150 "HCBT_CLICKSKIPPED",
2151 "HCBT_KEYSKIPPED",
2152 "HCBT_SYSCOMMAND",
2153 "HCBT_SETFOCUS"
2154 };
2155 const char *code_name = (msg->message <= HCBT_SETFOCUS) ? CBT_code_name[msg->message] : "Unknown";
2156
2157 sprintf( seq->output, "%s: hook %d (%s) wp %08lx lp %08lx",
2158 msg->descr, msg->message, code_name, msg->wParam, msg->lParam );
2159 }
2160 else if (msg->flags & winevent_hook)
2161 {
2162 sprintf( seq->output, "%s: winevent %p %08x %08lx %08lx",
2163 msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
2164 }
2165 else
2166 {
2167 switch (msg->message)
2168 {
2171 {
2172 WINDOWPOS *winpos = (WINDOWPOS *)msg->lParam;
2173
2174 sprintf( seq->output, "%s: %p WM_WINDOWPOS%s wp %08lx lp %08lx after %p x %d y %d cx %d cy %d flags %s",
2175 msg->descr, msg->hwnd,
2176 (msg->message == WM_WINDOWPOSCHANGING) ? "CHANGING" : "CHANGED",
2177 msg->wParam, msg->lParam, winpos->hwndInsertAfter,
2178 winpos->x, winpos->y, winpos->cx, winpos->cy,
2179 get_winpos_flags(winpos->flags) );
2180
2181 /* Log only documented flags, win2k uses 0x1000 and 0x2000
2182 * in the high word for internal purposes
2183 */
2184 seq->wParam = winpos->flags & 0xffff;
2185 /* We are not interested in the flags that don't match under XP and Win9x */
2186 seq->wParam &= ~SWP_NOZORDER;
2187 break;
2188 }
2189
2190 case WM_DRAWITEM:
2191 {
2193 DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)msg->lParam;
2194
2195 sprintf( seq->output, "%s: %p WM_DRAWITEM: type %x, ctl_id %x, item_id %x, action %x, state %x",
2196 msg->descr, msg->hwnd, dis->CtlType, dis->CtlID,
2197 dis->itemID, dis->itemAction, dis->itemState);
2198
2199 di.u.lp = 0;
2200 di.u.item.type = dis->CtlType;
2201 di.u.item.ctl_id = dis->CtlID;
2202 if (dis->CtlType == ODT_LISTBOX ||
2203 dis->CtlType == ODT_COMBOBOX ||
2204 dis->CtlType == ODT_MENU)
2205 di.u.item.item_id = dis->itemID;
2206 di.u.item.action = dis->itemAction;
2207 di.u.item.state = dis->itemState;
2208
2209 seq->lParam = di.u.lp;
2210 break;
2211 }
2212
2213 case WM_MEASUREITEM:
2214 {
2216 MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)msg->lParam;
2217 BOOL is_unicode_data = TRUE;
2218
2219 sprintf( seq->output, "%s: %p WM_MEASUREITEM: CtlType %#x, CtlID %#x, itemID %#x, itemData %#lx",
2220 msg->descr, msg->hwnd, mis->CtlType, mis->CtlID,
2221 mis->itemID, mis->itemData);
2222
2223 if (mis->CtlType == ODT_LISTBOX)
2224 {
2225 HWND ctrl = GetDlgItem(msg->hwnd, mis->CtlID);
2226 is_unicode_data = GetWindowLongA(ctrl, GWL_STYLE) & LBS_HASSTRINGS;
2227 }
2228
2229 mi.u.wp = 0;
2230 mi.u.item.CtlType = mis->CtlType;
2231 mi.u.item.CtlID = mis->CtlID;
2232 mi.u.item.itemID = mis->itemID;
2233 mi.u.item.wParam = msg->wParam;
2234 seq->wParam = mi.u.wp;
2235 if (is_unicode_data)
2236 seq->lParam = mis->itemData ? hash_Ly_W((const WCHAR *)mis->itemData) : 0;
2237 else
2238 seq->lParam = mis->itemData ? hash_Ly((const char *)mis->itemData) : 0;
2239 break;
2240 }
2241
2242 case WM_COMPAREITEM:
2243 {
2244 COMPAREITEMSTRUCT *cis = (COMPAREITEMSTRUCT *)msg->lParam;
2245 HWND ctrl = GetDlgItem(msg->hwnd, cis->CtlID);
2246 BOOL is_unicode_data = TRUE;
2247
2248 ok(msg->wParam == cis->CtlID, "expected %#x, got %#lx\n", cis->CtlID, msg->wParam);
2249 ok(cis->hwndItem == ctrl, "expected %p, got %p\n", ctrl, cis->hwndItem);
2250 ok((int)cis->itemID1 >= 0, "expected >= 0, got %d\n", cis->itemID1);
2251 ok((int)cis->itemID2 == -1, "expected -1, got %d\n", cis->itemID2);
2252
2253 sprintf( seq->output, "%s: %p WM_COMPAREITEM: CtlType %#x, CtlID %#x, itemID1 %#x, itemData1 %#lx, itemID2 %#x, itemData2 %#lx",
2254 msg->descr, msg->hwnd, cis->CtlType, cis->CtlID,
2255 cis->itemID1, cis->itemData1, cis->itemID2, cis->itemData2);
2256
2257 if (cis->CtlType == ODT_LISTBOX)
2258 is_unicode_data = GetWindowLongA(ctrl, GWL_STYLE) & LBS_HASSTRINGS;
2259
2260 if (is_unicode_data)
2261 {
2262 seq->wParam = cis->itemData1 ? hash_Ly_W((const WCHAR *)cis->itemData1) : 0;
2263 seq->lParam = cis->itemData2 ? hash_Ly_W((const WCHAR *)cis->itemData2) : 0;
2264 }
2265 else
2266 {
2267 seq->wParam = cis->itemData1 ? hash_Ly((const char *)cis->itemData1) : 0;
2268 seq->lParam = cis->itemData2 ? hash_Ly((const char *)cis->itemData2) : 0;
2269 }
2270 break;
2271 }
2272
2273 default:
2274 if (msg->message >= 0xc000) return; /* ignore registered messages */
2275 sprintf( seq->output, "%s: %p %04x wp %08lx lp %08lx",
2276 msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
2277 }
2278 if (msg->flags & (sent|posted|parent|defwinproc|beginpaint))
2279 sprintf( seq->output + strlen(seq->output), " (flags %x)", msg->flags );
2280 }
2281 }
2282}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
#define TRUE
Definition: types.h:120
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
#define assert(x)
Definition: debug.h:53
unsigned int BOOL
Definition: ntddk_ex.h:94
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define ctrl
Definition: input.c:1756
static CRITICAL_SECTION sequence_cs
Definition: msg.c:2002
static int sequence_size
Definition: msg.c:1999
static struct recvd_message * sequence
Definition: msg.c:2000
static int sequence_cnt
Definition: msg.c:1999
static unsigned hash_Ly(const char *str)
Definition: msg.c:2099
static unsigned hash_Ly_W(const WCHAR *str)
Definition: msg.c:2089
static const char * get_winpos_flags(UINT flags)
Definition: msg.c:2051
#define LBS_HASSTRINGS
Definition: pedump.c:684
union DRAW_ITEM_STRUCT::@1705 u
struct DRAW_ITEM_STRUCT::@1705::@1706 item
LPARAM lp
Definition: msg.c:94
UINT flags
Definition: winuser.h:3584
HWND hwndInsertAfter
Definition: winuser.h:3579
const char * descr
Definition: msg.c:166
int line
Definition: msg.c:165
WPARAM wParam
Definition: msg.c:163
msg_flags_t flags
Definition: msg.c:161
UINT message
Definition: msg.c:160
LPARAM lParam
Definition: msg.c:164
HWND hwnd
Definition: msg.c:162
char output[512]
Definition: msg.c:167
ULONG_PTR itemData1
Definition: winuser.h:2984
ULONG_PTR itemData2
Definition: winuser.h:2986
ULONG_PTR itemData
Definition: winuser.h:3636
static MONITORINFO mi
Definition: win.c:7338
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define ODT_COMBOBOX
Definition: winuser.h:2529
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1651
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_DRAWITEM
Definition: winuser.h:1635
#define HCBT_SETFOCUS
Definition: winuser.h:64
#define WM_MEASUREITEM
Definition: winuser.h:1636
#define WM_COMPAREITEM
Definition: winuser.h:1645
#define GWL_STYLE
Definition: winuser.h:846
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1652
#define ODT_MENU
Definition: winuser.h:2527
#define ODT_LISTBOX
Definition: winuser.h:2528
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ apc_test_proc()

static void CALLBACK apc_test_proc ( ULONG_PTR  param)
static

Definition at line 4958 of file msg.c.

4959{
4960 /* nothing */
4961}

Referenced by test_MsgWaitForMultipleObjects().

◆ BOOL()

static BOOL ( WINAPI pActivateActCtx)
static

◆ broadcast_test_proc()

static LRESULT WINAPI broadcast_test_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 15940 of file msg.c.

15941{
15943
15944 if (wParam == 0xbaadbeef)
15946 else
15948
15949 return CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
15950}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static LPARAM g_broadcast_lparam
Definition: msg.c:15939
Definition: tftpd.h:60
#define GWLP_USERDATA
Definition: treelist.c:63
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GetWindowLongPtrA
Definition: winuser.h:4818
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2896
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by test_broadcast().

◆ button_hook_proc()

static LRESULT CALLBACK button_hook_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 6212 of file msg.c.

6213{
6214 static LONG defwndproc_counter = 0;
6215 LRESULT ret;
6216 struct recvd_message msg;
6217
6218 if (ignore_message( message )) return 0;
6219
6220 switch (message)
6221 {
6222 case WM_SYNCPAINT:
6223 break;
6224 case BM_SETSTATE:
6225 if (GetCapture())
6226 ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture());
6227
6229 goto log_it;
6230
6231 case WM_GETDLGCODE:
6232 if (lParam)
6233 {
6234 MSG *msg = (MSG *)lParam;
6235 lParam = MAKELPARAM(msg->message, msg->wParam);
6236 }
6238 goto log_it;
6239
6240 case BM_SETCHECK:
6241 case BM_GETCHECK:
6243 /* fall through */
6244log_it:
6245 default:
6246 msg.hwnd = hwnd;
6247 msg.message = message;
6248 msg.flags = sent|wparam|lparam;
6249 if (defwndproc_counter) msg.flags |= defwinproc;
6250 msg.wParam = wParam;
6251 msg.lParam = lParam;
6252 msg.descr = "button";
6253 add_message(&msg);
6254 }
6255
6256 defwndproc_counter++;
6258 defwndproc_counter--;
6259
6260 return ret;
6261}
#define add_message(msg)
Definition: msg.c:2109
static BOOL ignore_message(UINT message)
Definition: msg.c:2077
static WNDPROC old_button_proc
Definition: msg.c:6210
static ULONG_PTR
Definition: msg.c:76
long LONG
Definition: pedump.c:60
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
LONG_PTR LRESULT
Definition: windef.h:209
#define MAKELPARAM(l, h)
Definition: winuser.h:3998
#define WM_SYNCPAINT
Definition: winuser.h:1680
#define BM_SETSTATE
Definition: winuser.h:1913
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define BM_SETCHECK
Definition: winuser.h:1911
#define WM_GETDLGCODE
Definition: winuser.h:1679
HMENU WINAPI GetMenu(_In_ HWND)
#define BM_GETCHECK
Definition: winuser.h:1908

Referenced by subclass_button().

◆ callback_count()

static void CALLBACK callback_count ( HWND  hwnd,
UINT  uMsg,
UINT_PTR  idEvent,
DWORD  dwTime 
)
static

Definition at line 10222 of file msg.c.

10223{
10224 count++;
10225}
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by test_timers(), and test_timers_no_wnd().

◆ callback_exception()

static void CALLBACK callback_exception ( HWND  hwnd,
UINT  uMsg,
UINT_PTR  idEvent,
DWORD  dwTime 
)
static

Definition at line 10228 of file msg.c.

10229{
10230 count++;
10232}
#define NULL
Definition: types.h:112
VOID WINAPI RaiseException(IN DWORD dwExceptionCode, IN DWORD dwExceptionFlags, IN DWORD nNumberOfArguments, IN CONST ULONG_PTR *lpArguments OPTIONAL)
Definition: except.c:700

Referenced by test_timers_exception().

◆ cancel_init_proc()

static LRESULT WINAPI cancel_init_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 17363 of file msg.c.

17364{
17365 if (ignore_message( message )) return 0;
17366
17367 switch (message) {
17368 case WM_ENTERMENULOOP:
17369 ok(EndMenu() == TRUE, "EndMenu() failed\n");
17370 break;
17371 }
17372
17374}
#define FALSE
Definition: types.h:117
static LRESULT MsgCheckProc(BOOL unicode, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:9380
BOOL WINAPI EndMenu(void)
#define WM_ENTERMENULOOP
Definition: winuser.h:1794

Referenced by test_TrackPopupMenu().

◆ cancel_popup_proc()

static LRESULT WINAPI cancel_popup_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 17341 of file msg.c.

17342{
17343 if (ignore_message( message )) return 0;
17344
17345 switch (message) {
17346 case WM_ENTERIDLE:
17347 todo_wine ok(GetCapture() == hwnd, "expected %p, got %p\n", hwnd, GetCapture());
17348 EndMenu();
17349 break;
17350 case WM_INITMENU:
17351 case WM_INITMENUPOPUP:
17352 case WM_UNINITMENUPOPUP:
17353 ok((HMENU)wParam == hpopupmenu, "expected %p, got %lx\n", hpopupmenu, wParam);
17354 break;
17355 case WM_CAPTURECHANGED:
17356 todo_wine ok(!lParam || (HWND)lParam == hwnd, "lost capture to %lx\n", lParam);
17357 break;
17358 }
17359
17361}
#define todo_wine
Definition: custom.c:79
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
static HMENU hpopupmenu
Definition: msg.c:17339
#define WM_CAPTURECHANGED
Definition: winuser.h:1798
#define WM_INITMENU
Definition: winuser.h:1735
#define WM_INITMENUPOPUP
Definition: winuser.h:1736
#define WM_ENTERIDLE
Definition: winuser.h:1739

Referenced by test_TrackPopupMenu(), and test_TrackPopupMenuEmpty().

◆ cbt_global_hook_proc()

static LRESULT CALLBACK cbt_global_hook_proc ( int  nCode,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 10536 of file msg.c.

10537{
10538 HWND hwnd;
10539 char buf[256];
10540
10541 if (nCode == HCBT_SYSCOMMAND)
10542 {
10543 struct recvd_message msg;
10544
10545 msg.hwnd = 0;
10546 msg.message = nCode;
10547 msg.flags = hook|wparam|lparam;
10548 msg.wParam = wParam;
10549 msg.lParam = (cbt_global_hook_thread_id == GetCurrentThreadId()) ? 1 : 2;
10550 msg.descr = "CBT_2";
10551 add_message(&msg);
10552
10554 }
10555 /* WH_MOUSE_LL hook */
10556 if (nCode == HC_ACTION)
10557 {
10559
10560 /* we can't test for real mouse events */
10561 if (mhll->flags & LLMHF_INJECTED)
10562 {
10563 struct recvd_message msg;
10564
10565 memset (&msg, 0, sizeof (msg));
10566 msg.message = wParam;
10567 msg.flags = hook;
10568 msg.descr = "CBT_2";
10569 add_message(&msg);
10570 }
10572 }
10573
10574 /* Log also SetFocus(0) calls */
10575 hwnd = wParam ? (HWND)wParam : (HWND)lParam;
10576
10577 if (GetClassNameA(hwnd, buf, sizeof(buf)))
10578 {
10579 if (!lstrcmpiA(buf, "TestWindowClass") ||
10580 !lstrcmpiA(buf, "static"))
10581 {
10582 struct recvd_message msg;
10583
10584 msg.hwnd = hwnd;
10585 msg.message = nCode;
10586 msg.flags = hook|wparam|lparam;
10587 msg.wParam = wParam;
10588 msg.lParam = (cbt_global_hook_thread_id == GetCurrentThreadId()) ? 1 : 2;
10589 msg.descr = "CBT_2";
10590 add_message(&msg);
10591 }
10592 }
10594}
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
static HHOOK hCBT_global_hook
Definition: msg.c:10533
static DWORD cbt_global_hook_thread_id
Definition: msg.c:10534
#define memset(x, y, z)
Definition: compat.h:39
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
#define HC_ACTION
Definition: winuser.h:48
#define LLMHF_INJECTED
Definition: winuser.h:2639
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define HCBT_SYSCOMMAND
Definition: winuser.h:63

Referenced by test_winevents().

◆ cbt_global_hook_thread_proc()

static DWORD WINAPI cbt_global_hook_thread_proc ( void param)
static

Definition at line 10625 of file msg.c.

10626{
10627 HWND hwnd;
10628 MSG msg;
10629 HANDLE hevent = *(HANDLE *)param;
10630
10632 /* these events should be received only by our new hook proc,
10633 * an old one does not expect an event from another thread.
10634 */
10635
10636 hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0,0,0,0,0,0,0, NULL);
10637 assert(hwnd);
10638 trace("created thread window %p\n", hwnd);
10639
10640 *(HWND *)param = hwnd;
10641
10642 /* Windows doesn't like when a thread plays games with the focus,
10643 that leads to all kinds of misbehaviours and failures to activate
10644 a window. So, better keep next lines commented out.
10645 SetFocus(0);
10646 SetFocus(hwnd);*/
10647
10650
10652
10653 while (GetMessageA(&msg, 0, 0, 0))
10654 {
10657 }
10658 return 0;
10659}
#define trace
Definition: atltest.h:70
static HANDLE hevent
Definition: broadcast.c:34
GLfloat param
Definition: glext.h:5796
static void flush_sequence(void)
Definition: msg.c:2300
#define WS_POPUP
Definition: pedump.c:616
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define WM_SYSCOMMAND
Definition: winuser.h:1731
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)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SC_PREVWINDOW
Definition: winuser.h:2581
#define SC_NEXTWINDOW
Definition: winuser.h:2580
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)

Referenced by test_winevents().

◆ cbt_hook_proc()

static LRESULT CALLBACK cbt_hook_proc ( int  nCode,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 9955 of file msg.c.

9956{
9957 HWND hwnd;
9958
9959 ok(cbt_hook_thread_id == GetCurrentThreadId(), "we didn't ask for events from other threads\n");
9960
9961 if (nCode == HCBT_CLICKSKIPPED)
9962 {
9963 /* ignore this event, XP sends it a lot when switching focus between windows */
9964 return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
9965 }
9966
9967 if (nCode == HCBT_SYSCOMMAND || nCode == HCBT_KEYSKIPPED)
9968 {
9969 struct recvd_message msg;
9970
9971 msg.hwnd = 0;
9972 msg.message = nCode;
9973 msg.flags = hook|wparam|lparam;
9974 msg.wParam = wParam;
9975 msg.lParam = lParam;
9976 msg.descr = "CBT";
9977 add_message(&msg);
9978
9979 return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
9980 }
9981
9982 if (nCode == HCBT_DESTROYWND)
9983 {
9985 {
9987 if (style & WS_CHILD)
9989 else if (style & WS_POPUP)
9991 else
9993 }
9994 }
9995
9996 /* Log also SetFocus(0) calls */
9997 hwnd = wParam ? (HWND)wParam : (HWND)lParam;
9998
10000 {
10001 struct recvd_message msg;
10002
10003 msg.hwnd = hwnd;
10004 msg.message = nCode;
10005 msg.flags = hook|wparam|lparam;
10006 msg.wParam = wParam;
10007 msg.lParam = lParam;
10008 msg.descr = "CBT";
10009 add_message(&msg);
10010 }
10011 return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
10012}
Arabic default style
Definition: afstyles.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WND_PARENT_ID
Definition: msg.c:54
static HHOOK hCBT_hook
Definition: msg.c:118
#define WND_POPUP_ID
Definition: msg.c:55
static DWORD cbt_hook_thread_id
Definition: msg.c:119
static BOOL is_our_logged_class(HWND hwnd)
Definition: msg.c:9926
static BOOL test_DestroyWindow_flag
Definition: msg.c:114
#define WS_CHILD
Definition: pedump.c:617
#define HCBT_DESTROYWND
Definition: winuser.h:59
#define HCBT_CLICKSKIPPED
Definition: winuser.h:61
#define GWLP_ID
Definition: winuser.h:854
#define HCBT_KEYSKIPPED
Definition: winuser.h:62

Referenced by init_tests(), START_TEST(), and test_set_hook().

◆ check_lb_state_dbg()

static void check_lb_state_dbg ( HWND  listbox,
int  count,
int  cur_sel,
int  caret_index,
int  top_index,
int  line 
)
static

Definition at line 14897 of file msg.c.

14899{
14900 LRESULT ret;
14901
14902 /* calling an orig proc helps to avoid unnecessary message logging */
14903 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCOUNT, 0, 0);
14904 ok_(__FILE__, line)(ret == count, "expected count %d, got %ld\n", count, ret);
14905 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCURSEL, 0, 0);
14906 ok_(__FILE__, line)(ret == cur_sel, "expected cur sel %d, got %ld\n", cur_sel, ret);
14907 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCARETINDEX, 0, 0);
14908 ok_(__FILE__, line)(ret == caret_index ||
14909 broken(cur_sel == -1 && caret_index == 0 && ret == -1), /* nt4 */
14910 "expected caret index %d, got %ld\n", caret_index, ret);
14911 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETTOPINDEX, 0, 0);
14912 ok_(__FILE__, line)(ret == top_index, "expected top index %d, got %ld\n", top_index, ret);
14913}
#define broken(x)
Definition: _sntprintf.h:21
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: parser.c:49
#define LB_GETCOUNT
Definition: winuser.h:2028
#define LB_GETTOPINDEX
Definition: winuser.h:2041
#define LB_GETCARETINDEX
Definition: winuser.h:2027
#define LB_GETCURSEL
Definition: winuser.h:2029

◆ check_update_rgn_()

static void check_update_rgn_ ( int  line,
HWND  hwnd,
HRGN  hrgn 
)
static

Definition at line 7717 of file msg.c.

7718{
7719 INT ret;
7720 RECT r1, r2;
7721 HRGN tmp = CreateRectRgn( 0, 0, 0, 0 );
7722 HRGN update = CreateRectRgn( 0, 0, 0, 0 );
7723
7724 ret = GetUpdateRgn( hwnd, update, FALSE );
7725 ok( ret != ERROR, "GetUpdateRgn failed\n" );
7726 if (ret == NULLREGION)
7727 {
7728 ok_(__FILE__,line)( !hrgn, "Update region shouldn't be empty\n" );
7729 }
7730 else
7731 {
7732 if (CombineRgn( tmp, hrgn, update, RGN_XOR ) != NULLREGION)
7733 {
7734 ok_(__FILE__,line)( 0, "Regions are different\n" );
7735 if (winetest_debug > 0)
7736 {
7737 printf( "Update region: " );
7738 dump_region( update );
7739 printf( "Wanted region: " );
7740 dump_region( hrgn );
7741 }
7742 }
7743 }
7744 GetRgnBox( update, &r1 );
7745 GetUpdateRect( hwnd, &r2, FALSE );
7746 ok_(__FILE__,line)( EqualRect( &r1, &r2 ), "Rectangles are different: %s / %s\n",
7748
7749 DeleteObject( tmp );
7750 DeleteObject( update );
7751}
static HRGN hrgn
#define ERROR(name)
Definition: error_private.h:53
#define printf
Definition: freeldr.h:94
pKey DeleteObject()
static DNS_RECORDW r1
Definition: record.c:37
static DNS_RECORDW r2
Definition: record.c:38
void dump_region(HRGN hrgn)
Definition: msg.c:7695
static __inline const char * wine_dbgstr_rect(const RECT *rect)
Definition: debug.h:219
int winetest_debug
int32_t INT
Definition: typedefs.h:58
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
#define NULLREGION
Definition: wingdi.h:361
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define RGN_XOR
Definition: wingdi.h:360
int WINAPI GetRgnBox(_In_ HRGN, _Out_ LPRECT)
int WINAPI GetUpdateRgn(_In_ HWND, _In_ HRGN, _In_ BOOL)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

◆ cleanup_tests()

static void cleanup_tests ( )
static

Definition at line 18029 of file msg.c.

18030{
18031 BOOL ret;
18033 if (pUnhookWinEvent && hEvent_hook)
18034 {
18035 ret = pUnhookWinEvent(hEvent_hook);
18036 ok( ret, "UnhookWinEvent error %d\n", GetLastError());
18037 SetLastError(0xdeadbeef);
18038 ok(!pUnhookWinEvent(hEvent_hook), "UnhookWinEvent succeeded\n");
18039 ok(GetLastError() == ERROR_INVALID_HANDLE || /* Win2k */
18040 GetLastError() == 0xdeadbeef, /* Win9x */
18041 "unexpected error %d\n", GetLastError());
18042 }
18044
18045}
#define SetLastError(x)
Definition: compat.h:752
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static HWINEVENTHOOK hEvent_hook
Definition: msg.c:116
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)

Referenced by START_TEST().

◆ clear_clipboard_()

static void clear_clipboard_ ( int  line,
HWND  hWnd 
)
static

Definition at line 15714 of file msg.c.

15715{
15716 BOOL succ;
15717 succ = OpenClipboard(hWnd);
15718 ok_(__FILE__, line)(succ, "OpenClipboard failed, err=%u\n", GetLastError());
15719 succ = EmptyClipboard();
15720 ok_(__FILE__, line)(succ, "EmptyClipboard failed, err=%u\n", GetLastError());
15721 succ = CloseClipboard();
15722 ok_(__FILE__, line)(succ, "CloseClipboard failed, err=%u\n", GetLastError());
15723}
HWND hWnd
Definition: settings.c:17
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190

◆ combobox_edit_subclass_proc()

static LRESULT CALLBACK combobox_edit_subclass_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 7371 of file msg.c.

7373{
7374 static LONG defwndproc_counter = 0;
7375 LRESULT ret;
7376 struct recvd_message msg;
7377
7378 /* do not log painting messages */
7379 if (message != WM_PAINT &&
7380 message != WM_NCPAINT &&
7381 message != WM_SYNCPAINT &&
7383 message != WM_NCHITTEST &&
7384 message != WM_GETTEXT &&
7386 {
7387 msg.hwnd = hwnd;
7388 msg.message = message;
7389 msg.flags = sent|wparam|lparam;
7390 if (defwndproc_counter) msg.flags |= defwinproc;
7391 msg.wParam = wParam;
7392 msg.lParam = lParam;
7393 msg.descr = "combo edit";
7394 add_message(&msg);
7395 }
7396
7397 defwndproc_counter++;
7399 defwndproc_counter--;
7400
7401 return ret;
7402}
static WNDPROC edit_window_proc
Definition: msg.c:7369
#define WM_PAINT
Definition: winuser.h:1610
#define WM_ERASEBKGND
Definition: winuser.h:1615
#define WM_NCHITTEST
Definition: winuser.h:1676
#define WM_GETTEXT
Definition: winuser.h:1608
#define WM_NCPAINT
Definition: winuser.h:1677

Referenced by test_combobox_messages().

◆ combobox_hook_proc()

static LRESULT CALLBACK combobox_hook_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 7436 of file msg.c.

7437{
7438 static LONG defwndproc_counter = 0;
7439 LRESULT ret;
7440 struct recvd_message msg;
7441
7442 /* do not log painting messages */
7443 if (message != WM_PAINT &&
7444 message != WM_NCPAINT &&
7445 message != WM_SYNCPAINT &&
7447 message != WM_NCHITTEST &&
7448 message != WM_GETTEXT &&
7450 {
7451 msg.hwnd = hwnd;
7452 msg.message = message;
7453 msg.flags = sent|wparam|lparam;
7454 if (defwndproc_counter) msg.flags |= defwinproc;
7455 msg.wParam = wParam;
7456 msg.lParam = lParam;
7457 msg.descr = "combo";
7458 add_message(&msg);
7459 }
7460
7461 defwndproc_counter++;
7463 defwndproc_counter--;
7464
7465 return ret;
7466}
static WNDPROC old_combobox_proc
Definition: msg.c:7369

Referenced by subclass_combobox().

◆ combobox_lbox_subclass_proc()

static LRESULT CALLBACK combobox_lbox_subclass_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 7404 of file msg.c.

7406{
7407 static LONG defwndproc_counter = 0;
7408 LRESULT ret;
7409 struct recvd_message msg;
7410
7411 /* do not log painting messages */
7412 if (message != WM_PAINT &&
7413 message != WM_NCPAINT &&
7414 message != WM_SYNCPAINT &&
7416 message != WM_NCHITTEST &&
7418 {
7419 msg.hwnd = hwnd;
7420 msg.message = message;
7421 msg.flags = sent|wparam|lparam;
7422 if (defwndproc_counter) msg.flags |= defwinproc;
7423 msg.wParam = wParam;
7424 msg.lParam = lParam;
7425 msg.descr = "combo lbox";
7426 add_message(&msg);
7427 }
7428
7429 defwndproc_counter++;
7431 defwndproc_counter--;
7432
7433 return ret;
7434}
static WNDPROC lbox_window_proc
Definition: msg.c:7369

Referenced by test_combobox_messages().

◆ create_child_thread()

static DWORD CALLBACK create_child_thread ( void param)
static

Definition at line 8573 of file msg.c.

8574{
8575 struct wnd_event *wnd_event = param;
8576 struct wnd_event child_event;
8577 DWORD ret, tid;
8578 MSG msg;
8579
8580 child_event.hwnd = CreateWindowExA(0, "TestWindowClass", "Test child",
8581 WS_CHILD | WS_VISIBLE, 0, 0, 10, 10, wnd_event->hwnd, 0, 0, NULL);
8582 ok (child_event.hwnd != 0, "Failed to create child window\n");
8583 SetFocus( child_event.hwnd );
8584 flush_events();
8586 child_event.start_event = wnd_event->start_event;
8588 for (;;)
8589 {
8590 DWORD ret = MsgWaitForMultipleObjects(1, &child_event.start_event, FALSE, 1000, QS_SENDMESSAGE);
8591 if (ret != 1) break;
8592 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
8593 }
8595 ok( !ret, "WaitForSingleObject failed %x\n", ret );
8596 return 0;
8597}
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
static TfClientId tid
static void flush_events(void)
Definition: msg.c:2285
static DWORD CALLBACK create_grand_child_thread(void *param)
Definition: msg.c:8551
#define WS_VISIBLE
Definition: pedump.c:620
HANDLE grand_child
Definition: msg.c:8524
HWND hwnd
Definition: input.c:2591
HANDLE stop_event
Definition: msg.c:8526
HANDLE start_event
Definition: input.c:2593
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define QS_SENDMESSAGE
Definition: winuser.h:874
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
HWND WINAPI SetFocus(_In_opt_ HWND)
#define PM_REMOVE
Definition: winuser.h:1186
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)

Referenced by test_interthread_messages().

◆ create_grand_child_thread()

static DWORD CALLBACK create_grand_child_thread ( void param)
static

Definition at line 8551 of file msg.c.

8552{
8553 struct wnd_event *wnd_event = param;
8554 HWND hchild;
8555 MSG msg;
8556
8557 hchild = CreateWindowExA(0, "TestWindowClass", "Test child",
8558 WS_CHILD | WS_VISIBLE, 0, 0, 10, 10, wnd_event->hwnd, 0, 0, NULL);
8559 ok (hchild != 0, "Failed to create child window\n");
8560 flush_events();
8563
8564 for (;;)
8565 {
8567 if (!IsWindow( hchild )) break; /* will be destroyed when parent thread exits */
8568 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
8569 }
8570 return 0;
8571}
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define QS_ALLINPUT
Definition: winuser.h:897

Referenced by create_child_thread().

◆ create_manifest_file()

static void create_manifest_file ( const char filename,
const char manifest 
)
static

Definition at line 8615 of file msg.c.

8616{
8618 HANDLE file;
8619 DWORD size;
8620
8623 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
8626}
#define CloseHandle
Definition: compat.h:739
#define CP_ACP
Definition: compat.h:109
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define MultiByteToWideChar
Definition: compat.h:110
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
GLsizeiptr size
Definition: glext.h:5919
const char * filename
Definition: ioapi.h:137
#define CREATE_ALWAYS
Definition: disk.h:72
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:127
static const CHAR manifest[]
Definition: v6util.h:39

Referenced by test_interthread_messages().

◆ DispatchMessageCheckProc()

static LRESULT WINAPI DispatchMessageCheckProc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 11279 of file msg.c.

11280{
11281 if (message == WM_PAINT) return 0;
11282 return MsgCheckProcA( hwnd, message, wParam, lParam );
11283}
static LRESULT WINAPI MsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:9532

Referenced by test_DispatchMessage().

◆ dlg_creation_edit_proc()

static LRESULT WINAPI dlg_creation_edit_proc ( HWND  hwnd,
UINT  message,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 13572 of file msg.c.

13573{
13574 struct recvd_message msg;
13575
13576 if (ignore_message( message )) return 0;
13577
13578 msg.hwnd = hwnd;
13579 msg.message = message;
13580 msg.flags = sent|wparam|lparam;
13581 msg.wParam = wp;
13582 msg.lParam = lp;
13583 msg.descr = "edit";
13584 add_message(&msg);
13585
13586 return CallWindowProcW(orig_edit_proc, hwnd, message, wp, lp);
13587}
static WNDPROC orig_edit_proc
Definition: msg.c:13571
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by test_dlg_proc2(), and test_dlg_proc4().

◆ do_wait_idle_child()

static void do_wait_idle_child ( int  arg)
static

Definition at line 16095 of file msg.c.

16096{
16097 WNDCLASSA cls;
16098 MSG msg;
16099 HWND hwnd = 0;
16100 HANDLE thread;
16101 DWORD id;
16102 HANDLE start_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_start" );
16103 HANDLE end_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_end" );
16104
16105 memset( &cls, 0, sizeof(cls) );
16107 cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
16109 cls.lpszClassName = "TestClass";
16110 RegisterClassA( &cls );
16111
16112 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */
16113
16114 ok( start_event != 0, "failed to create start event, error %u\n", GetLastError() );
16115 ok( end_event != 0, "failed to create end event, error %u\n", GetLastError() );
16116
16117 switch (arg)
16118 {
16119 case 0:
16121 break;
16122 case 1:
16124 Sleep( 200 );
16125 PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
16126 break;
16127 case 2:
16129 Sleep( 200 );
16130 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16131 PostThreadMessageA( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd );
16132 PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
16133 break;
16134 case 3:
16136 Sleep( 200 );
16138 break;
16139 case 4:
16141 Sleep( 200 );
16142 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
16143 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
16144 break;
16145 case 5:
16147 Sleep( 200 );
16148 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
16149 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
16150 break;
16151 case 6:
16153 Sleep( 200 );
16154 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
16155 while (PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ))
16156 {
16157 GetMessageA( &msg, 0, 0, 0 );
16159 }
16160 break;
16161 case 7:
16163 Sleep( 200 );
16164 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
16165 SetTimer( hwnd, 3, 1, NULL );
16166 Sleep( 200 );
16167 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
16168 break;
16169 case 8:
16171 Sleep( 200 );
16172 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16174 break;
16175 case 9:
16177 Sleep( 200 );
16178 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
16179 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
16180 for (;;) GetMessageA( &msg, 0, 0, 0 );
16181 break;
16182 case 10:
16184 Sleep( 200 );
16185 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
16186 SetTimer( hwnd, 3, 1, NULL );
16187 Sleep( 200 );
16188 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
16189 break;
16190 case 11:
16192 Sleep( 200 );
16193 return; /* exiting the process makes WaitForInputIdle return success too */
16194 case 12:
16195 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16196 Sleep( 200 );
16199 break;
16200 case 13:
16202 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16203 Sleep( 200 );
16205 WaitForSingleObject( thread, 10000 );
16207 break;
16208 case 14:
16210 Sleep( 200 );
16212 break;
16213 case 15:
16215 Sleep( 200 );
16217 break;
16218 case 16:
16220 Sleep( 200 );
16222 break;
16223 case 17:
16225 Sleep( 200 );
16226 PeekMessageA( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE );
16227 break;
16228 case 18:
16230 Sleep( 200 );
16232 break;
16233 case 19:
16235 Sleep( 200 );
16237 break;
16238 case 20:
16240 Sleep( 200 );
16242 break;
16243 }
16244 WaitForSingleObject( end_event, 2000 );
16246 CloseHandle( end_event );
16247 if (hwnd) DestroyWindow( hwnd );
16248}
static HANDLE thread
Definition: service.c:33
GLuint id
Definition: glext.h:5910
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
static HANDLE start_event
Definition: thread.c:135
static DWORD CALLBACK do_wait_idle_child_thread(void *arg)
Definition: msg.c:16085
HBRUSH hbrBackground
Definition: winuser.h:3160
HCURSOR hCursor
Definition: winuser.h:3159
LPCSTR lpszClassName
Definition: winuser.h:3162
WNDPROC lpfnWndProc
Definition: winuser.h:3154
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
Definition: synch.c:669
#define HWND_MESSAGE
Definition: winuser.h:1200
#define COLOR_WINDOW
Definition: winuser.h:912
#define HWND_TOPMOST
Definition: winuser.h:1198
#define HWND_BROADCAST
Definition: winuser.h:1194
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_WININICHANGE
Definition: winuser.h:1620
#define IDC_ARROW
Definition: winuser.h:682
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define PM_NOYIELD
Definition: winuser.h:1187
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HWND_NOTOPMOST
Definition: winuser.h:1196
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_NOREMOVE
Definition: winuser.h:1185
#define HWND_BOTTOM
Definition: winuser.h:1195
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by START_TEST().

◆ do_wait_idle_child_thread()

static DWORD CALLBACK do_wait_idle_child_thread ( void arg)
static

Definition at line 16085 of file msg.c.

16086{
16087 MSG msg;
16088
16089 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16090 Sleep( 200 );
16092 return 0;
16093}

Referenced by do_wait_idle_child().

◆ dump_region()

void dump_region ( HRGN  hrgn)

Definition at line 7695 of file msg.c.

7696{
7697 DWORD i, size;
7698 RGNDATA *data = NULL;
7699 RECT *rect;
7700
7701 if (!hrgn)
7702 {
7703 printf( "null region\n" );
7704 return;
7705 }
7706 if (!(size = GetRegionData( hrgn, 0, NULL ))) return;
7707 if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return;
7709 printf("%d rects:", data->rdh.nCount );
7710 for (i = 0, rect = (RECT *)data->Buffer; i < data->rdh.nCount; i++, rect++)
7711 printf( " %s", wine_dbgstr_rect( rect ));
7712 printf("\n");
7713 HeapFree( GetProcessHeap(), 0, data );
7714}
#define HeapFree(x, y, z)
Definition: compat.h:735
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
& rect
Definition: startmenu.cpp:1413
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)

Referenced by check_update_rgn_(), test_scrolldc(), and test_scrollvalidate().

◆ dump_sequence()

static void dump_sequence ( const struct message expected,
const char context,
const char file,
int  line 
)
static

Definition at line 2309 of file msg.c.

2310{
2311 const struct recvd_message *actual = sequence;
2312 unsigned int count = 0;
2313
2314 trace_(file, line)("Failed sequence %s:\n", context );
2315 while (expected->message && actual->message)
2316 {
2317 if (actual->output[0])
2318 {
2319 if (expected->flags & hook)
2320 {
2321 trace_(file, line)( " %u: expected: hook %04x - actual: %s\n",
2322 count, expected->message, actual->output );
2323 }
2324 else if (expected->flags & winevent_hook)
2325 {
2326 trace_(file, line)( " %u: expected: winevent %04x - actual: %s\n",
2327 count, expected->message, actual->output );
2328 }
2329 else if (expected->flags & kbd_hook)
2330 {
2331 trace_(file, line)( " %u: expected: kbd %04x - actual: %s\n",
2332 count, expected->message, actual->output );
2333 }
2334 else
2335 {
2336 trace_(file, line)( " %u: expected: msg %04x - actual: %s\n",
2337 count, expected->message, actual->output );
2338 }
2339 }
2340
2341 if (expected->message == actual->message)
2342 {
2343 if ((expected->flags & defwinproc) != (actual->flags & defwinproc) &&
2344 (expected->flags & optional))
2345 {
2346 /* don't match messages if their defwinproc status differs */
2347 expected++;
2348 }
2349 else
2350 {
2351 expected++;
2352 actual++;
2353 }
2354 }
2355 /* silently drop winevent messages if there is no support for them */
2356 else if ((expected->flags & optional) || ((expected->flags & winevent_hook) && !hEvent_hook))
2357 expected++;
2358 else
2359 {
2360 expected++;
2361 actual++;
2362 }
2363 count++;
2364 }
2365
2366 /* optional trailing messages */
2367 while (expected->message && ((expected->flags & optional) ||
2368 ((expected->flags & winevent_hook) && !hEvent_hook)))
2369 {
2370 trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
2371 expected++;
2372 count++;
2373 }
2374
2375 if (expected->message)
2376 {
2377 trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
2378 return;
2379 }
2380
2381 while (actual->message && actual->output[0])
2382 {
2383 trace_(file, line)( " %u: expected: nothing - actual: %s\n", count, actual->output );
2384 actual++;
2385 count++;
2386 }
2387}
#define trace_(file, line,...)
Definition: kmt_test.h:223
BOOL expected
Definition: store.c:2063
Definition: http.c:7252

Referenced by ok_sequence_().

◆ edit_hook_proc()

static LRESULT CALLBACK edit_hook_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 11600 of file msg.c.

11601{
11602 static LONG defwndproc_counter = 0;
11603 LRESULT ret;
11604 struct recvd_message msg;
11605
11606 if (ignore_message( message )) return 0;
11607
11608 msg.hwnd = hwnd;
11609 msg.message = message;
11610 msg.flags = sent|wparam|lparam;
11611 if (defwndproc_counter) msg.flags |= defwinproc;
11612 msg.wParam = wParam;
11613 msg.lParam = lParam;
11614 msg.descr = "edit";
11615 add_message(&msg);
11616
11617 defwndproc_counter++;
11619 defwndproc_counter--;
11620
11621 return ret;
11622}
static WNDPROC old_edit_proc
Definition: msg.c:11598

Referenced by subclass_edit().

◆ expect_HWND_()

static void expect_HWND_ ( int  line,
HWND  expected,
HWND  got 
)
static

Definition at line 15726 of file msg.c.

15727{
15728 ok_(__FILE__, line)(got==expected, "Expected %p, got %p\n", expected, got);
15729}

◆ flush_events()

static void flush_events ( void  )
static

Definition at line 2285 of file msg.c.

2286{
2287 MSG msg;
2288 int diff = 200;
2289 int min_timeout = 100;
2290 DWORD time = GetTickCount() + diff;
2291
2292 while (diff > 0)
2293 {
2294 if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
2295 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
2296 diff = time - GetTickCount();
2297 }
2298}
#define WAIT_TIMEOUT
Definition: dderror.h:14
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
__u16 time
Definition: mkdosfs.c:8

Referenced by create_child_thread(), create_grand_child_thread(), invisible_parent_tests(), START_TEST(), test_accelerators(), test_autoradio_BM_CLICK(), test_autoradio_kbd_move(), test_broadcast(), test_button_messages(), test_defwinproc(), test_DispatchMessage(), test_DoubleSetCapture(), test_interthread_messages(), test_keyflags(), test_layered_window(), test_menu_messages(), test_messages(), test_msg_setpos_(), test_notify_message(), test_nullCallback(), test_paint_messages(), test_PeekMessage(), test_PeekMessage2(), test_PeekMessage3(), test_PostMessage(), test_quit_message(), test_restore_messages(), test_scroll_messages(), test_scrollwindowex(), test_SendMessage_other_thread(), test_SendMessageTimeout(), test_SetFocus(), test_SetParent(), test_setwindowpos(), test_SetWindowRgn(), test_ShowWindow(), test_TrackMouseEvent(), test_TrackPopupMenu(), test_TrackPopupMenuEmpty(), test_WM_SETREDRAW(), and test_wmime_keydown_message().

◆ flush_sequence()

static void flush_sequence ( void  )
static

Definition at line 2300 of file msg.c.

Referenced by cbt_global_hook_thread_proc(), create_child_thread(), create_grand_child_thread(), invisible_parent_tests(), mouse_ll_global_thread_proc(), ok_sequence_(), test_accelerators(), test_autoradio_BM_CLICK(), test_autoradio_kbd_move(), test_button_messages(), test_clipboard_viewers(), test_combobox_messages(), test_dbcs_wm_char(), test_defwinproc(), test_DestroyWindow(), test_dialog_messages(), test_DispatchMessage(), test_DoubleSetCapture(), test_edit_messages(), test_EndDialog(), test_enddialog_seq(), test_enddialog_seq2(), test_hotkey(), test_interthread_messages(), test_keyflags(), test_layered_window(), test_listbox_messages(), test_mdi_messages(), test_menu_messages(), test_message_conversion(), test_messages(), test_msg_setpos_(), test_notify_message(), test_paint_messages(), test_PeekMessage(), test_quit_message(), test_recursive_activation(), test_restore_messages(), test_scroll_messages(), test_scrollwindowex(), test_SendMessage_other_thread(), test_SendMessageTimeout(), test_SetActiveWindow(), test_SetFocus(), test_SetForegroundWindow(), test_SetParent(), test_setwindowpos(), test_SetWindowRgn(), test_showwindow(), test_ShowWindow(), test_static_messages(), test_sys_menu(), test_TrackMouseEvent(), test_TrackPopupMenu(), test_TrackPopupMenuEmpty(), test_unicode_wm_char(), test_winevents(), test_WM_SETREDRAW(), test_wmime_keydown_message(), and win_event_global_thread_proc().

◆ get_input_codepage()

static DWORD get_input_codepage ( void  )
static

Definition at line 14322 of file msg.c.

14323{
14324 DWORD cp;
14325 int ret;
14326 HKL hkl = GetKeyboardLayout( 0 );
14327
14328 ret = GetLocaleInfoW( LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
14329 (WCHAR *)&cp, sizeof(cp) / sizeof(WCHAR) );
14330 if (!ret) cp = CP_ACP;
14331 return cp;
14332}
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1102
POINT cp
Definition: magnifier.c:59
HKL hkl
Definition: msctf.idl:611
UINT_PTR HKL
Definition: msctf.idl:104
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:38
HKL WINAPI GetKeyboardLayout(_In_ DWORD)

Referenced by test_dbcs_wm_char().

◆ get_menu_style()

static DWORD get_menu_style ( HMENU  hmenu)
static

Definition at line 15258 of file msg.c.

15259{
15260 MENUINFO mi;
15261 BOOL ret;
15262
15263 mi.cbSize = sizeof(mi);
15264 mi.fMask = MIM_STYLE;
15265 mi.dwStyle = 0;
15266 SetLastError(0xdeadbeef);
15267 ret = pGetMenuInfo(hmenu, &mi);
15268 ok(ret, "GetMenuInfo error %u\n", GetLastError());
15269
15270 return mi.dwStyle;
15271}
DWORD cbSize
Definition: winuser.h:3774
static HMENU hmenu
Definition: win.c:66

Referenced by test_menu_messages().

◆ get_text_len_proc()

static LRESULT CALLBACK get_text_len_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 10068 of file msg.c.

10069{
10070 switch(msg)
10071 {
10072 case WM_GETTEXTLENGTH:
10073 return lstrlenW(dummy_window_text) + 37; /* some random length */
10074 case WM_GETTEXT:
10076 return lstrlenW( (LPWSTR)lp );
10077 default:
10078 return DefWindowProcW( hwnd, msg, wp, lp );
10079 }
10080}
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
static const WCHAR dummy_window_text[]
Definition: msg.c:10065
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by test_message_conversion().

◆ get_winpos_flags()

static const char * get_winpos_flags ( UINT  flags)
static

Definition at line 2051 of file msg.c.

2052{
2053 static char buffer[300];
2054
2055 buffer[0] = 0;
2056#define DUMP(flag) do { if (flags & flag) { strcat( buffer, "|" #flag ); flags &= ~flag; } } while(0)
2066 DUMP( SWP_NOZORDER );
2067 DUMP( SWP_NOREDRAW );
2068 DUMP( SWP_NOSIZE );
2069 DUMP( SWP_NOMOVE );
2072 if (flags) sprintf(buffer + strlen(buffer),"|0x%04x", flags);
2073 return buffer + 1;
2074#undef DUMP
2075}
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161
#define SWP_NOCLIENTSIZE
Definition: msg.c:40
#define SWP_NOCLIENTMOVE
Definition: msg.c:41
#define DUMP(flag)
#define SWP_NOACTIVATE
Definition: winuser.h:1232
#define SWP_NOREDRAW
Definition: winuser.h:1236
#define SWP_FRAMECHANGED
Definition: winuser.h:1230
#define SWP_NOMOVE
Definition: winuser.h:1234
#define SWP_NOSIZE
Definition: winuser.h:1235
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1243
#define SWP_DEFERERASE
Definition: winuser.h:1242
#define SWP_NOCOPYBITS
Definition: winuser.h:1233
#define SWP_SHOWWINDOW
Definition: winuser.h:1238
#define SWP_HIDEWINDOW
Definition: winuser.h:1231
#define SWP_NOOWNERZORDER
Definition: winuser.h:1239
#define SWP_NOZORDER
Definition: winuser.h:1237
#define SWP_NOSENDCHANGING
Definition: winuser.h:1241

Referenced by add_message_().

◆ HANDLE()

static ULONG_PTR *static HANDLE ( WINAPI pCreateActCtxW)
static

◆ hash_Ly()

static unsigned hash_Ly ( const char str)
static

Definition at line 2099 of file msg.c.

2100{
2101 unsigned hash = 0;
2102
2103 for (; *str; str++)
2104 hash = hash * 1664525u + (unsigned char)(*str) + 1013904223u;
2105
2106 return hash;
2107}
const WCHAR * str
Definition: _hash_fun.h:40

Referenced by add_message_(), and listbox_hook_proc().

◆ hash_Ly_W()

static unsigned hash_Ly_W ( const WCHAR str)
static

Definition at line 2089 of file msg.c.

2090{
2091 unsigned hash = 0;
2092
2093 for (; *str; str++)
2094 hash = hash * 1664525u + (unsigned char)(*str) + 1013904223u;
2095
2096 return hash;
2097}

Referenced by add_message_().

◆ HMONITOR()

static HMONITOR ( WINAPI pMonitorFromPoint)
static

◆ HotkeyMsgCheckProcA()

static LRESULT WINAPI HotkeyMsgCheckProcA ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 9807 of file msg.c.

9808{
9809 static LONG defwndproc_counter = 0;
9810 LRESULT ret;
9811 struct recvd_message msg;
9812 DWORD queue_status;
9813
9814 if (ignore_message( message )) return 0;
9815
9816 if ((message >= WM_KEYFIRST && message <= WM_KEYLAST) ||
9818 {
9819 msg.hwnd = hwnd;
9820 msg.message = message;
9821 msg.flags = sent|wparam|lparam;
9822 if (defwndproc_counter) msg.flags |= defwinproc;
9823 msg.wParam = wParam;
9824 msg.lParam = lParam;
9825 msg.descr = "HotkeyMsgCheckProcA";
9826 add_message(&msg);
9827 }
9828
9829 defwndproc_counter++;
9831 defwndproc_counter--;
9832
9833 if (message == WM_APP)
9834 {
9835 queue_status = GetQueueStatus(QS_HOTKEY);
9836 ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %x\n", queue_status);
9837 queue_status = GetQueueStatus(QS_POSTMESSAGE);
9838 ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %x\n", queue_status);
9839 PostMessageA(hwnd, WM_APP+1, 0, 0);
9840 }
9841 else if (