ReactOS 0.4.16-dev-2491-g3dc6630
msg.c File Reference
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "winnls.h"
#include "dbt.h"
#include "commctrl.h"
#include "imm.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  run_in_temp_desktop_args
 
struct  wnd_event
 
struct  timer_info
 
struct  sendmsg_info
 
struct  peekmsg_info
 
struct  rbuttonup_thread_data
 
struct  layered_window_info
 
struct  test_hook_cleanup_data
 

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 %ld\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 subtest_swp_paint_regions(w, p, c)   subtest_swp_paint_regions_(__LINE__,w,p,c)
 
#define run_in_temp_desktop(f)   run_in_temp_desktop_(__FILE__, __LINE__, #f, f)
 
#define TIMER_ID   0x19
 
#define TIMER_COUNT   500 /* 499 samples */
 
#define TIMER_DURATION_EXPECTED   10000 /* 10 ms */
 
#define TIMER_DURATION_ALT   15600 /* 15.6 ms */
 
#define TIMER_DURATION_TOLERANCE   1000 /* 1 ms */
 
#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 TEST_MOUSEACTIVATE(A, B, C)
 
#define open_clipboard(hwnd)   open_clipboard_(__LINE__, hwnd)
 
#define clear_clipboard(hwnd)   clear_clipboard_(__LINE__, (hwnd))
 
#define expect_HWND(expected, got)   expect_HWND_(__LINE__, (expected), (got))
 

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 , kbd_hook = 0x400 , 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 ,
  kbd_hook =0x400 , msg_todo =0x800 , wine_only =0x1000
}
 

Functions

static void pump_msg_loop (HWND hwnd, HACCEL hAccel)
 
static LRESULT WINAPI ParentMsgCheckProcA (HWND, UINT, WPARAM, LPARAM)
 
static void register_class (const WNDCLASSA *class)
 
static void (WINAPI *pNotifyWinEvent)(DWORD
 
static HWINEVENTHOOK (WINAPI *pSetWinEventHook)(DWORD
 
static BOOL (WINAPI *pTrackMouseEvent)(TRACKMOUSEEVENT *)
 
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 const charmessage_type_name (int flags)
 
static BOOL can_skip_message (const struct message *expected)
 
static BOOL messages_equal (const struct message *expected, const struct recvd_message *actual, BOOL expect_equal, const char *file, int line)
 
static BOOL sequence_contains_message (const struct message *expected, const struct recvd_message *actual)
 
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 void mdi_register_classes (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_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 hide_window_thread (LPVOID arg)
 
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 void visualize_region_differences (HWND hwnd, HWND hother, HRGN hrgn_expect, HRGN hrgn_actual)
 
static void subtest_swp_paint_regions_ (int line, int wrap_toplevel, LPCSTR parent_class, LPCSTR child_class)
 
static void test_swp_paint_regions (void)
 
static void test_swp_paint_region_on_show (void)
 
static void test_swp_paint_region_on_extend_zerosize (void)
 
static void subtest_hvredraw (HWND hparent, UINT class_style, DWORD style)
 
static void test_hvredraw (void)
 
static DWORD WINAPI run_in_temp_desktop_thread_func (LPVOID param)
 
static void run_in_temp_desktop_ (const char *file, int line, const char *name, void(*test_func)(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 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 LRESULT 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 PaintLoopProcA (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI HotkeyMsgCheckProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void register_classes (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 int compare_ulonglong (const void *a, const void *b)
 
static void timer_fired (void)
 
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 charget_test_dll_path (void)
 
static void test_set_hook (void)
 
static void simulate_click (BOOL left, int x, int y)
 
static LRESULT WINAPI rec_get_message_hook (int code, WPARAM w, LPARAM l)
 
static LRESULT CALLBACK keyboard_recursive_hook_proc (int code, WPARAM wp, LPARAM lp)
 
static LRESULT CALLBACK mouse_recursive_hook_proc (int code, WPARAM wp, LPARAM lp)
 
static LRESULT CALLBACK keyboard_recursive_cbt_hook_proc (int code, WPARAM wp, LPARAM lp)
 
static LRESULT CALLBACK mouse_recursive_cbt_hook_proc (int code, WPARAM wp, LPARAM lp)
 
static void test_recursive_hook (void)
 
static LRESULT WINAPI recursive_messages_proc (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
 
static void test_recursive_messages (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 LRESULT CALLBACK edit_ime_subclass_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI test_edit_ime_messages (void *unused_arg)
 
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 BOOL open_clipboard_ (int line, HWND hwnd)
 
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 LRESULT WINAPI broadcast_test_sub_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 minimize_popup_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
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 void test_SendMessage_other_thread (void)
 
static DWORD WINAPI SetParent_thread (void *param)
 
static void test_setparent_status (void)
 
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 test_button_style (void)
 
static LRESULT WINAPI test_create_name_procW (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_create_name (void)
 
static LRESULT WINAPI changed_window_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI call_window_proc_hook (INT code, WPARAM wparam, LPARAM lparam)
 
static void test_hook_changing_window_proc (void)
 
static void test_radiobutton_focus (void)
 
static void CALLBACK test_hook_cleanup_hook_proc (HWINEVENTHOOK hook, DWORD event_id, HWND hwnd, LONG obj_id, LONG child_id, DWORD thread_id, DWORD event_time)
 
static DWORD WINAPI test_hook_cleanup_thread_proc (void *context)
 
static void test_hook_cleanup (void)
 
 START_TEST (msg)
 

Variables

static BOOL test_DestroyWindow_flag
 
static BOOL test_context_menu
 
static BOOL ignore_mouse_messages = TRUE
 
static HWINEVENTHOOK hEvent_hook
 
static HHOOK hKBD_hook
 
static HHOOK hCBT_hook
 
static DWORD cbt_hook_thread_id
 
static DWORD winevent_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 WmShowRestoreMinimizedOverlappedSeq []
 
static const struct message WmShowNoActivateMinimizedOverlappedSeq []
 
static const struct message WmShowRestoreActiveMinimizedOverlappedSeq []
 
static const struct message WmShowNoActivateActiveMinimizedOverlappedSeq []
 
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 WmFirstDrawSetWindowPosSeq6 []
 
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 WmTrackPopupMenuMinimizeWindow []
 
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 HWND
 
static LONG
 
static DWORD
 
static HMODULE
 
static WINEVENTPROC
 
static HDC
 
static POINT SIZE POINT COLORREF
 
static UINT_PTR
 
static UINT
 
static TIMERPROC
 
static ULONG
 
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 WmFrameChanged []
 
static const struct message WmFrameChanged_move []
 
static const struct message WmMove_mouse []
 
static const struct message WmMove_mouse2 []
 
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 WmSetFontOwnerdrawSeq []
 
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 GUID iface_guid = {0x66666666}
 
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 ULONGLONG timer_ticks [TIMER_COUNT]
 
static int timer_duration = 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 BOOL skip_WH_KEYBOARD_hook
 
static BOOL skip_WH_MOUSE_hook
 
static int max_msg_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 edit_wm_ime_composition_seq []
 
static const struct message edit_wm_ime_composition_korean_seq []
 
static const struct message edit_wm_ime_char_seq []
 
static const struct message edit_eimes_getcompstratonce_seq []
 
static const struct message edit_eimes_getcompstratonce_korean_seq []
 
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 const struct message wm_lb_dblclick_0 []
 
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 const struct message WmRestoreActiveMinimizedOverlappedSeq []
 
static struct message WmContextMenuSeq []
 
static WNDPROC pOldViewerProc
 
static WPARAM g_broadcast_wparam
 
static UINT g_broadcast_msg
 
static WNDPROCg_oldproc_sub
 
static WPARAMg_broadcast_sub_wparam
 
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 const struct message WmHotkeyPressALT []
 
static const struct message WmHotkeyPressWithALT []
 
static const struct message WmHotkeyReleaseWithALT []
 
static const struct message WmHotkeyReleaseALT []
 
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 const struct message WmLayeredWinEmptySeq []
 
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 send_message_5 []
 
static const struct message DoubleSetCaptureSeq []
 
static const struct message WmRestoreMinimizedSeq []
 
static LONG test_hook_cleanup_hook_proc_child_id
 
static DWORD test_hook_cleanup_hook_proc_thread_id
 
static DWORD test_hook_cleanup_hook_proc_call_thread_id
 

Macro Definition Documentation

◆ add_message

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

Definition at line 2438 of file msg.c.

◆ ARCH

#define ARCH   "none"

Definition at line 73 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 17107 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));
return ret
Definition: mutex.c:146
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
#define EM_GETSEL
Definition: winuser.h:2026
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELRESULT(l, h)
Definition: winuser.h:4118

◆ check_update_rgn

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

Definition at line 8312 of file msg.c.

◆ clear_clipboard

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

Definition at line 18225 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 13832 of file msg.c.

◆ EV_SENDMSG

#define EV_SENDMSG   1

Definition at line 13831 of file msg.c.

◆ EV_STOP

#define EV_STOP   0

Definition at line 13830 of file msg.c.

◆ expect

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

Definition at line 2971 of file msg.c.

◆ expect_HWND

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

Definition at line 18237 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

◆ ID_BUTTON

#define ID_BUTTON   0x000e

Definition at line 6455 of file msg.c.

◆ ID_COMBOBOX

#define ID_COMBOBOX   0x000f

Definition at line 7842 of file msg.c.

◆ ID_EDIT

#define ID_EDIT   0x1234

Definition at line 13277 of file msg.c.

◆ ID_LISTBOX

#define ID_LISTBOX   0x000f

Definition at line 16976 of file msg.c.

◆ ID_RADIO1

#define ID_RADIO1   501

Definition at line 7317 of file msg.c.

◆ ID_RADIO2

#define ID_RADIO2   502

Definition at line 7318 of file msg.c.

◆ ID_RADIO3

#define ID_RADIO3   503

Definition at line 7319 of file msg.c.

◆ ID_TEXT

#define ID_TEXT   504

Definition at line 7320 of file msg.c.

◆ MDI_FIRST_CHILD_ID

#define MDI_FIRST_CHILD_ID   2004

Definition at line 39 of file msg.c.

◆ ok_sequence

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

Definition at line 2798 of file msg.c.

◆ open_clipboard

#define open_clipboard (   hwnd)    open_clipboard_(__LINE__, hwnd)

Definition at line 18195 of file msg.c.

◆ run_in_temp_desktop

#define run_in_temp_desktop (   f)    run_in_temp_desktop_(__FILE__, __LINE__, #f, f)

Definition at line 9954 of file msg.c.

◆ set_selection

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

◆ STEP

#define STEP   5

Definition at line 14392 of file msg.c.

◆ subtest_swp_paint_regions

#define subtest_swp_paint_regions (   w,
  p,
  c 
)    subtest_swp_paint_regions_(__LINE__,w,p,c)

Definition at line 9277 of file msg.c.

◆ SW_NORMALNA

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

Definition at line 46 of file msg.c.

◆ SWP_NOCLIENTMOVE

#define SWP_NOCLIENTMOVE   0x1000

Definition at line 43 of file msg.c.

◆ SWP_NOCLIENTSIZE

#define SWP_NOCLIENTSIZE   0x0800

Definition at line 42 of file msg.c.

◆ SWP_STATECHANGED

#define SWP_STATECHANGED   0x8000

Definition at line 44 of file msg.c.

◆ TEST_MOUSEACTIVATE

#define TEST_MOUSEACTIVATE (   A,
  B,
  C 
)
Value:
ok(res == B, "WM_MOUSEACTIVATE for %s returned %Id\n", #A, res); \
ok(res == C, "WM_MOUSEACTIVATE for %s returned %Id\n", #A, res);
Definition: ehthrow.cxx:93
Definition: ehthrow.cxx:54
Definition: terminate.cpp:24
GLuint res
Definition: glext.h:9613
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_LBUTTONDOWN
Definition: winuser.h:1804
#define WM_MOUSEACTIVATE
Definition: winuser.h:1665

◆ test_msg_setpos

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

Definition at line 5539 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 7566 of file msg.c.

◆ TIMER_COUNT

#define TIMER_COUNT   500 /* 499 samples */

Definition at line 11667 of file msg.c.

◆ TIMER_DURATION_ALT

#define TIMER_DURATION_ALT   15600 /* 15.6 ms */

Definition at line 11669 of file msg.c.

◆ TIMER_DURATION_EXPECTED

#define TIMER_DURATION_EXPECTED   10000 /* 10 ms */

Definition at line 11668 of file msg.c.

◆ TIMER_DURATION_TOLERANCE

#define TIMER_DURATION_TOLERANCE   1000 /* 1 ms */

Definition at line 11670 of file msg.c.

◆ TIMER_ID

#define TIMER_ID   0x19

Definition at line 11666 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 %ld\n", GetLastError())
#define TME_HOVER
Definition: commctrl.h:4997
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ 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 %ld\n", GetLastError())
#define TME_CANCEL
Definition: commctrl.h:5001

◆ 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 %ld\n", GetLastError());\
ok(tme.cbSize == sizeof(tme), "wrong tme.cbSize %lu\n", tme.cbSize); \
ok(tme.dwFlags == (expected_track_flags), \
"wrong tme.dwFlags %08lx, 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 %lu, expected %u\n", tme.dwHoverTime, (expected_hover_time))
static HWND
Definition: msg.c:2343
#define TME_QUERY
Definition: commctrl.h:5000

◆ WM_KEYF1

#define WM_KEYF1   0x004d

Definition at line 49 of file msg.c.

◆ WM_LBTRACKPOINT

#define WM_LBTRACKPOINT   0x0131

Definition at line 61 of file msg.c.

◆ WM_SYSTIMER

#define WM_SYSTIMER   0x0118

Definition at line 53 of file msg.c.

◆ WND_CHILD_ID

#define WND_CHILD_ID   3

Definition at line 58 of file msg.c.

◆ WND_PARENT_ID

#define WND_PARENT_ID   1

Definition at line 56 of file msg.c.

◆ WND_POPUP_ID

#define WND_POPUP_ID   2

Definition at line 57 of file msg.c.

◆ WS_BASE

Enumeration Type Documentation

◆ msg_flags_t

Enumerator
sent 
posted 
parent 
wparam 
lparam 
defwinproc 
beginpaint 
optional 
hook 
winevent_hook 
kbd_hook 
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 
kbd_hook 
msg_todo 
wine_only 

Definition at line 146 of file msg.c.

146 {
147 sent=0x1,
148 posted=0x2,
149 parent=0x4,
150 wparam=0x8,
151 lparam=0x10,
152 defwinproc=0x20,
153 beginpaint=0x40,
154 optional=0x80,
155 hook=0x100,
156 winevent_hook=0x200,
157 kbd_hook=0x400,
158 msg_todo=0x800,
159 wine_only=0x1000
msg_flags_t
Definition: msg.c:146
@ sent
Definition: msg.c:147
@ beginpaint
Definition: msg.c:153
@ defwinproc
Definition: msg.c:152
@ kbd_hook
Definition: msg.c:157
@ msg_todo
Definition: msg.c:158
@ parent
Definition: msg.c:149
@ posted
Definition: msg.c:148
@ lparam
Definition: msg.c:151
@ wine_only
Definition: msg.c:159
@ hook
Definition: msg.c:155
@ winevent_hook
Definition: msg.c:156
@ wparam
Definition: msg.c:150
@ optional
Definition: msg.c:154

Function Documentation

◆ add_message_()

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

Definition at line 2439 of file msg.c.

2440{
2441 struct recvd_message *seq;
2442
2444 if (!sequence)
2445 {
2446 sequence_size = 10;
2447 sequence = malloc( sequence_size * sizeof(*sequence) );
2448 }
2450 {
2451 sequence_size *= 2;
2453 }
2454
2455 seq = &sequence[sequence_cnt++];
2456 seq->hwnd = msg->hwnd;
2457 seq->message = msg->message;
2458 seq->flags = msg->flags;
2459 seq->wParam = msg->wParam;
2460 seq->lParam = msg->lParam;
2461 seq->line = line;
2462 seq->descr = msg->descr;
2463 seq->output[0] = 0;
2465
2466 if (msg->descr)
2467 {
2468 if (msg->flags & hook)
2469 {
2470 static const char * const CBT_code_name[10] =
2471 {
2472 "HCBT_MOVESIZE",
2473 "HCBT_MINMAX",
2474 "HCBT_QS",
2475 "HCBT_CREATEWND",
2476 "HCBT_DESTROYWND",
2477 "HCBT_ACTIVATE",
2478 "HCBT_CLICKSKIPPED",
2479 "HCBT_KEYSKIPPED",
2480 "HCBT_SYSCOMMAND",
2481 "HCBT_SETFOCUS"
2482 };
2483 const char *code_name = (msg->message <= HCBT_SETFOCUS) ? CBT_code_name[msg->message] : "Unknown";
2484
2485 sprintf( seq->output, "%s: hook %d (%s) wp %08Ix lp %08Ix",
2486 msg->descr, msg->message, code_name, msg->wParam, msg->lParam );
2487 }
2488 else if (msg->flags & winevent_hook)
2489 {
2490 sprintf( seq->output, "%s: winevent %p %08x %08Ix %08Ix",
2491 msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
2492 }
2493 else
2494 {
2495 switch (msg->message)
2496 {
2499 {
2500 WINDOWPOS *winpos = (WINDOWPOS *)msg->lParam;
2501
2502 sprintf( seq->output, "%s: %p WM_WINDOWPOS%s wp %08Ix lp %08Ix after %p x %d y %d cx %d cy %d flags %s",
2503 msg->descr, msg->hwnd,
2504 (msg->message == WM_WINDOWPOSCHANGING) ? "CHANGING" : "CHANGED",
2505 msg->wParam, msg->lParam, winpos->hwndInsertAfter,
2506 winpos->x, winpos->y, winpos->cx, winpos->cy,
2507 get_winpos_flags(winpos->flags) );
2508
2509 /* Log only documented flags, win2k uses 0x1000 and 0x2000
2510 * in the high word for internal purposes
2511 */
2512 seq->wParam = winpos->flags & 0xffff;
2513 /* We are not interested in the flags that don't match under XP and Win9x */
2514 seq->wParam &= ~SWP_NOZORDER;
2515 seq->lParam = (!!winpos->cx) | ((!!winpos->cy) << 1)
2516 | ((!!winpos->x) << 2) | ((!!winpos->y) << 3);
2517 break;
2518 }
2519
2520 case WM_NCCALCSIZE:
2521 if (msg->wParam)
2522 {
2524 WINDOWPOS *winpos = p->lppos;
2525
2526 sprintf(seq->output, "%s: %p WM_NCCALCSIZE: winpos->cx %u, winpos->cy %u",
2527 msg->descr, msg->hwnd, winpos->cx, winpos->cy);
2528 seq->lParam = (!!winpos->cx) | ((!!winpos->cy) << 1)
2529 | ((!!winpos->x) << 2) | ((!!winpos->y) << 3);
2530 }
2531 else
2532 {
2533 RECT *rect = (RECT*)msg->lParam;
2534
2535 sprintf(seq->output, "%s: %p WM_NCCALCSIZE: %s",
2536 msg->descr, msg->hwnd, wine_dbgstr_rect(rect));
2537 seq->lParam = 0;
2538 }
2539 break;
2540 case WM_DRAWITEM:
2541 {
2543 DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)msg->lParam;
2544
2545 sprintf( seq->output, "%s: %p WM_DRAWITEM: type %x, ctl_id %x, item_id %x, action %x, state %x",
2546 msg->descr, msg->hwnd, dis->CtlType, dis->CtlID,
2547 dis->itemID, dis->itemAction, dis->itemState);
2548
2549 di.u.lp = 0;
2550 di.u.item.type = dis->CtlType;
2551 di.u.item.ctl_id = dis->CtlID;
2552 if (dis->CtlType == ODT_LISTBOX ||
2553 dis->CtlType == ODT_COMBOBOX ||
2554 dis->CtlType == ODT_MENU)
2555 di.u.item.item_id = dis->itemID;
2556 di.u.item.action = dis->itemAction;
2557 di.u.item.state = dis->itemState;
2558
2559 seq->lParam = di.u.lp;
2560 break;
2561 }
2562
2563 case WM_MEASUREITEM:
2564 {
2566 MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)msg->lParam;
2567 BOOL is_unicode_data = TRUE;
2568
2569 sprintf( seq->output, "%s: %p WM_MEASUREITEM: CtlType %#x, CtlID %#x, itemID %#x, itemData %#Ix",
2570 msg->descr, msg->hwnd, mis->CtlType, mis->CtlID,
2571 mis->itemID, mis->itemData);
2572
2573 if (mis->CtlType == ODT_LISTBOX)
2574 {
2575 HWND ctrl = GetDlgItem(msg->hwnd, mis->CtlID);
2576 is_unicode_data = GetWindowLongA(ctrl, GWL_STYLE) & LBS_HASSTRINGS;
2577 }
2578
2579 mi.u.wp = 0;
2580 mi.u.item.CtlType = mis->CtlType;
2581 mi.u.item.CtlID = mis->CtlID;
2582 mi.u.item.itemID = mis->itemID;
2583 mi.u.item.wParam = msg->wParam;
2584 seq->wParam = mi.u.wp;
2585 if (is_unicode_data)
2586 seq->lParam = mis->itemData ? hash_Ly_W((const WCHAR *)mis->itemData) : 0;
2587 else
2588 seq->lParam = mis->itemData ? hash_Ly((const char *)mis->itemData) : 0;
2589 break;
2590 }
2591
2592 case WM_COMPAREITEM:
2593 {
2594 COMPAREITEMSTRUCT *cis = (COMPAREITEMSTRUCT *)msg->lParam;
2595 HWND ctrl = GetDlgItem(msg->hwnd, cis->CtlID);
2596 BOOL is_unicode_data = TRUE;
2597
2598 ok(msg->wParam == cis->CtlID, "expected %#x, got %#Ix\n", cis->CtlID, msg->wParam);
2599 ok(cis->hwndItem == ctrl, "expected %p, got %p\n", ctrl, cis->hwndItem);
2600 ok((int)cis->itemID1 >= 0, "expected >= 0, got %d\n", cis->itemID1);
2601 ok((int)cis->itemID2 == -1, "expected -1, got %d\n", cis->itemID2);
2602
2603 sprintf( seq->output, "%s: %p WM_COMPAREITEM: CtlType %#x, CtlID %#x, itemID1 %#x, itemData1 %#Ix, itemID2 %#x, itemData2 %#Ix",
2604 msg->descr, msg->hwnd, cis->CtlType, cis->CtlID,
2605 cis->itemID1, cis->itemData1, cis->itemID2, cis->itemData2);
2606
2607 if (cis->CtlType == ODT_LISTBOX)
2608 is_unicode_data = GetWindowLongA(ctrl, GWL_STYLE) & LBS_HASSTRINGS;
2609
2610 if (is_unicode_data)
2611 {
2612 seq->wParam = cis->itemData1 ? hash_Ly_W((const WCHAR *)cis->itemData1) : 0;
2613 seq->lParam = cis->itemData2 ? hash_Ly_W((const WCHAR *)cis->itemData2) : 0;
2614 }
2615 else
2616 {
2617 seq->wParam = cis->itemData1 ? hash_Ly((const char *)cis->itemData1) : 0;
2618 seq->lParam = cis->itemData2 ? hash_Ly((const char *)cis->itemData2) : 0;
2619 }
2620 break;
2621 }
2622
2623 default:
2624 if (msg->message >= 0xc000) return; /* ignore registered messages */
2625 sprintf( seq->output, "%s: %p %04x wp %08Ix lp %08Ix",
2626 msg->descr, msg->hwnd, msg->message, msg->wParam, msg->lParam );
2627 }
2628 if (msg->flags & (sent|posted|parent|defwinproc|beginpaint))
2629 sprintf( seq->output + strlen(seq->output), " (flags %x)", msg->flags );
2630 }
2631 }
2632}
#define ok(value,...)
Definition: atltest.h:57
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define msg(x)
Definition: auth_time.c:54
#define realloc
Definition: debug_ros.c:6
#define malloc
Definition: debug_ros.c:4
#define TRUE
Definition: types.h:120
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
unsigned int BOOL
Definition: ntddk_ex.h:94
#define sprintf
Definition: sprintf.c:45
#define ctrl
Definition: input.c:3272
static CRITICAL_SECTION sequence_cs
Definition: msg.c:2340
static int sequence_size
Definition: msg.c:2337
static struct recvd_message * sequence
Definition: msg.c:2338
static int sequence_cnt
Definition: msg.c:2337
static unsigned hash_Ly(const char *str)
Definition: msg.c:2428
static unsigned hash_Ly_W(const WCHAR *str)
Definition: msg.c:2418
static const char * get_winpos_flags(UINT flags)
Definition: msg.c:2379
static MONITORINFO mi
Definition: win.c:9400
#define LBS_HASSTRINGS
Definition: pedump.c:684
& rect
Definition: startmenu.cpp:1413
struct DRAW_ITEM_STRUCT::@1865::@1866 item
union DRAW_ITEM_STRUCT::@1865 u
LPARAM lp
Definition: msg.c:95
UINT flags
Definition: winuser.h:3702
HWND hwndInsertAfter
Definition: winuser.h:3697
WPARAM wParam
Definition: SystemMenu.c:55
const char * descr
Definition: SystemMenu.c:58
char output[512]
Definition: SystemMenu.c:59
msg_flags_t flags
Definition: SystemMenu.c:53
LPARAM lParam
Definition: SystemMenu.c:56
ULONG_PTR itemData1
Definition: winuser.h:3102
ULONG_PTR itemData2
Definition: winuser.h:3104
ULONG_PTR itemData
Definition: winuser.h:3754
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define ODT_COMBOBOX
Definition: winuser.h:2575
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1689
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_DRAWITEM
Definition: winuser.h:1673
#define HCBT_SETFOCUS
Definition: winuser.h:64
#define WM_MEASUREITEM
Definition: winuser.h:1674
#define WM_COMPAREITEM
Definition: winuser.h:1683
#define WM_NCCALCSIZE
Definition: winuser.h:1713
#define GWL_STYLE
Definition: winuser.h:863
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1690
#define ODT_MENU
Definition: winuser.h:2573
#define ODT_LISTBOX
Definition: winuser.h:2574
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ apc_test_proc()

static void CALLBACK apc_test_proc ( ULONG_PTR  param)
static

Definition at line 5398 of file msg.c.

5399{
5400 /* nothing */
5401}

Referenced by test_MsgWaitForMultipleObjects().

◆ BOOL()

static BOOL ( WINAPI pTrackMouseEvent)
static

◆ broadcast_test_proc()

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

Definition at line 18455 of file msg.c.

18456{
18458
18459 if (message == g_broadcast_msg)
18461
18462 return CallWindowProcA(oldproc, hwnd, message, wParam, lParam);
18463}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static WPARAM g_broadcast_wparam
Definition: msg.c:18453
static UINT g_broadcast_msg
Definition: msg.c:18454
Definition: tftpd.h:60
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtrA
Definition: winuser.h:4982
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:3014
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by test_broadcast().

◆ broadcast_test_sub_proc()

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

Definition at line 18466 of file msg.c.

18467{
18468 int sub_index = GetWindowLongPtrA(hwnd, GWLP_USERDATA);
18469
18470 if (message == g_broadcast_msg)
18471 g_broadcast_sub_wparam[sub_index] = wParam;
18472
18473 return CallWindowProcA(g_oldproc_sub[sub_index], hwnd, message, wParam, lParam);
18474}
static WNDPROC * g_oldproc_sub
Definition: msg.c:18464
static WPARAM * g_broadcast_sub_wparam
Definition: msg.c:18465

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 6801 of file msg.c.

6802{
6803 static LONG defwndproc_counter = 0;
6804 LRESULT ret;
6805 struct recvd_message msg;
6806
6807 if (ignore_message( message )) return 0;
6808
6809 switch (message)
6810 {
6811 case WM_SYNCPAINT:
6812 break;
6813 case BM_SETSTATE:
6814 if (GetCapture())
6815 ok(GetCapture() == hwnd, "GetCapture() = %p\n", GetCapture());
6816
6818 goto log_it;
6819
6820 case WM_GETDLGCODE:
6821 if (lParam)
6822 {
6823 MSG *msg = (MSG *)lParam;
6824 lParam = MAKELPARAM(msg->message, msg->wParam);
6825 }
6827 goto log_it;
6828
6829 case BM_SETCHECK:
6830 case BM_GETCHECK:
6832 /* fall through */
6833log_it:
6834 default:
6835 msg.hwnd = hwnd;
6836 msg.message = message;
6837 msg.flags = sent|wparam|lparam;
6838 if (defwndproc_counter) msg.flags |= defwinproc;
6839 msg.wParam = wParam;
6840 msg.lParam = lParam;
6841 msg.descr = "button";
6842 add_message(&msg);
6843 }
6844
6845 defwndproc_counter++;
6847 defwndproc_counter--;
6848
6849 return ret;
6850}
#define ULONG_PTR
Definition: config.h:101
LONG_PTR LRESULT
Definition: minwindef.h:176
#define add_message(msg)
Definition: msg.c:2438
static BOOL ignore_message(UINT message)
Definition: msg.c:2405
static WNDPROC old_button_proc
Definition: msg.c:6799
long LONG
Definition: pedump.c:60
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
#define WM_SYNCPAINT
Definition: winuser.h:1718
#define BM_SETSTATE
Definition: winuser.h:1952
HWND WINAPI GetCapture(void)
Definition: message.c:2881
#define BM_SETCHECK
Definition: winuser.h:1950
#define WM_GETDLGCODE
Definition: winuser.h:1717
HMENU WINAPI GetMenu(_In_ HWND)
#define BM_GETCHECK
Definition: winuser.h:1947

Referenced by subclass_button().

◆ call_window_proc_hook()

static LRESULT WINAPI call_window_proc_hook ( INT  code,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 20674 of file msg.c.

20675{
20676 CWPSTRUCT *cwp = (CWPSTRUCT *)lparam;
20677
20678 ok( cwp->message == WM_USER, "message = %u\n", cwp->message );
20680 return CallNextHookEx( NULL, code, wparam, lparam );
20681}
#define NULL
Definition: types.h:112
static LRESULT WINAPI changed_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: msg.c:20668
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
Definition: inflate.c:139
UINT message
Definition: winuser.h:3135
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
#define WM_USER
Definition: winuser.h:1923
#define SetWindowLongPtrW
Definition: winuser.h:5512

Referenced by test_hook_changing_window_proc().

◆ callback_count()

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

Definition at line 11718 of file msg.c.

11719{
11720 timer_fired();
11721}
static void timer_fired(void)
Definition: msg.c:11684

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 11724 of file msg.c.

11725{
11726 timer_fired();
11728}
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700

Referenced by test_timers_exception().

◆ can_skip_message()

static BOOL can_skip_message ( const struct message expected)
static

Definition at line 2666 of file msg.c.

2667{
2668 if (expected->flags & optional) return TRUE;
2669
2670 if ((expected->flags & winevent_hook) && !hEvent_hook) return TRUE;
2671 if ((expected->flags & kbd_hook) && !hKBD_hook) return TRUE;
2672 if ((expected->flags & hook) && !hCBT_hook) return TRUE;
2673
2674 if ((expected->flags & msg_todo) && !strcmp(winetest_platform, "wine")) return TRUE;
2675
2676 if ((expected->flags & wine_only) && strcmp(winetest_platform, "wine")) return TRUE;
2677
2678 return FALSE;
2679}
#define FALSE
Definition: types.h:117
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
const char * winetest_platform
BOOL expected
Definition: store.c:2000
static HWINEVENTHOOK hEvent_hook
Definition: msg.c:118
static HHOOK hKBD_hook
Definition: msg.c:119
static HHOOK hCBT_hook
Definition: msg.c:120

Referenced by dump_sequence(), messages_equal(), and ok_sequence_().

◆ cancel_init_proc()

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

Definition at line 20041 of file msg.c.

20042{
20043 if (ignore_message( message )) return 0;
20044
20045 switch (message) {
20046 case WM_ENTERMENULOOP:
20047 ok(EndMenu() == TRUE, "EndMenu() failed\n");
20048 break;
20049 }
20050
20052}
static LRESULT MsgCheckProc(BOOL unicode, HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:10849
BOOL WINAPI EndMenu(void)
#define WM_ENTERMENULOOP
Definition: winuser.h:1832

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 20019 of file msg.c.

20020{
20021 if (ignore_message( message )) return 0;
20022
20023 switch (message) {
20024 case WM_ENTERIDLE:
20025 todo_wine ok(GetCapture() == hwnd, "expected %p, got %p\n", hwnd, GetCapture());
20026 EndMenu();
20027 break;
20028 case WM_INITMENU:
20029 case WM_INITMENUPOPUP:
20030 case WM_UNINITMENUPOPUP:
20031 ok((HMENU)wParam == hpopupmenu, "expected %p, got %Ix\n", hpopupmenu, wParam);
20032 break;
20033 case WM_CAPTURECHANGED:
20034 todo_wine ok(!lParam || (HWND)lParam == hwnd, "lost capture to %Ix\n", lParam);
20035 break;
20036 }
20037
20039}
#define todo_wine
Definition: minitest.h:80
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:19998
#define WM_CAPTURECHANGED
Definition: winuser.h:1836
#define WM_INITMENU
Definition: winuser.h:1773
#define WM_INITMENUPOPUP
Definition: winuser.h:1774
#define WM_ENTERIDLE
Definition: winuser.h:1777

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 12018 of file msg.c.

12019{
12020 HWND hwnd;
12021 char buf[256];
12022
12023 if (nCode == HCBT_SYSCOMMAND)
12024 {
12025 struct recvd_message msg;
12026
12027 msg.hwnd = 0;
12028 msg.message = nCode;
12029 msg.flags = hook|wparam|lparam;
12030 msg.wParam = wParam;
12031 msg.lParam = (cbt_global_hook_thread_id == GetCurrentThreadId()) ? 1 : 2;
12032 msg.descr = "CBT_2";
12033 add_message(&msg);
12034
12036 }
12037 /* WH_MOUSE_LL hook */
12038 if (nCode == HC_ACTION)
12039 {
12041
12042 /* we can't test for real mouse events */
12043 if (mhll->flags & LLMHF_INJECTED)
12044 {
12045 struct recvd_message msg;
12046
12047 memset (&msg, 0, sizeof (msg));
12048 msg.message = wParam;
12049 msg.flags = hook;
12050 msg.descr = "CBT_2";
12051 add_message(&msg);
12052 }
12054 }
12055
12056 /* Log also SetFocus(0) calls */
12057 hwnd = wParam ? (HWND)wParam : (HWND)lParam;
12058
12059 if (GetClassNameA(hwnd, buf, sizeof(buf)))
12060 {
12061 if (!lstrcmpiA(buf, "TestWindowClass") ||
12062 !lstrcmpiA(buf, "static"))
12063 {
12064 struct recvd_message msg;
12065
12066 msg.hwnd = hwnd;
12067 msg.message = nCode;
12068 msg.flags = hook|wparam|lparam;
12069 msg.wParam = wParam;
12070 msg.lParam = (cbt_global_hook_thread_id == GetCurrentThreadId()) ? 1 : 2;
12071 msg.descr = "CBT_2";
12072 add_message(&msg);
12073 }
12074 }
12076}
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4133
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static HHOOK hCBT_global_hook
Definition: msg.c:12015
static DWORD cbt_global_hook_thread_id
Definition: msg.c:12016
#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:2691
#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 12105 of file msg.c.

12106{
12107 HWND hwnd;
12108 MSG msg;
12109 HANDLE hevent = *(HANDLE *)param;
12110
12112 /* these events should be received only by our new hook proc,
12113 * an old one does not expect an event from another thread.
12114 */
12115
12116 hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0,0,0,0,0,0,0, NULL);
12117 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
12118 if (winetest_debug > 1) trace("created thread window %p\n", hwnd);
12119
12120 *(HWND *)param = hwnd;
12121
12122 /* Windows doesn't like when a thread plays games with the focus,
12123 that leads to all kinds of misbehaviours and failures to activate
12124 a window. So, better keep next lines commented out.
12125 SetFocus(0);
12126 SetFocus(hwnd);*/
12127
12130
12132
12133 while (GetMessageA(&msg, 0, 0, 0))
12134 {
12137 }
12138 return 0;
12139}
#define trace
Definition: atltest.h:70
static HANDLE hevent
Definition: broadcast.c:34
GLfloat param
Definition: glext.h:5796
int winetest_debug
static void flush_sequence(void)
Definition: msg.c:2650
#define WS_POPUP
Definition: pedump.c:616
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:669
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
#define WM_SYSCOMMAND
Definition: winuser.h:1769
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)
#define SC_PREVWINDOW
Definition: winuser.h:2627
#define SC_NEXTWINDOW
Definition: winuser.h:2626
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 11373 of file msg.c.

11374{
11375 HWND hwnd;
11376
11377 ok(cbt_hook_thread_id == GetCurrentThreadId(), "we didn't ask for events from other threads\n");
11378
11379 if (nCode == HCBT_CLICKSKIPPED)
11380 {
11381 /* ignore this event, XP sends it a lot when switching focus between windows */
11382 return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
11383 }
11384
11385 if (nCode == HCBT_SYSCOMMAND || nCode == HCBT_KEYSKIPPED)
11386 {
11387 struct recvd_message msg;
11388
11389 msg.hwnd = 0;
11390 msg.message = nCode;
11391 msg.flags = hook|wparam|lparam;
11392 msg.wParam = wParam;
11393 msg.lParam = lParam;
11394 msg.descr = "CBT";
11395 add_message(&msg);
11396
11397 return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
11398 }
11399
11400 if (nCode == HCBT_DESTROYWND)
11401 {
11403 {
11405 if (style & WS_CHILD)
11407 else if (style & WS_POPUP)
11409 else
11411 }
11412 }
11413
11414 /* Log also SetFocus(0) calls */
11415 hwnd = wParam ? (HWND)wParam : (HWND)lParam;
11416
11418 {
11419 struct recvd_message msg;
11420
11421 msg.hwnd = hwnd;
11422 msg.message = nCode;
11423 msg.flags = hook|wparam|lparam;
11424 msg.wParam = wParam;
11425 msg.lParam = lParam;
11426 msg.descr = "CBT";
11427 add_message(&msg);
11428 }
11429 return CallNextHookEx(hCBT_hook, nCode, wParam, lParam);
11430}
Arabic default style
Definition: afstyles.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WND_PARENT_ID
Definition: msg.c:56
#define WND_POPUP_ID
Definition: msg.c:57
static DWORD cbt_hook_thread_id
Definition: msg.c:121
static BOOL is_our_logged_class(HWND hwnd)
Definition: msg.c:11345
static BOOL test_DestroyWindow_flag
Definition: msg.c:115
#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:871
#define HCBT_KEYSKIPPED
Definition: winuser.h:62

Referenced by START_TEST(), and test_set_hook().

◆ changed_window_proc()

static LRESULT WINAPI changed_window_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 20668 of file msg.c.

20669{
20670 if (msg == WM_USER) return 3;
20671 return DefWindowProcW( hwnd, msg, wparam, lparam );
20672}
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by call_window_proc_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 17146 of file msg.c.

17148{
17149 LRESULT ret;
17150
17151 /* calling an orig proc helps to avoid unnecessary message logging */
17152 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCOUNT, 0, 0);
17153 ok_(__FILE__, line)(ret == count, "expected count %d, got %Id\n", count, ret);
17154 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCURSEL, 0, 0);
17155 ok_(__FILE__, line)(ret == cur_sel, "expected cur sel %d, got %Id\n", cur_sel, ret);
17156 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETCARETINDEX, 0, 0);
17157 ok_(__FILE__, line)(ret == caret_index ||
17158 broken(cur_sel == -1 && caret_index == 0 && ret == -1), /* nt4 */
17159 "expected caret index %d, got %Id\n", caret_index, ret);
17160 ret = CallWindowProcA(listbox_orig_proc, listbox, LB_GETTOPINDEX, 0, 0);
17161 ok_(__FILE__, line)(ret == top_index, "expected top index %d, got %Id\n", top_index, ret);
17162}
#define ok_(x1, x2)
Definition: atltest.h:61
GLuint GLuint GLsizei count
Definition: gl.h:1545
DWORD broken
Definition: msg.c:18625
Definition: parser.c:49
#define LB_GETCOUNT
Definition: winuser.h:2067
#define LB_GETTOPINDEX
Definition: winuser.h:2087
#define LB_GETCARETINDEX
Definition: winuser.h:2066
#define LB_GETCURSEL
Definition: winuser.h:2068

◆ check_update_rgn_()

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

Definition at line 8313 of file msg.c.

8314{
8315 INT ret;
8316 RECT r1, r2;
8317 HRGN tmp = CreateRectRgn( 0, 0, 0, 0 );
8318 HRGN update = CreateRectRgn( 0, 0, 0, 0 );
8319
8320 ret = GetUpdateRgn( hwnd, update, FALSE );
8321 ok( ret != ERROR, "GetUpdateRgn failed\n" );
8322 if (ret == NULLREGION)
8323 {
8324 ok_(__FILE__,line)( !hrgn, "Update region shouldn't be empty\n" );
8325 }
8326 else
8327 {
8328 if (CombineRgn( tmp, hrgn, update, RGN_XOR ) != NULLREGION)
8329 {
8330 ok_(__FILE__,line)( 0, "Regions are different\n" );
8331 if (winetest_debug > 0)
8332 {
8333 printf( "Update region: " );
8334 dump_region( update );
8335 printf( "Wanted region: " );
8336 dump_region( hrgn );
8337 }
8338 }
8339 }
8340 GetRgnBox( update, &r1 );
8341 GetUpdateRect( hwnd, &r2, FALSE );
8342 ok_(__FILE__,line)( EqualRect( &r1, &r2 ), "Rectangles are different: %s / %s\n",
8344
8345 DeleteObject( tmp );
8346 DeleteObject( update );
8347}
static HRGN hrgn
#define ERROR(name)
Definition: error_private.h:53
#define printf
Definition: freeldr.h:104
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:8291
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)

◆ clear_clipboard_()

static void clear_clipboard_ ( int  line,
HWND  hWnd 
)
static

Definition at line 18226 of file msg.c.

18227{
18228 BOOL succ;
18229 succ = open_clipboard_(line, hWnd);
18230 ok_(__FILE__, line)(succ, "OpenClipboard failed, err=%lu\n", GetLastError());
18231 succ = EmptyClipboard();
18232 ok_(__FILE__, line)(succ, "EmptyClipboard failed, err=%lu\n", GetLastError());
18233 succ = CloseClipboard();
18234 ok_(__FILE__, line)(succ, "CloseClipboard failed, err=%lu\n", GetLastError());
18235}
HWND hWnd
Definition: settings.c:17
static BOOL open_clipboard_(int line, HWND hwnd)
Definition: msg.c:18196
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
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 7965 of file msg.c.

7967{
7968 static LONG defwndproc_counter = 0;
7969 LRESULT ret;
7970 struct recvd_message msg;
7971
7972 /* do not log painting messages */
7973 if (message != WM_PAINT &&
7974 message != WM_NCPAINT &&
7975 message != WM_SYNCPAINT &&
7977 message != WM_NCHITTEST &&
7978 message != WM_GETTEXT &&
7980 {
7981 msg.hwnd = hwnd;
7982 msg.message = message;
7983 msg.flags = sent|wparam|lparam;
7984 if (defwndproc_counter) msg.flags |= defwinproc;
7985 msg.wParam = wParam;
7986 msg.lParam = lParam;
7987 msg.descr = "combo edit";
7988 add_message(&msg);
7989 }
7990
7991 defwndproc_counter++;
7993 defwndproc_counter--;
7994
7995 return ret;
7996}
static WNDPROC edit_window_proc
Definition: msg.c:7963
#define WM_PAINT
Definition: winuser.h:1648
#define WM_ERASEBKGND
Definition: winuser.h:1653
#define WM_NCHITTEST
Definition: winuser.h:1714
#define WM_GETTEXT
Definition: winuser.h:1646
#define WM_NCPAINT
Definition: winuser.h:1715

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 8030 of file msg.c.

8031{
8032 static LONG defwndproc_counter = 0;
8033 LRESULT ret;
8034 struct recvd_message msg;
8035
8036 /* do not log painting messages */
8037 if (message != WM_PAINT &&
8038 message != WM_NCPAINT &&
8039 message != WM_SYNCPAINT &&
8041 message != WM_NCHITTEST &&
8042 message != WM_GETTEXT &&
8044 {
8045 msg.hwnd = hwnd;
8046 msg.message = message;
8047 msg.flags = sent|wparam|lparam;
8048 if (defwndproc_counter) msg.flags |= defwinproc;
8049 msg.wParam = wParam;
8050 msg.lParam = lParam;
8051 msg.descr = "combo";
8052 add_message(&msg);
8053 }
8054
8055 defwndproc_counter++;
8057 defwndproc_counter--;
8058
8059 return ret;
8060}
static WNDPROC old_combobox_proc
Definition: msg.c:7963

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 7998 of file msg.c.

8000{
8001 static LONG defwndproc_counter = 0;
8002 LRESULT ret;
8003 struct recvd_message msg;
8004
8005 /* do not log painting messages */
8006 if (message != WM_PAINT &&
8007 message != WM_NCPAINT &&
8008 message != WM_SYNCPAINT &&
8010 message != WM_NCHITTEST &&
8012 {
8013 msg.hwnd = hwnd;
8014 msg.message = message;
8015 msg.flags = sent|wparam|lparam;
8016 if (defwndproc_counter) msg.flags |= defwinproc;
8017 msg.wParam = wParam;
8018 msg.lParam = lParam;
8019 msg.descr = "combo lbox";
8020 add_message(&msg);
8021 }
8022
8023 defwndproc_counter++;
8025 defwndproc_counter--;
8026
8027 return ret;
8028}
static WNDPROC lbox_window_proc
Definition: msg.c:7963

Referenced by test_combobox_messages().

◆ compare_ulonglong()

static int compare_ulonglong ( const void a,
const void b 
)
static

Definition at line 11676 of file msg.c.

11677{
11678 ULONGLONG la, lb;
11679 la = *(ULONGLONG*)a;
11680 lb = *(ULONGLONG*)b;
11681 return (la > lb) - (la < lb);
11682}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by timer_fired().

◆ create_child_thread()

static DWORD CALLBACK create_child_thread ( void param)
static

Definition at line 10029 of file msg.c.

10030{
10031 struct wnd_event *wnd_event = param;
10032 struct wnd_event child_event;
10033 DWORD ret, tid;
10034 MSG msg;
10035
10036 child_event.hwnd = CreateWindowExA(0, "TestWindowClass", "Test child",
10037 WS_CHILD | WS_VISIBLE, 0, 0, 10, 10, wnd_event->hwnd, 0, 0, NULL);
10038 ok (child_event.hwnd != 0, "Failed to create child window\n");
10039 SetFocus( child_event.hwnd );
10040 flush_events();
10042 child_event.start_event = wnd_event->start_event;
10044 for (;;)
10045 {
10046 DWORD ret = MsgWaitForMultipleObjects(1, &child_event.start_event, FALSE, 1000, QS_SENDMESSAGE);
10047 if (ret != 1) break;
10048 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
10049 }
10051 ok( !ret, "WaitForSingleObject failed %lx\n", ret );
10052 return 0;
10053}
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:2635
static DWORD CALLBACK create_grand_child_thread(void *param)
Definition: msg.c:10007
#define WS_VISIBLE
Definition: pedump.c:620
HANDLE grand_child
Definition: msg.c:9979
HWND hwnd
Definition: input.c:4588
HANDLE stop_event
Definition: msg.c:9981
HANDLE start_event
Definition: input.c:4590
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define QS_SENDMESSAGE
Definition: winuser.h:891
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:1207
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 10007 of file msg.c.

10008{
10009 struct wnd_event *wnd_event = param;
10010 HWND hchild;
10011 MSG msg;
10012
10013 hchild = CreateWindowExA(0, "TestWindowClass", "Test child",
10014 WS_CHILD | WS_VISIBLE, 0, 0, 10, 10, wnd_event->hwnd, 0, 0, NULL);
10015 ok (hchild != 0, "Failed to create child window\n");
10016 flush_events();
10019
10020 for (;;)
10021 {
10023 if (!IsWindow( hchild )) break; /* will be destroyed when parent thread exits */
10024 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
10025 }
10026 return 0;
10027}
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define QS_ALLINPUT
Definition: winuser.h:914

Referenced by create_child_thread().

◆ create_manifest_file()

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

Definition at line 10071 of file msg.c.

10072{
10074 HANDLE file;
10075 DWORD size;
10076
10079 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %lu\n", GetLastError());
10082}
#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:41

Referenced by test_interthread_messages().

◆ DispatchMessageCheckProc()

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

Definition at line 13058 of file msg.c.

13059{
13060 if (message == WM_PAINT) return 0;
13061 return MsgCheckProcA( hwnd, message, wParam, lParam );
13062}
static LRESULT WINAPI MsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11003

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 15756 of file msg.c.

15757{
15758 struct recvd_message msg;
15759
15760 if (ignore_message( message )) return 0;
15761
15762 msg.hwnd = hwnd;
15763 msg.message = message;
15764 msg.flags = sent|wparam|lparam;
15765 msg.wParam = wp;
15766 msg.lParam = lp;
15767 msg.descr = "edit";
15768 add_message(&msg);
15769
15770 return CallWindowProcW(orig_edit_proc, hwnd, message, wp, lp);
15771}
static WNDPROC orig_edit_proc
Definition: msg.c:15755
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 18662 of file msg.c.

18663{
18664 WNDCLASSA cls;
18665 MSG msg;
18666 HWND hwnd = 0;
18667 HANDLE thread;
18668 DWORD id;
18669 HANDLE start_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_start" );
18670 HANDLE end_event = OpenEventA( EVENT_ALL_ACCESS, FALSE, "test_WaitForInputIdle_end" );
18671
18672 memset( &cls, 0, sizeof(cls) );
18674 cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
18676 cls.lpszClassName = "TestClass";
18677 register_class(&cls);
18678
18679 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* create the msg queue */
18680
18681 ok( start_event != 0, "failed to create start event, error %lu\n", GetLastError() );
18682 ok( end_event != 0, "failed to create end event, error %lu\n", GetLastError() );
18683
18684 switch (arg)
18685 {
18686 case 0:
18688 break;
18689 case 1:
18691 Sleep( 200 );
18692 PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
18693 break;
18694 case 2:
18696 Sleep( 200 );
18697 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
18698 PostThreadMessageA( GetCurrentThreadId(), WM_COMMAND, 0x1234, 0xabcd );
18699 PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
18700 break;
18701 case 3:
18703 Sleep( 200 );
18705 break;
18706 case 4:
18708 Sleep( 200 );
18709 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
18710 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
18711 break;
18712 case 5:
18714 Sleep( 200 );
18715 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
18716 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
18717 break;
18718 case 6:
18720 Sleep( 200 );
18721 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
18722 while (PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ))
18723 {
18724 GetMessageA( &msg, 0, 0, 0 );
18726 }
18727 break;
18728 case 7:
18730 Sleep( 200 );
18731 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
18732 SetTimer( hwnd, 3, 1, NULL );
18733 Sleep( 200 );
18734 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE|PM_NOYIELD )) DispatchMessageA( &msg );
18735 break;
18736 case 8:
18738 Sleep( 200 );
18739 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
18741 break;
18742 case 9:
18744 Sleep( 200 );
18745 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
18746 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
18747 for (;;) GetMessageA( &msg, 0, 0, 0 );
18748 break;
18749 case 10:
18751 Sleep( 200 );
18752 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP|WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL);
18753 SetTimer( hwnd, 3, 1, NULL );
18754 Sleep( 200 );
18755 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
18756 break;
18757 case 11:
18759 Sleep( 200 );
18760 return; /* exiting the process makes WaitForInputIdle return success too */
18761 case 12:
18762 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
18763 Sleep( 200 );
18766 break;
18767 case 13:
18769 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
18770 Sleep( 200 );
18772 WaitForSingleObject( thread, 10000 );
18774 break;
18775 case 14:
18777 Sleep( 200 );
18779 break;
18780 case 15:
18782 Sleep( 200 );
18784 break;
18785 case 16:
18787 Sleep( 200 );
18789 break;
18790 case 17:
18792 Sleep( 200 );
18793 PeekMessageA( &msg, (HWND)0xdeadbeef, 0, 0, PM_NOREMOVE );
18794 break;
18795 case 18:
18797 Sleep( 200 );
18799 break;
18800 case 19:
18802 Sleep( 200 );
18804 break;
18805 case 20:
18807 Sleep( 200 );
18809 break;
18810 }
18811 WaitForSingleObject( end_event, 2000 );
18813 CloseHandle( end_event );
18814 if (hwnd) DestroyWindow( hwnd );
18815}
static HANDLE thread
Definition: service.c:33
GLuint id
Definition: glext.h:5910
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
static ATOM register_class(void)
Definition: atl_ax.c:49
static HANDLE start_event
Definition: thread.c:136
static DWORD CALLBACK do_wait_idle_child_thread(void *arg)
Definition: msg.c:18652
HBRUSH hbrBackground
Definition: winuser.h:3278
HCURSOR hCursor
Definition: winuser.h:3277
LPCSTR lpszClassName
Definition: winuser.h:3280
WNDPROC lpfnWndProc
Definition: winuser.h:3272
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:726
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
Definition: synch.c:605
#define HWND_MESSAGE
Definition: winuser.h:1221
#define COLOR_WINDOW
Definition: winuser.h:929
#define HWND_TOPMOST
Definition: winuser.h:1219
#define HWND_BROADCAST
Definition: winuser.h:1215
#define WM_COMMAND
Definition: winuser.h:1768
#define WM_WININICHANGE
Definition: winuser.h:1658
#define IDC_ARROW
Definition: winuser.h:695
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define PM_NOYIELD
Definition: winuser.h:1208
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define HWND_NOTOPMOST
Definition: winuser.h:1217
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_NOREMOVE
Definition: winuser.h:1206
#define HWND_BOTTOM
Definition: winuser.h:1216
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2459
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 18652 of file msg.c.

18653{
18654 MSG msg;
18655
18656 PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
18657 Sleep( 200 );
18659 return 0;
18660}

Referenced by do_wait_idle_child().

◆ dump_region()

void dump_region ( HRGN  hrgn)

Definition at line 8291 of file msg.c.

8292{
8293 DWORD i, size;
8294 RGNDATA *data = NULL;
8295 RECT *rect;
8296
8297 if (!hrgn)
8298 {
8299 printf( "null region\n" );
8300 return;
8301 }
8302 if (!(size = GetRegionData( hrgn, 0, NULL ))) return;
8303 if (!(data = malloc( size ))) return;
8305 printf("%ld rects:", data->rdh.nCount );
8306 for (i = 0, rect = (RECT *)data->Buffer; i < data->rdh.nCount; i++, rect++)
8307 printf( " %s", wine_dbgstr_rect( rect ));
8308 printf("\n");
8309 free( data );
8310}
#define free
Definition: debug_ros.c:5
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
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)

Referenced by check_update_rgn_(), subtest_hvredraw(), subtest_swp_paint_regions_(), test_scrolldc(), test_scrollvalidate(), test_swp_paint_region_on_extend_zerosize(), and test_swp_paint_region_on_show().

◆ dump_sequence()

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

Definition at line 2745 of file msg.c.

2746{
2747 const struct recvd_message *actual = sequence;
2748 unsigned int count = 0;
2749
2750 trace_(file, line)("Failed sequence %s:\n", context );
2751 while (expected->message && actual->message)
2752 {
2753 if (actual->output[0])
2754 {
2755 trace_(file, line)( " %u: expected: %s %04x - actual: %s\n",
2756 count, message_type_name(expected->flags), expected->message, actual->output );
2757 }
2758
2759 if (messages_equal(expected, actual, FALSE, file, line))
2760 {
2761 expected++;
2762 actual++;
2763 count++;
2764 }
2766 {
2767 expected++;
2768 count++;
2769 }
2770 else
2771 {
2772 actual++;
2773 }
2774 }
2775
2776 /* optional trailing messages */
2777 while (can_skip_message(expected))
2778 {
2779 trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
2780 expected++;
2781 count++;
2782 }
2783
2784 if (expected->message)
2785 {
2786 trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
2787 return;
2788 }
2789
2790 while (actual->message && actual->output[0])
2791 {
2792 trace_(file, line)( " %u: expected: nothing - actual: %s\n", count, actual->output );
2793 actual++;
2794 count++;
2795 }
2796}
#define trace_(file, line,...)
Definition: kmt_test.h:226
static BOOL sequence_contains_message(const struct message *expected, const struct recvd_message *actual)
Definition: msg.c:2734
static BOOL messages_equal(const struct message *expected, const struct recvd_message *actual, BOOL expect_equal, const char *file, int line)
Definition: msg.c:2681
static const char * message_type_name(int flags)
Definition: msg.c:2659
static BOOL can_skip_message(const struct message *expected)
Definition: msg.c:2666
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 13405 of file msg.c.

13406{
13407 static LONG defwndproc_counter = 0;
13408 LRESULT ret;
13409 struct recvd_message msg;
13410
13411 if (ignore_message( message )) return 0;
13412
13413 msg.hwnd = hwnd;
13414 msg.message = message;
13415 msg.flags = sent|wparam|lparam;
13416 if (defwndproc_counter) msg.flags |= defwinproc;
13417 msg.wParam = wParam;
13418 msg.lParam = lParam;
13419 msg.descr = "edit";
13420 add_message(&msg);
13421
13422 defwndproc_counter++;
13424 defwndproc_counter--;
13425
13426 return ret;
13427}
static WNDPROC old_edit_proc
Definition: msg.c:13403

Referenced by subclass_edit().

◆ edit_ime_subclass_proc()

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

Definition at line 13482 of file msg.c.

13483{
13485 static LONG defwndproc_counter = 0;
13486 struct recvd_message msg = {0};
13487 LRESULT ret;
13488
13489 msg.message = message;
13490 msg.flags = sent | wparam;
13491 if (defwndproc_counter)
13492 msg.flags |= defwinproc;
13493 msg.wParam = wParam;
13494
13495 if (message < 0xc000 &&
13497 message != WM_GETTEXT &&
13498 message != WM_GETFONT &&
13499 message != WM_GETICON &&
13503 message != WM_PAINT &&
13505 message != WM_NCHITTEST &&
13506 message != WM_SETCURSOR &&
13507 message != WM_MOUSEMOVE &&
13509 message != WM_KEYUP &&
13510 (message < EM_GETSEL || message > EM_GETIMESTATUS))
13511 {
13512 add_message(&msg);
13513 }
13514
13515 defwndproc_counter++;
13516 if (IsWindowUnicode(hwnd))
13518 else
13520 defwndproc_counter--;
13521
13522 return ret;
13523}
#define EM_GETIMESTATUS
Definition: winuser.h:2016
#define WM_GETTEXTLENGTH
Definition: winuser.h:1647
#define WM_KEYUP
Definition: winuser.h:1744
#define WM_IME_NOTIFY
Definition: winuser.h:1858
#define WM_MOUSEMOVE
Definition: winuser.h:1803
#define WM_GETFONT
Definition: winuser.h:1679
#define WM_IME_SETCONTEXT
Definition: winuser.h:1857
BOOL WINAPI IsWindowUnicode(_In_ HWND)
#define WM_SETCURSOR
Definition: winuser.h:1664
#define WM_CTLCOLOREDIT
Definition: winuser.h:1795

Referenced by test_edit_ime_messages().

◆ expect_HWND_()

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

Definition at line 18238 of file msg.c.

18239{
18240 ok_(__FILE__, line)(got==expected, "Expected %p, got %p\n", expected, got);
18241}

◆ flush_events()

static void flush_events ( void  )
static

Definition at line 2635 of file msg.c.

2636{
2637 MSG msg;
2638 int diff = 200;
2639 int min_timeout = 100;
2640 DWORD time = GetTickCount() + diff;
2641
2642 while (diff > 0)
2643 {
2644 if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
2645 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
2646 diff = time - GetTickCount();
2647 }
2648}
#define WAIT_TIMEOUT
Definition: dderror.h:14
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
Definition: sync.c:182
__u16 time
Definition: mkdosfs.c:8

Referenced by create_child_thread(), create_grand_child_thread(), invisible_parent_tests(), subtest_hvredraw(), subtest_swp_paint_regions_(), test_accelerators(), test_autoradio_BM_CLICK(), test_autoradio_kbd_move(), test_broadcast(), test_button_messages(), test_dbcs_wm_char(), test_defwinproc(), test_DispatchMessage(), test_DoubleSetCapture(), test_hotkey(), 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_radiobutton_focus(), test_recursive_hook(), test_recursive_messages(), 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_ShowWindow(), test_swp_paint_region_on_extend_zerosize(), test_swp_paint_region_on_show(), 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 2650 of file msg.c.

2651{
2653 free( sequence );
2654 sequence = 0;
2657}

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_ime_messages(), 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_radiobutton_focus(), 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 16553 of file msg.c.

16554{
16555 DWORD cp;
16556 int ret;
16557 HKL hkl = GetKeyboardLayout( 0 );
16558
16559 ret = GetLocaleInfoW( LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER,
16560 (WCHAR *)&cp, sizeof(cp) / sizeof(WCHAR) );
16561 if (!ret) cp = CP_ACP;
16562 return cp;
16563}
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
POINT cp
Definition: magnifier.c:59
HKL hkl
Definition: msctf.idl:632
UINT_PTR HKL
Definition: msctf.idl:125
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:45
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 17619 of file msg.c.

17620{
17621 MENUINFO mi;
17622 BOOL ret;
17623
17624 mi.cbSize = sizeof(mi);
17625 mi.fMask = MIM_STYLE;
17626 mi.dwStyle = 0;
17627 SetLastError(0xdeadbeef);
17628 ret = GetMenuInfo(hmenu, &mi);
17629 ok(ret, "GetMenuInfo error %lu\n", GetLastError());
17630
17631 return mi.dwStyle;
17632}
#define SetLastError(x)
Definition: compat.h:752
static HMENU hmenu
Definition: win.c:78
DWORD cbSize
Definition: winuser.h:3892
BOOL WINAPI GetMenuInfo(_In_ HMENU, _Inout_ LPMENUINFO)

Referenced by test_menu_messages().

◆ get_test_dll_path()

static char * get_test_dll_path ( void  )
static

Definition at line 12377 of file msg.c.

12378{
12379 static const char *dll_name = "testdll.dll";
12380 static char path[MAX_PATH];
12381 DWORD written;
12382 HANDLE file;
12383 HRSRC res;
12384 void *ptr;
12385
12387 strcat(path, dll_name);
12388
12390 ok(file != INVALID_HANDLE_VALUE, "Failed to create file %s: %lu.\n", debugstr_a(path), GetLastError());
12391
12392 res = FindResourceA(NULL, dll_name, "TESTDLL");
12393#ifdef __REACTOS__
12394 ok(!!res || broken(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND) /* WS03 */, "Failed to load resource: %lu\n", GetLastError());
12395#else
12396 ok(!!res, "Failed to load resource: %lu\n", GetLastError());
12397#endif
12400 ok(written == SizeofResource(GetModuleHandleA(NULL), res), "Failed to write resource\n");
12402
12403 return path;
12404}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
DWORD WINAPI GetTempPathA(IN DWORD nBufferLength, OUT LPSTR lpBuffer)
Definition: path.c:1973
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define debugstr_a
Definition: kernel32.h:31
static PVOID ptr
Definition: dispmode.c:27
strcat
Definition: string.h:92
#define ERROR_RESOURCE_TYPE_NOT_FOUND
Definition: winerror.h:1477

Referenced by test_set_hook().

◆ get_text_len_proc()

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

Definition at line 11502 of file msg.c.

11503{
11504 switch(msg)
11505 {
11506 case WM_GETTEXTLENGTH:
11507 return lstrlenW(dummy_window_text) + 37; /* some random length */
11508 case WM_GETTEXT:
11510 return lstrlenW( (LPWSTR)lp );
11511 default:
11512 return DefWindowProcW( hwnd, msg, wp, lp );
11513 }
11514}
#define lstrcpynW
Definition: compat.h:738
#define lstrlenW
Definition: compat.h:750
static const WCHAR dummy_window_text[]
Definition: msg.c:11499
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 2379 of file msg.c.

2380{
2381 static char buffer[300];
2382
2383 buffer[0] = 0;
2384#define DUMP(flag) do { if (flags & flag) { strcat( buffer, "|" #flag ); flags &= ~flag; } } while(0)
2394 DUMP( SWP_NOZORDER );
2395 DUMP( SWP_NOREDRAW );
2396 DUMP( SWP_NOSIZE );
2397 DUMP( SWP_NOMOVE );
2400 if (flags) sprintf(buffer + strlen(buffer),"|0x%04x", flags);
2401 return buffer + 1;
2402#undef DUMP
2403}
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161
#define SWP_NOCLIENTSIZE
Definition: msg.c:42
#define SWP_NOCLIENTMOVE
Definition: msg.c:43
#define DUMP(flag)
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SWP_NOREDRAW
Definition: winuser.h:1257
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1264
#define SWP_DEFERERASE
Definition: winuser.h:1263
#define SWP_NOCOPYBITS
Definition: winuser.h:1254
#define SWP_SHOWWINDOW
Definition: winuser.h:1259
#define SWP_HIDEWINDOW
Definition: winuser.h:1252
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define SWP_NOZORDER
Definition: winuser.h:1258
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262

Referenced by add_message_().

◆ hash_Ly()

static unsigned hash_Ly ( const char str)
static

Definition at line 2428 of file msg.c.

2429{
2430 unsigned hash = 0;
2431
2432 for (; *str; str++)
2433 hash = hash * 1664525u + (unsigned char)(*str) + 1013904223u;
2434
2435 return hash;
2436}
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 2418 of file msg.c.

2419{
2420 unsigned hash = 0;
2421
2422 for (; *str; str++)
2423 hash = hash * 1664525u + (unsigned char)(*str) + 1013904223u;
2424
2425 return hash;
2426}

Referenced by add_message_().

◆ hide_window_thread()

static DWORD CALLBACK hide_window_thread ( LPVOID  arg)
static

Definition at line 5518 of file msg.c.

5519{
5520 HWND hwnd = arg;
5521
5522 /* function will not return if ShowWindow(SW_HIDE) calls SendMessage() */
5523 ok(ShowWindow(hwnd, SW_HIDE) == FALSE, "ShowWindow(SW_HIDE) expected FALSE\n");
5524
5525 return 0;
5526}
void * arg
Definition: msvc.h:10
#define SW_HIDE
Definition: winuser.h:779
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)

Referenced by test_messages().

◆ HotkeyMsgCheckProcA()

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

Definition at line 11227 of file msg.c.

11228{
11229 static LONG defwndproc_counter = 0;
11230 LRESULT ret;
11231 struct recvd_message msg;
11232 DWORD queue_status;
11233
11234 if (ignore_message( message )) return 0;
11235
11236 if ((message >= WM_KEYFIRST && message <= WM_KEYLAST) ||
11238 {
11239 msg.hwnd = hwnd;
11240 msg.message = message;
11241 msg.flags = sent|wparam|lparam;
11242 if (defwndproc_counter) msg.flags |= defwinproc;
11243 msg.wParam = wParam;
11244 msg.lParam = lParam;
11245 msg.descr = "HotkeyMsgCheckProcA";
11246 add_message(&msg);
11247 }
11248
11249 defwndproc_counter++;
11251 defwndproc_counter--;
11252
11253 if (message == WM_APP)
11254 {
11255 queue_status = GetQueueStatus(QS_HOTKEY);
11256 ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %lx\n", queue_status);
11257 queue_status = GetQueueStatus(QS_POSTMESSAGE);
11258 ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %lx\n", queue_status);
11259 PostMessageA(hwnd, WM_APP+1, 0, 0);
11260 }
11261 else if (message == WM_APP+1)
11262 {
11263 queue_status = GetQueueStatus(QS_HOTKEY);
11264 ok((queue_status & (QS_HOTKEY << 16)) == 0, "expected QS_HOTKEY << 16 cleared, got %lx\n", queue_status);
11265 }
11266
11267 return ret;
11268}
#define WM_APP
Definition: eventvwr.h:73
DWORD WINAPI GetQueueStatus(_In_ UINT)
#define WM_KEYFIRST
Definition: winuser.h:1742
#define QS_HOTKEY
Definition: winuser.h:892
#define QS_POSTMESSAGE
Definition: winuser.h:888
#define WM_HOTKEY
Definition: winuser.h:1907
#define WM_KEYLAST
Definition: winuser.h:1756
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by register_classes().

◆ HWINEVENTHOOK()

static HWINEVENTHOOK ( WINAPI pSetWinEventHook)
static

◆ ignore_message()

◆ init_procs()

static void init_procs ( void  )
static

Definition at line 2354 of file msg.c.

2355{
2356 HMODULE user32 = GetModuleHandleA("user32.dll");
2357 HMODULE kernel32 = GetModuleHandleA("kernel32.dll");
2358
2359#define GET_PROC(dll, func) \
2360 p ## func = (void*)GetProcAddress(dll, #func); \
2361 if(!p ## func) { \
2362 trace("GetProcAddress(%s) failed\n", #func); \
2363 }
2364
2365 GET_PROC(user32, NotifyWinEvent)
2366 GET_PROC(user32, SetWinEventHook)
2367 GET_PROC(user32, TrackMouseEvent)
2368 GET_PROC(user32, UnhookWinEvent)
2370 GET_PROC(user32, SetSystemTimer)
2371 GET_PROC(user32, KillSystemTimer)
2372 GET_PROC(user32, SetCoalescableTimer)
2373
2374 GET_PROC(kernel32, GetCPInfoExA)
2375
2376#undef GET_PROC
2377}
BOOL WINAPI GetCPInfoExA(UINT codepage, DWORD dwFlags, LPCPINFOEXA cpinfo)
Definition: locale.c:2204
#define GET_PROC(dll, func)
BOOL WINAPI UpdateLayeredWindow(HWND hwnd, HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pbl, DWORD dwFlags)
Definition: window.c:1759
void WINAPI NotifyWinEvent(DWORD, HWND, LONG, LONG)
Definition: hook.c:325
HWINEVENTHOOK WINAPI SetWinEventHook(UINT, UINT, HMODULE, WINEVENTPROC, DWORD, DWORD, UINT)
Definition: hook.c:344
BOOL WINAPI UnhookWinEvent(HWINEVENTHOOK)
BOOL WINAPI TrackMouseEvent(_Inout_ LPTRACKMOUSEEVENT)
UINT_PTR WINAPI SetSystemTimer(HWND, UINT_PTR, UINT, TIMERPROC)
Definition: ntwrapper.h:106
BOOL WINAPI KillSystemTimer(HWND, UINT_PTR)
Definition: timer.c:35

Referenced by START_TEST().

◆ insendmessage_wnd_proc()

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

Definition at line 20344 of file msg.c.

20345{
20347 BOOL ret;
20348
20349 switch (msg)
20350 {
20351 case WM_USER:
20352 ok( flags == ISMEX_SEND, "wrong flags %lx\n", flags );
20353 ok( InSendMessage(), "InSendMessage returned false\n" );
20354 ret = ReplyMessage( msg );
20355 ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
20357 ok( flags == (ISMEX_SEND | ISMEX_REPLIED) || broken( flags == (ISMEX_NOTIFY | ISMEX_REPLIED) ),
20358 "wrong flags %lx\n", flags );
20359 ok( InSendMessage(), "InSendMessage returned false\n" );
20360 break;
20361 case WM_USER + 1:
20362 ok( flags == ISMEX_NOTIFY, "wrong flags %lx\n", flags );
20363 ok( InSendMessage(), "InSendMessage returned false\n" );
20364 ret = ReplyMessage( msg );
20365 ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
20367 ok( flags == ISMEX_NOTIFY, "wrong flags %lx\n", flags );
20368 ok( InSendMessage(), "InSendMessage returned false\n" );
20369 break;
20370 case WM_USER + 2:
20371 ok( flags == ISMEX_CALLBACK, "wrong flags %lx\n", flags );
20372 ok( InSendMessage(), "InSendMessage returned false\n" );
20373 ret = ReplyMessage( msg );
20374 ok( ret, "ReplyMessage failed err %lu\n", GetLastError() );
20376 ok( flags == (ISMEX_CALLBACK | ISMEX_REPLIED) || flags == ISMEX_SEND, "wrong flags %lx\n", flags );
20377 ok( InSendMessage(), "InSendMessage returned false\n" );
20378 break;
20379 case WM_USER + 3:
20380 ok( flags == ISMEX_NOSEND, "wrong flags %lx\n", flags );
20381 ok( !InSendMessage(), "InSendMessage returned true\n" );
20382 ret = ReplyMessage( msg );
20383 ok( !ret, "ReplyMessage succeeded\n" );
20384 break;
20385 }
20386
20387 return DefWindowProcA( hwnd, msg, wp, lp );
20388}
DWORD WINAPI InSendMessageEx(LPVOID lpReserved)
Definition: message.c:1391
BOOL WINAPI ReplyMessage(_In_ LRESULT)
BOOL WINAPI InSendMessage(void)
Definition: message.c:1372

Referenced by test_InSendMessage().

◆ invisible_parent_tests()

static void invisible_parent_tests ( void  )
static

Definition at line 6289 of file msg.c.

6290{
6291 HWND hparent, hchild;
6292
6293 hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW,
6294 100, 100, 200, 200, 0, 0, 0, NULL);
6295 ok (hparent != 0, "Failed to create parent window\n");
6297
6298 /* test showing child with hidden parent */
6299
6300 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6301 0, 0, 10, 10, hparent, 0, 0, NULL);
6302 ok (hchild != 0, "Failed to create child window\n");
6303 ok_sequence(WmCreateChildSeq, "CreateWindow:child", FALSE);
6304
6305 ShowWindow( hchild, SW_MINIMIZE );
6306 ok_sequence(WmShowChildInvisibleParentSeq_1, "ShowWindow(SW_MINIMIZE) child with invisible parent", FALSE);
6307 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6308 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6309
6310 /* repeat */
6311 flush_events();
6313 ShowWindow( hchild, SW_MINIMIZE );
6314 ok_sequence(WmShowChildInvisibleParentSeq_1r, "ShowWindow(SW_MINIMIZE) child with invisible parent", FALSE);
6315
6316 DestroyWindow(hchild);
6317 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6318 0, 0, 10, 10, hparent, 0, 0, NULL);
6320
6321 ShowWindow( hchild, SW_MAXIMIZE );
6322 ok_sequence(WmShowChildInvisibleParentSeq_2, "ShowWindow(SW_MAXIMIZE) child with invisible parent", FALSE);
6323 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6324 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6325
6326 /* repeat */
6327 flush_events();
6329 ShowWindow( hchild, SW_MAXIMIZE );
6330 ok_sequence(WmShowChildInvisibleParentSeq_2r, "ShowWindow(SW_MAXIMIZE) child with invisible parent", FALSE);
6331
6332 DestroyWindow(hchild);
6333 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6334 0, 0, 10, 10, hparent, 0, 0, NULL);
6336
6337 ShowWindow( hchild, SW_RESTORE );
6338 ok_sequence(WmShowChildInvisibleParentSeq_5, "ShowWindow(SW_RESTORE) child with invisible parent", FALSE);
6339 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6340 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6341
6342 DestroyWindow(hchild);
6343 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6344 0, 0, 10, 10, hparent, 0, 0, NULL);
6346
6347 ShowWindow( hchild, SW_SHOWMINIMIZED );
6348 ok_sequence(WmShowChildInvisibleParentSeq_3, "ShowWindow(SW_SHOWMINIMIZED) child with invisible parent", FALSE);
6349 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6350 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6351
6352 /* repeat */
6353 flush_events();
6355 ShowWindow( hchild, SW_SHOWMINIMIZED );
6356 ok_sequence(WmShowChildInvisibleParentSeq_3r, "ShowWindow(SW_SHOWMINIMIZED) child with invisible parent", FALSE);
6357
6358 DestroyWindow(hchild);
6359 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6360 0, 0, 10, 10, hparent, 0, 0, NULL);
6362
6363 /* same as ShowWindow( hchild, SW_MAXIMIZE ); */
6364 ShowWindow( hchild, SW_SHOWMAXIMIZED );
6365 ok_sequence(WmShowChildInvisibleParentSeq_2, "ShowWindow(SW_SHOWMAXIMIZED) child with invisible parent", FALSE);
6366 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6367 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6368
6369 DestroyWindow(hchild);
6370 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6371 0, 0, 10, 10, hparent, 0, 0, NULL);
6373
6374 ShowWindow( hchild, SW_SHOWMINNOACTIVE );
6375 ok_sequence(WmShowChildInvisibleParentSeq_4, "ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent", FALSE);
6376 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6377 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6378
6379 /* repeat */
6380 flush_events();
6382 ShowWindow( hchild, SW_SHOWMINNOACTIVE );
6383 ok_sequence(WmShowChildInvisibleParentSeq_4r, "ShowWindow(SW_SHOWMINNOACTIVE) child with invisible parent", FALSE);
6384
6385 DestroyWindow(hchild);
6386 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6387 0, 0, 10, 10, hparent, 0, 0, NULL);
6389
6390 /* FIXME: looks like XP SP2 doesn't know about SW_FORCEMINIMIZE at all */
6391 ShowWindow( hchild, SW_FORCEMINIMIZE );
6392 ok_sequence(WmEmptySeq, "ShowWindow(SW_FORCEMINIMIZE) child with invisible parent", TRUE);
6393todo_wine {
6394 ok(!(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should be not set\n");
6395}
6396 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6397
6398 DestroyWindow(hchild);
6399 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6400 0, 0, 10, 10, hparent, 0, 0, NULL);
6402
6403 ShowWindow( hchild, SW_SHOWNA );
6404 ok_sequence(WmShowChildInvisibleParentSeq_5, "ShowWindow(SW_SHOWNA) child with invisible parent", FALSE);
6405 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6406 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6407
6408 /* repeat */
6409 flush_events();
6411 ShowWindow( hchild, SW_SHOWNA );
6412 ok_sequence(WmShowChildInvisibleParentSeq_5, "ShowWindow(SW_SHOWNA) child with invisible parent", FALSE);
6413
6414 DestroyWindow(hchild);
6415 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
6416 0, 0, 10, 10, hparent, 0, 0, NULL);
6418
6419 ShowWindow( hchild, SW_SHOW );
6420 ok_sequence(WmShowChildInvisibleParentSeq_5, "ShowWindow(SW_SHOW) child with invisible parent", FALSE);
6421 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6422 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6423
6424 /* repeat */
6425 flush_events();
6427 ShowWindow( hchild, SW_SHOW );
6428 ok_sequence(WmEmptySeq, "ShowWindow(SW_SHOW) child with invisible parent", FALSE);
6429
6430 ShowWindow( hchild, SW_HIDE );
6431 ok_sequence(WmHideChildInvisibleParentSeq, "ShowWindow:hide child with invisible parent", FALSE);
6432 ok(!(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should be not set\n");
6433 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6434
6436 ok_sequence(WmShowChildInvisibleParentSeq_6, "SetWindowPos:show child with invisible parent", FALSE);
6437 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
6438 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6439
6441 ok_sequence(WmHideChildInvisibleParentSeq_2, "SetWindowPos:hide child with invisible parent", FALSE);
6442 ok(!(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should not be set\n");
6443 ok(!IsWindowVisible(hchild), "IsWindowVisible() should return FALSE\n");
6444
6447 DestroyWindow(hchild);
6448 ok_sequence(WmDestroyInvisibleChildSeq, "DestroyInvisibleChildSeq", FALSE);
6449
6450 DestroyWindow(hparent);
6452}
static const struct message WmShowChildInvisibleParentSeq_3[]
Definition: msg.c:1575
static const struct message WmShowChildInvisibleParentSeq_1r[]
Definition: msg.c:1552
static const struct message WmShowChildInvisibleParentSeq_2[]
Definition: msg.c:1557
static const struct message WmHideChildInvisibleParentSeq[]
Definition: msg.c:1620
static const struct message WmShowChildInvisibleParentSeq_5[]
Definition: msg.c:1615
static const struct message WmShowChildInvisibleParentSeq_3r[]
Definition: msg.c:1590
static const struct message WmShowChildInvisibleParentSeq_4r[]
Definition: msg.c:1610
static const struct message WmCreateChildSeq[]
Definition: msg.c:1430
#define ok_sequence(exp, contx, todo)
Definition: msg.c:2798
static const struct message WmShowChildInvisibleParentSeq_1[]
Definition: msg.c:1537
static const struct message WmShowChildInvisibleParentSeq_2r[]
Definition: msg.c:1570
static const struct message WmHideChildInvisibleParentSeq_2[]
Definition: msg.c:1632
static const struct message WmEmptySeq[]
Definition: msg.c:183
static const struct message WmShowChildInvisibleParentSeq_6[]
Definition: msg.c:1625
static const struct message WmShowChildInvisibleParentSeq_4[]
Definition: msg.c:1595
static const struct message WmDestroyInvisibleChildSeq[]
Definition: msg.c:1669
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define SW_SHOWMAXIMIZED
Definition: winuser.h:784
#define SW_MINIMIZE
Definition: winuser.h:787
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SW_SHOWMINIMIZED
Definition: winuser.h:782
#define SW_FORCEMINIMIZE
Definition: winuser.h:792
#define SW_SHOWNA
Definition: winuser.h:789
#define SW_RESTORE
Definition: winuser.h:790
#define SW_SHOW
Definition: winuser.h:786
#define SW_MAXIMIZE
Definition: winuser.h:783
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define SW_SHOWMINNOACTIVE
Definition: winuser.h:788

Referenced by START_TEST().

◆ is_our_logged_class()

static BOOL is_our_logged_class ( HWND  hwnd)
static

Definition at line 11345 of file msg.c.

11346{
11347 char buf[256];
11348
11349 if (GetClassNameA(hwnd, buf, sizeof(buf)))
11350 {
11351 if (!lstrcmpiA(buf, "TestWindowClass") ||
11352 !lstrcmpiA(buf, "ShowWindowClass") ||
11353 !lstrcmpiA(buf, "TestParentClass") ||
11354 !lstrcmpiA(buf, "TestPopupClass") ||
11355 !lstrcmpiA(buf, "SimpleWindowClass") ||
11356 !lstrcmpiA(buf, "TestDialogClass") ||
11357 !lstrcmpiA(buf, "MDI_frame_class") ||
11358 !lstrcmpiA(buf, "MDI_client_class") ||
11359 !lstrcmpiA(buf, "MDI_child_class") ||
11360 !lstrcmpiA(buf, "my_button_class") ||
11361 !lstrcmpiA(buf, "my_edit_class") ||
11362 !lstrcmpiA(buf, "static") ||
11363 !lstrcmpiA(buf, "ListBox") ||
11364 !lstrcmpiA(buf, "ComboBox") ||
11365 !lstrcmpiA(buf, "MyDialogClass") ||
11366 !lstrcmpiA(buf, "#32770") ||
11367 !lstrcmpiA(buf, "#32768"))
11368 return TRUE;
11369 }
11370 return FALSE;
11371}

Referenced by cbt_hook_proc(), and win_event_proc().

◆ keyboard_recursive_cbt_hook_proc()

static LRESULT CALLBACK keyboard_recursive_cbt_hook_proc ( int  code,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 12644 of file msg.c.

12645{
12646 MSG msg;
12647
12648 if (code < 0)
12649 return CallNextHookEx(0, code, wp, lp);
12650
12651 if (code == HCBT_KEYSKIPPED)
12652 {
12653 hook_depth++;
12656 hook_depth--;
12657 }
12658
12659 return CallNextHookEx(0, code, wp, lp);
12660}
static int hook_depth
Definition: msg.c:12566
static int max_hook_depth
Definition: msg.c:12566
#define max(a, b)
Definition: svc.c:63
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)

Referenced by test_recursive_hook().

◆ keyboard_recursive_hook_proc()

static LRESULT CALLBACK keyboard_recursive_hook_proc ( int  code,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 12610 of file msg.c.

12611{
12612 MSG msg;
12613
12614 if (code < 0)
12615 return CallNextHookEx(0, code, wp, lp);
12616
12618 return 1;
12619
12620 hook_depth++;
12623 hook_depth--;
12624 return CallNextHookEx(0, code, wp, lp);
12625}
static BOOL skip_WH_KEYBOARD_hook
Definition: msg.c:12567

Referenced by test_recursive_hook().

◆ KeyboardHookProc()

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

Definition at line 19249 of file msg.c.

19250{
19251 struct recvd_message msg;
19252
19253 if (nCode == HC_ACTION)
19254 {
19255 KBDLLHOOKSTRUCT *kdbhookstruct = (KBDLLHOOKSTRUCT*)lParam;
19256
19257 msg.hwnd = 0;
19258 msg.message = wParam;
19259 msg.flags = kbd_hook|wparam|lparam;
19260 msg.wParam = kdbhookstruct->vkCode;
19261 msg.lParam = kdbhookstruct->flags;
19262 msg.descr = "KeyboardHookProc";
19263 add_message(&msg);
19264
19265 if (wParam == WM_KEYUP || wParam == WM_KEYDOWN ||
19267 {
19268 ok(kdbhookstruct->vkCode == VK_LWIN ||
19269 kdbhookstruct->vkCode == VK_LMENU ||
19270 kdbhookstruct->vkCode == hotkey_letter,
19271 "unexpected keycode %lx\n", kdbhookstruct->vkCode);
19272 }
19273 }
19274
19275 return CallNextHookEx(hKBD_hook, nCode, wParam, lParam);
19276}
static int hotkey_letter
Definition: msg.c:19247
#define WM_SYSKEYUP
Definition: winuser.h:1748
#define VK_LWIN
Definition: winuser.h:2271
#define WM_KEYDOWN
Definition: winuser.h:1743
#define WM_SYSKEYDOWN
Definition: winuser.h:1747
#define VK_LMENU
Definition: winuser.h:2322

Referenced by DlgMainProc(), and test_hotkey().

◆ listbox_hook_proc()

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

Definition at line 17111 of file msg.c.

17112{
17113 static LONG defwndproc_counter = 0;
17114 LRESULT ret;
17115 struct recvd_message msg;
17116
17117 /* do not log painting messages */
17118 if (message != WM_PAINT &&
17119 message != WM_NCPAINT &&
17120 message != WM_SYNCPAINT &&
17122 message != WM_NCHITTEST &&
17123 message != WM_GETTEXT &&
17125 {
17126 msg.hwnd = hwnd;
17127 msg.message = message;
17128 msg.flags = sent|wparam|lparam;
17129 if (defwndproc_counter) msg.flags |= defwinproc;
17130 msg.wParam = wp;
17131 if (message == LB_ADDSTRING)
17132 msg.lParam = lp ? hash_Ly((const char *)lp) : 0;
17133 else
17134 msg.lParam = lp;
17135 msg.descr = "listbox";
17136 add_message(&msg);
17137 }
17138
17139 defwndproc_counter++;
17140 ret = CallWindowProcA(listbox_orig_proc, hwnd, message, wp, lp);
17141 defwndproc_counter--;
17142
17143 return ret;
17144}
#define LB_ADDSTRING
Definition: winuser.h:2060

Referenced by test_listbox_messages().

◆ LRESULT()

static LRESULT ( WINAPI listbox_orig_proc)
static

◆ mdi_child_wnd_proc()

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

Definition at line 4067 of file msg.c.

4068{
4069 static LONG defwndproc_counter = 0;
4070 LRESULT ret;
4071 struct recvd_message msg;
4072
4073 /* do not log painting messages */
4074 if (message != WM_PAINT &&
4075 message != WM_NCPAINT &&
4076 message != WM_SYNCPAINT &&
4078 message != WM_NCHITTEST &&
4079 message != WM_GETTEXT &&
4081 {
4082 switch (message)
4083 {
4084 case WM_MDIACTIVATE:
4085 {
4086 HWND active, client = GetParent(hwnd);
4087
4088 active = (HWND)SendMessageA(client, WM_MDIGETACTIVE, 0, 0);
4089
4090 if (hwnd == (HWND)lParam) /* if we are being activated */
4091 ok (active == (HWND)lParam, "new active %p != active %p\n", (HWND)lParam, active);
4092 else
4093 ok (active == (HWND)wParam, "old active %p != active %p\n", (HWND)wParam, active);
4094 break;
4095 }
4096 }
4097
4098 msg.hwnd = hwnd;
4099 msg.message = message;
4100 msg.flags = sent|wparam|lparam;
4101 if (defwndproc_counter) msg.flags |= defwinproc;
4102 msg.wParam = wParam;
4103 msg.lParam = lParam;
4104 msg.descr = "mdi child";
4105 add_message(&msg);
4106 }
4107
4108 defwndproc_counter++;
4110 defwndproc_counter--;
4111
4112 return ret;
4113}
static FILE * client
Definition: client.c:37
LRESULT WINAPI DefMDIChildProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_MDIACTIVATE
Definition: winuser.h:1842
HWND WINAPI GetParent(_In_ HWND)
#define WM_MDIGETACTIVE
Definition: winuser.h:1849

Referenced by mdi_register_classes().

◆ mdi_client_hook_proc()

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

Definition at line 4041 of file msg.c.

4042{
4043 struct recvd_message msg;
4044
4045 /* do not log painting messages */
4046 if (message != WM_PAINT &&
4047 message != WM_NCPAINT &&
4048 message != WM_SYNCPAINT &&
4050 message != WM_NCHITTEST &&
4051 message != WM_GETTEXT &&
4054 {
4055 msg.hwnd = hwnd;
4056 msg.message = message;
4057 msg.flags = sent|wparam|lparam;
4058 msg.wParam = wParam;
4059 msg.lParam = lParam;
4060 msg.descr = "mdi client";
4061 add_message(&msg);
4062 }
4063
4065}
static WNDPROC old_mdi_client_proc
Definition: msg.c:4039

Referenced by mdi_register_classes().

◆ mdi_frame_wnd_proc()

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

Definition at line 4115 of file msg.c.

4116{
4117 static LONG defwndproc_counter = 0;
4118 LRESULT ret;
4119 struct recvd_message msg;
4120
4121 /* do not log painting messages */
4122 if (message != WM_PAINT &&
4123 message != WM_NCPAINT &&
4124 message != WM_SYNCPAINT &&
4126 message != WM_NCHITTEST &&
4127 message != WM_GETTEXT &&
4129 {
4130 msg.hwnd = hwnd;
4131 msg.message = message;
4132 msg.flags = sent|wparam|lparam;
4133 if (defwndproc_counter) msg.flags |= defwinproc;
4134 msg.wParam = wParam;
4135 msg.lParam = lParam;
4136 msg.descr = "mdi frame";
4137 add_message(&msg);
4138 }
4139
4140 defwndproc_counter++;
4142 defwndproc_counter--;
4143
4144 return ret;
4145}
static HWND mdi_client
Definition: msg.c:4038
LRESULT WINAPI DefFrameProcA(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by mdi_register_classes().

◆ mdi_register_classes()

static void mdi_register_classes ( void  )
static

Definition at line 4147 of file msg.c.

4148{
4149 WNDCLASSA cls;
4150 BOOL ret;
4151
4152 cls.style = 0;
4154 cls.cbClsExtra = 0;
4155 cls.cbWndExtra = 0;
4156 cls.hInstance = GetModuleHandleA(0);
4157 cls.hIcon = 0;
4160 cls.lpszMenuName = NULL;
4161 cls.lpszClassName = "MDI_frame_class";
4162 register_class(&cls);
4163
4165 cls.lpszClassName = "MDI_child_class";
4166 register_class(&cls);
4167
4168 ret = GetClassInfoA(0, "MDIClient", &cls);
4169 ok(ret, "Failed to get class info, error %lu.\n", GetLastError());
4171 cls.hInstance = GetModuleHandleA(0);
4173 cls.lpszClassName = "MDI_client_class";
4174 register_class(&cls);
4175}
static LRESULT WINAPI mdi_client_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:4041
static LRESULT WINAPI mdi_frame_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:4115
static LRESULT WINAPI mdi_child_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:4067
HICON hIcon
Definition: winuser.h:3276
HINSTANCE hInstance
Definition: winuser.h:3275
int cbWndExtra
Definition: winuser.h:3274
UINT style
Definition: winuser.h:3271
LPCSTR lpszMenuName
Definition: winuser.h:3279
int cbClsExtra
Definition: winuser.h:3273
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
BOOL WINAPI GetClassInfoA(_In_opt_ HINSTANCE, _In_ LPCSTR, _Out_ LPWNDCLASSA)

Referenced by test_mdi_messages().

◆ message_type_name()

static const char * message_type_name ( int  flags)
static

Definition at line 2659 of file msg.c.

2659 {
2660 if (flags & hook) return "hook";
2661 if (flags & kbd_hook) return "kbd_hook";
2662 if (flags & winevent_hook) return "winevent_hook";
2663 return "msg";
2664}

Referenced by dump_sequence(), and messages_equal().

◆ messages_equal()

static BOOL messages_equal ( const struct message expected,
const struct recvd_message actual,
BOOL  expect_equal,
const char file,
int  line 
)
static

Definition at line 2681 of file msg.c.

2683{
2684 int todo = (expected->flags & msg_todo) != 0;
2685 int msg_wine_only = (expected->flags & wine_only) != 0;
2686 const int message_type_flags = hook|winevent_hook|kbd_hook;
2687 static int todo_reported;
2688
2690 expect_equal = FALSE;
2691
2692 if (msg_wine_only && strcmp(winetest_platform, "wine"))
2693 {
2694 /* Ignore Wine-only message records on Windows. */
2695 return FALSE;
2696 }
2697
2698 if (!expected->message || !actual->message) {
2699 if (expect_equal && (!todo || !todo_reported++))
2700 todo_wine_if(todo || msg_wine_only)
2701 ok_( file, line) (msg_wine_only, "the msg sequence is not complete: expected %s %04x - actual %s %04x\n",
2702 message_type_name(expected->flags), expected->message, message_type_name(actual->flags), actual->message);
2703 return FALSE;
2704 }
2705
2706 if (expected->message != actual->message ||
2707 (expected->flags & message_type_flags) != (actual->flags & message_type_flags))
2708 {
2709 if (expect_equal && (!todo || !todo_reported++))
2710 todo_wine_if(todo || msg_wine_only)
2711 ok_( file, line) (msg_wine_only, "the %s 0x%04x was expected, but got %s 0x%04x instead\n",
2712 message_type_name(expected->flags), expected->message, message_type_name(actual->flags), actual->message);
2713 return FALSE;
2714 }
2715
2716 if (expected->flags & optional)
2717 {
2718 /* If a message can be sent in 2 different ways at the same time, we may need to treat
2719 * them as unequal so that the optional message can be properly skipped. */
2720 if ((expected->flags & defwinproc) != (actual->flags & defwinproc)) {
2721 /* don't match messages if their defwinproc status differs */
2722 return FALSE;
2723 }
2724 }
2725
2726 if (expect_equal)
2727 todo_wine_if(todo || msg_wine_only)
2728 ok_( file, line) (!msg_wine_only, "got %s 0x%04x as expected\n",
2729 message_type_name(expected->flags), expected->message);
2730
2731 return TRUE;
2732}
#define todo_wine_if(is_todo)
Definition: minitest.h:81
BOOL todo
Definition: msg.c:18626

Referenced by dump_sequence(), ok_sequence_(), and sequence_contains_message().

◆ minimize_popup_proc()

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

Definition at line 20000 of file msg.c.

20001{
20002 LRESULT ret;
20003
20004 if (ignore_message( message )) return 0;
20006
20007 switch (message) {
20008 case WM_ENTERIDLE:
20010 break;
20011 case WM_TIMER:
20012 EndMenu();
20013 break;
20014 }
20015
20016 return ret;
20017}
#define WM_TIMER
Definition: winuser.h:1770

Referenced by test_TrackPopupMenu().

◆ mouse_ll_global_thread_proc()

static DWORD WINAPI mouse_ll_global_thread_proc ( void param)
static

Definition at line 12141 of file msg.c.

12142{
12143 HWND hwnd;
12144 MSG msg;
12145 HANDLE hevent = *(HANDLE *)param;
12146
12147 hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0,0,0,0,0,0,0, NULL);
12148 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
12149 if (winetest_debug > 1) trace("created thread window %p\n", hwnd);
12150
12151 *(HWND *)param = hwnd;
12152
12154
12155 /* Windows doesn't like when a thread plays games with the focus,
12156 * that leads to all kinds of misbehaviours and failures to activate
12157 * a window. So, better don't generate a mouse click message below.
12158 */
12159 mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0);
12160 mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
12161 mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0);
12162
12164 while (GetMessageA(&msg, 0, 0, 0))
12165 {
12168 }
12169 return 0;
12170}
void WINAPI mouse_event(_In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ ULONG_PTR)
#define MOUSEEVENTF_LEFTUP
Definition: winuser.h:1196
#define MOUSEEVENTF_MOVE
Definition: winuser.h:1194

Referenced by test_winevents().

◆ mouse_recursive_cbt_hook_proc()

static LRESULT CALLBACK mouse_recursive_cbt_hook_proc ( int  code,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 12662 of file msg.c.

12663{
12664 MSG msg;
12665
12666 if (code < 0)
12667 return CallNextHookEx(0, code, wp, lp);
12668
12669 if (code == HCBT_CLICKSKIPPED)
12670 {
12671 hook_depth++;
12674 hook_depth--;
12675 }
12676
12677 return CallNextHookEx(0, code, wp, lp);
12678}
#define WM_MOUSEFIRST
Definition: winuser.h:1802
#define WM_MOUSELAST
Definition: winuser.h:1829

Referenced by test_recursive_hook().

◆ mouse_recursive_hook_proc()

static LRESULT CALLBACK mouse_recursive_hook_proc ( int  code,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 12627 of file msg.c.

12628{
12629 MSG msg;
12630
12631 if (code < 0)
12632 return CallNextHookEx(0, code, wp, lp);
12633
12635 return 1;
12636
12637 hook_depth++;
12640 hook_depth--;
12641 return CallNextHookEx(0, code, wp, lp);
12642}
static BOOL skip_WH_MOUSE_hook
Definition: msg.c:12567

Referenced by test_recursive_hook().

◆ msg_callback()

static void CALLBACK msg_callback ( HWND  hwnd,
UINT  msg,
ULONG_PTR  arg,
LRESULT  result 
)
static

Definition at line 20390 of file msg.c.

20391{
20392 ok( msg == WM_USER + 2, "wrong msg %x\n", msg );
20393 ok( result == WM_USER + 2, "wrong result %Ix\n", result );
20394}
GLuint64EXT * result
Definition: glext.h:11304

Referenced by send_message_thread().

◆ MsgCheckProc()

static LRESULT MsgCheckProc ( BOOL  unicode,
HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 10849 of file msg.c.

10851{
10852 static LONG defwndproc_counter = 0;
10853 static LONG beginpaint_counter = 0;
10854 LRESULT ret;
10855 struct recvd_message msg;
10856
10857 if (ignore_message( message )) return 0;
10858
10859 switch (message)
10860 {
10861 case WM_ENABLE:
10862 {
10864 ok((BOOL)wParam == !(style & WS_DISABLED),
10865 "wrong WS_DISABLED state: %Id != %d\n", wParam, !(style & WS_DISABLED));
10866 break;
10867 }
10868
10869 case WM_CAPTURECHANGED:
10871 {
10873 if (style & WS_CHILD)
10875 else if (style & WS_POPUP)
10877 else
10879 }
10880 break;
10881
10882 case WM_NCDESTROY:
10883 {
10884 HWND capture;
10885
10886 ok(!GetWindow(hwnd, GW_CHILD), "children should be unlinked at this point\n");
10887 capture = GetCapture();
10888 if (capture)
10889 {
10890 ok(capture == hwnd, "capture should NOT be released at this point (capture %p)\n", capture);
10891 if (winetest_debug > 1) trace("current capture %p, releasing...\n", capture);
10893 }
10894 }
10895 /* fall through */
10896 case WM_DESTROY:
10897 ok(GetAncestor(hwnd, GA_PARENT) != 0, "parent should NOT be unlinked at this point\n");
10899 {
10901 if (style & WS_CHILD)
10903 else if (style & WS_POPUP)
10905 else
10907 }
10908 break;
10909
10910 /* test_accelerators() depends on this */
10911 case WM_NCHITTEST:
10912 return HTCLIENT;
10913
10914 case WM_USER+10:
10915 {
10916 ACTIVATION_CONTEXT_BASIC_INFORMATION basicinfo;
10917 HANDLE handle, event = (HANDLE)lParam;
10918 BOOL ret;
10919
10920 handle = (void*)0xdeadbeef;
10922 ok(ret, "failed to get current context, %lu\n", GetLastError());
10923 ok(handle == 0, "got active context %p\n", handle);
10924
10925 memset(&basicinfo, 0xff, sizeof(basicinfo));
10926 ret = QueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, handle, 0, ActivationContextBasicInformation,
10927 &basicinfo, sizeof(basicinfo), NULL);
10928 ok(ret, "got %d, error %ld\n", ret, GetLastError());
10929 ok(basicinfo.hActCtx == NULL, "got %p\n", basicinfo.hActCtx);
10930 ok(basicinfo.dwFlags == 0, "got %lx\n", basicinfo.dwFlags);
10931
10932 if (event) SetEvent(event);
10933 return 1;
10934 }
10935
10936 /* ignore */
10937 case WM_MOUSEMOVE:
10938 case WM_MOUSEACTIVATE:
10939 case WM_NCMOUSEMOVE:
10940 case WM_SETCURSOR:
10941 case WM_IME_SELECT:
10942 if (ignore_mouse_messages) return 0;
10943 break;
10944 }
10945
10946 msg.hwnd = hwnd;
10947 msg.message = message;
10948 msg.flags = sent|wparam|lparam;
10949 if (defwndproc_counter) msg.flags |= defwinproc;
10950 if (beginpaint_counter) msg.flags |= beginpaint;
10951 msg.wParam = wParam;
10952 msg.lParam = lParam;
10953 msg.descr = "MsgCheckProc";
10954 add_message(&msg);
10955
10957 {
10959 RECT rc;
10960 MINMAXINFO *minmax = (MINMAXINFO *)lParam;
10961
10962 GetClientRect(parent, &rc);
10963 if (winetest_debug > 1)
10964 {
10965 trace("parent %p client size = (%ld x %ld)\n", parent, rc.right, rc.bottom);
10966 trace("Reserved=%ld,%ld MaxSize=%ld,%ld MaxPos=%ld,%ld MinTrack=%ld,%ld MaxTrack=%ld,%ld\n",
10967 minmax->ptReserved.x, minmax->ptReserved.y,
10968 minmax->ptMaxSize.x, minmax->ptMaxSize.y,
10969 minmax->ptMaxPosition.x, minmax->ptMaxPosition.y,
10970 minmax->ptMinTrackSize.x, minmax->ptMinTrackSize.y,
10971 minmax->ptMaxTrackSize.x, minmax->ptMaxTrackSize.y);
10972 }
10973 ok(minmax->ptMaxSize.x == rc.right, "default width of maximized child %ld != %ld\n",
10974 minmax->ptMaxSize.x, rc.right);
10975 ok(minmax->ptMaxSize.y == rc.bottom, "default height of maximized child %ld != %ld\n",
10976 minmax->ptMaxSize.y, rc.bottom);
10977 }
10978
10979 if (message == WM_PAINT)
10980 {
10981 PAINTSTRUCT ps;
10982 beginpaint_counter++;
10983 BeginPaint( hwnd, &ps );
10984 beginpaint_counter--;
10985 EndPaint( hwnd, &ps );
10986 return 0;
10987 }
10988
10990 {
10991 /* don't create context menu */
10992 return 0;
10993 }
10994
10995 defwndproc_counter++;
10996 ret = unicode ? DefWindowProcW(hwnd, message, wParam, lParam)
10998 defwndproc_counter--;
10999
11000 return ret;
11001}
BOOL WINAPI QueryActCtxW(IN DWORD dwFlags, IN HANDLE hActCtx, IN PVOID pvSubInstance, IN ULONG ulInfoClass, IN PVOID pvBuffer, IN SIZE_T cbBuffer, IN OUT SIZE_T *pcbWrittenOrRequired OPTIONAL)
Definition: actctx.c:328
BOOL WINAPI GetCurrentActCtx(OUT PHANDLE phActCtx)
Definition: actctx.c:298
struct _cl_event * event
Definition: glext.h:7739
static BOOL ignore_mouse_messages
Definition: msg.c:117
static BOOL test_context_menu
Definition: msg.c:116
#define WS_DISABLED
Definition: pedump.c:621
#define WM_CONTEXTMENU
Definition: richedit.h:64
POINT ptMaxPosition
Definition: winuser.h:3737
POINT ptMaxSize
Definition: winuser.h:3736
POINT ptMinTrackSize
Definition: winuser.h:3738
POINT ptReserved
Definition: winuser.h:3735
POINT ptMaxTrackSize
Definition: winuser.h:3739
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
PVOID HANDLE
Definition: typedefs.h:73
#define WM_ENABLE
Definition: winuser.h:1643
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define GA_PARENT
Definition: winuser.h:2892
#define WM_NCMOUSEMOVE
Definition: winuser.h:1719
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_GETMINMAXINFO
Definition: winuser.h:1668
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define HTCLIENT
Definition: winuser.h:2511
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define WM_NCDESTROY
Definition: winuser.h:1712
#define WM_IME_SELECT
Definition: winuser.h:1861
#define WM_DESTROY
Definition: winuser.h:1637
#define GW_CHILD
Definition: winuser.h:774
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
Definition: window.c:929

Referenced by cancel_init_proc(), cancel_popup_proc(), minimize_popup_proc(), MsgCheckProcA(), and MsgCheckProcW().

◆ MsgCheckProcA()

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

Definition at line 11003 of file msg.c.

11004{
11006}

Referenced by DispatchMessageCheckProc(), register_classes(), and send_msg_delay_proc().

◆ MsgCheckProcW()

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

Definition at line 11008 of file msg.c.

11009{
11011}

Referenced by register_classes().

◆ MsgConversionProcW()

static LRESULT CALLBACK MsgConversionProcW ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 11464 of file msg.c.

11465{
11466 const DEV_BROADCAST_DEVICEINTERFACE_A *ifaceA = (const void *)lParam;
11467
11468 switch (uMsg)
11469 {
11470 case CB_FINDSTRINGEXACT:
11472 return 1;
11474 return 0;
11475 return -1;
11476
11477 case WM_DEVICECHANGE:
11479 {
11480 DWORD expect_size = offsetof(DEV_BROADCAST_DEVICEINTERFACE_A, dbcc_name[strlen(ifaceA->dbcc_name)]);
11481
11482 ok(ifaceA->dbcc_size == expect_size, "Expected %lu, got %lu.\n", expect_size, ifaceA->dbcc_size);
11484 "Got notification type %#lx.\n", ifaceA->dbcc_devicetype);
11485 ok(!ifaceA->dbcc_reserved, "Got reserved %#lx.\n", ifaceA->dbcc_reserved);
11486 ok(!strcmp(ifaceA->dbcc_name, "test name"), "Got name %s.\n", debugstr_a(ifaceA->dbcc_name));
11487 return 2;
11488 }
11489 }
11490 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
11491}
#define DBT_DEVICEARRIVAL
Definition: dbt.h:12
#define DBT_DEVTYP_DEVICEINTERFACE
Definition: dbt.h:24
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
static const WCHAR wszAnsi[]
Definition: msg.c:11460
static const GUID iface_guid
Definition: msg.c:11462
static const WCHAR wszUnicode[]
Definition: msg.c:11459
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define offsetof(TYPE, MEMBER)
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1969
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by test_message_conversion().

◆ ok_sequence_()

static void ok_sequence_ ( const struct message expected_list,
const char context,
BOOL  todo,
const char file,
int  line 
)
static

Definition at line 2802 of file msg.c.

2804{
2805 static const struct recvd_message end_of_sequence;
2806 const struct message *expected = expected_list;
2807 const struct recvd_message *actual;
2808 int failcount = 0, dump = 0;
2809 unsigned int count = 0;
2810 BOOL is_wine = !strcmp(winetest_platform, "wine");
2811
2812 add_message(&end_of_sequence);
2813
2814 actual = sequence;
2815
2817
2818 while (expected->message && actual->message)
2819 {
2820 if (messages_equal(expected, actual, !todo, file, line))
2821 {
2822 if (expected->flags & wparam)
2823 {
2824 if (((expected->wParam ^ actual->wParam) & ~expected->wp_mask) && todo)
2825 {
2826 todo_wine {
2827 failcount ++;
2828 dump++;
2829 ok_( file, line) (FALSE,
2830 "in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
2831 expected->message, expected->wParam, actual->wParam);
2832 }
2833 if (is_wine) goto done;
2834 }
2835 else
2836 {
2837 ok_( file, line)( ((expected->wParam ^ actual->wParam) & ~expected->wp_mask) == 0,
2838 "in msg 0x%04x expecting wParam 0x%Ix got 0x%Ix\n",
2839 expected->message, expected->wParam, actual->wParam);
2840 if ((expected->wParam ^ actual->wParam) & ~expected->wp_mask) dump++;
2841 }
2842
2843 }
2844 if (expected->flags & lparam)
2845 {
2846 if (((expected->lParam ^ actual->lParam) & ~expected->lp_mask) && todo)
2847 {
2848 todo_wine {
2849 failcount ++;
2850 dump++;
2851 ok_( file, line) (FALSE,
2852 "in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
2853 expected->message, expected->lParam, actual->lParam);
2854 }
2855 if (is_wine) goto done;
2856 }
2857 else
2858 {
2859 ok_( file, line)(((expected->lParam ^ actual->lParam) & ~expected->lp_mask) == 0,
2860 "in msg 0x%04x expecting lParam 0x%Ix got 0x%Ix\n",
2861 expected->message, expected->lParam, actual->lParam);
2862 if ((expected->lParam ^ actual->lParam) & ~expected->lp_mask) dump++;
2863 }
2864 }
2865 if ((expected->flags & defwinproc) != (actual->flags & defwinproc) && todo)
2866 {
2867 todo_wine {
2868 failcount ++;
2869 dump++;
2870 ok_( file, line) (FALSE,
2871 "the msg 0x%04x should %shave been sent by DefWindowProc\n",
2872 expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
2873 }
2874 if (is_wine) goto done;
2875 }
2876 else
2877 {
2878 ok_( file, line) ((expected->flags & defwinproc) == (actual->flags & defwinproc),
2879 "the msg 0x%04x should %shave been sent by DefWindowProc\n",
2880 expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
2881 if ((expected->flags & defwinproc) != (actual->flags & defwinproc)) dump++;
2882 }
2883
2884 ok_( file, line) ((expected->flags & beginpaint) == (actual->flags & beginpaint),
2885 "the msg 0x%04x should %shave been sent by BeginPaint\n",
2886 expected->message, (expected->flags & beginpaint) ? "" : "NOT ");
2887 if ((expected->flags & beginpaint) != (actual->flags & beginpaint)) dump++;
2888
2889 ok_( file, line) ((expected->flags & (sent|posted)) == (actual->flags & (sent|posted)),
2890 "the msg 0x%04x should have been %s\n",
2891 expected->message, (expected->flags & posted) ? "posted" : "sent");
2892 if ((expected->flags & (sent|posted)) != (actual->flags & (sent|posted))) dump++;
2893
2894 ok_( file, line) ((expected->flags & parent) == (actual->flags & parent),
2895 "the msg 0x%04x was expected in %s\n",
2896 expected->message, (expected->flags & parent) ? "parent" : "child");
2897 if ((expected->flags & parent) != (actual->flags & parent)) dump++;
2898
2899 expected++;
2900 count++;
2901 actual++;
2902 }
2903 /*
2904 * silently drop hook messages if there is no support for them
2905 */
2906 else if (can_skip_message(expected))
2907 {
2908 expected++;
2909 count++;
2910 }
2911 else if (todo)
2912 {
2914 failcount++;
2915 dump++;
2916 goto done;
2917 }
2918 else if (sequence_contains_message(expected, actual))
2919 {
2920 dump++;
2921 expected++;
2922 count++;
2923 }
2924 else
2925 {
2926 dump++;
2927 actual++;
2928 }
2929
2932 }
2933
2934 /* skip all optional trailing messages */
2935 while (can_skip_message(expected))
2936 {
2937 messages_equal(expected, actual, TRUE, file, line); /* check for message todo's */
2938 expected++;
2939 }
2940
2941 if (todo)
2942 {
2943 todo_wine {
2944 if (expected->message || actual->message) {
2945 failcount++;
2946 dump++;
2947 messages_equal(expected, actual, TRUE, file, line);
2948 }
2949 }
2950 if (is_wine && !failcount) /* succeeded yet marked todo */
2951 todo_wine {
2952 dump++;
2953 ok_( file, line)( TRUE, "marked \"todo_wine\" but succeeds\n");
2954 }
2955 }
2956 else
2957 {
2958 if (expected->message || actual->message)
2959 {
2960 dump++;
2961 messages_equal(expected, actual, TRUE, file, line);
2962 }
2963 }
2964
2965done:
2967 if (dump && (!is_wine || winetest_debug > 1)) dump_sequence(expected_list, context, file, line);
2969}
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
Definition: test.h:537
static void dump_sequence(const struct message *expected, const char *context, const char *file, int line)
Definition: msg.c:2745
static void dump(const void *ptr, unsigned len)
Definition: msc.c:95

Referenced by test_msg_setpos_().

◆ open_clipboard_()

static BOOL open_clipboard_ ( int  line,
HWND  hwnd 
)
static

Definition at line 18196 of file msg.c.

18197{
18199 while (1)
18200 {
18203 return ret;
18204 if (GetTickCount() - start > 100)
18205 {
18206 char classname[256];
18207 DWORD le = GetLastError();
18208 HWND clipwnd = GetOpenClipboardWindow();
18209 /* Provide a hint as to the source of interference:
18210 * - The class name would typically be CLIPBRDWNDCLASS if the
18211 * clipboard was opened by a Windows application using the
18212 * ole32 API.
18213 * - And it would be __wine_clipboard_manager if it was opened in
18214 * response to a native application.
18215 */
18217 trace_(__FILE__, line)("%p (%s) opened the clipboard\n", clipwnd, classname);
18218 SetLastError(le);
18219 return ret;
18220 }
18221 Sleep(15);
18222 }
18223}
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
WCHAR classname[128]
Definition: startup.c:15
HWND WINAPI GetOpenClipboardWindow(void)
Definition: ntwrapper.h:214
BOOL WINAPI OpenClipboard(_In_opt_ HWND)

Referenced by clear_clipboard_().

◆ PaintLoopProcA()

static LRESULT WINAPI PaintLoopProcA ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 11198 of file msg.c.

11199{
11200 switch (msg)
11201 {
11202 case WM_CREATE: return 0;
11203 case WM_PAINT:
11204 {
11205 MSG msg2;
11206 static int i = 0;
11207
11208 if (i < 256)
11209 {
11210 i++;
11211 if (PeekMessageA(&msg2, 0, 0, 0, 1))
11212 {
11213 TranslateMessage(&msg2);
11214 DispatchMessageA(&msg2);
11215 }
11216 i--;
11217 }
11218 else ok(broken(1), "infinite loop\n");
11219 if ( i == 0)
11222 }
11223 }
11225}
static BOOL paint_loop_done
Definition: msg.c:2336
#define WM_CREATE
Definition: winuser.h:1636

Referenced by register_classes().

◆ parent_menu_proc()

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

Definition at line 17573 of file msg.c.

17574{
17575 if (message == WM_ENTERIDLE ||
17576 message == WM_INITMENU ||
17582 message == WM_UNINITMENUPOPUP ||
17583 message == WM_KEYDOWN ||
17584 message == WM_KEYUP ||
17585 message == WM_CHAR ||
17587 message == WM_SYSKEYUP ||
17588 message == WM_SYSCHAR ||
17589 message == WM_COMMAND ||
17590 message == WM_MENUCOMMAND)
17591 {
17592 struct recvd_message msg;
17593
17594 msg.hwnd = hwnd;
17595 msg.message = message;
17596 msg.flags = sent|wparam|lparam;
17597 msg.wParam = wp;
17598 msg.lParam = lp;
17599 msg.descr = "parent_menu_proc";
17600 add_message(&msg);
17601 }
17602
17603 return DefWindowProcA(hwnd, message, wp, lp);
17604}
#define WM_SYSCHAR
Definition: winuser.h:1749
#define WM_EXITMENULOOP
Definition: winuser.h:1833
#define WM_CHAR
Definition: winuser.h:1745
#define WM_PARENTNOTIFY
Definition: winuser.h:1831
#define WM_MENUSELECT
Definition: winuser.h:1775

Referenced by test_menu_messages().

◆ ParentMsgCheckProcA()

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

Definition at line 11051 of file msg.c.

11052{
11053 static LONG defwndproc_counter = 0;
11054 static LONG beginpaint_counter = 0;
11055 LRESULT ret;
11056 struct recvd_message msg;
11057
11058 if (ignore_message( message )) return 0;
11059
11066 {
11067 switch (message)
11068 {
11069 /* ignore */
11070 case WM_NCHITTEST:
11071 return HTCLIENT;
11072 case WM_SETCURSOR:
11073 case WM_MOUSEMOVE:
11074 case WM_NCMOUSEMOVE:
11075 return 0;
11076 }
11077
11078 msg.hwnd = hwnd;
11079 msg.message = message;
11080 msg.flags = sent|parent|wparam|lparam;
11081 if (defwndproc_counter) msg.flags |= defwinproc;
11082 if (beginpaint_counter) msg.flags |= beginpaint;
11083 msg.wParam = wParam;
11084 msg.lParam = lParam;
11085 msg.descr = "parent";
11086 add_message(&msg);
11087 }
11088
11089 if (message == WM_PAINT)
11090 {
11091 PAINTSTRUCT ps;
11092 beginpaint_counter++;
11093 BeginPaint( hwnd, &ps );
11094 beginpaint_counter--;
11095 EndPaint( hwnd, &ps );
11096 return 0;
11097 }
11098
11099 defwndproc_counter++;
11101 defwndproc_counter--;
11102
11103 return message == WM_COMPAREITEM ? -1 : ret;
11104}
static int log_all_parent_messages
Definition: msg.c:2339
#define WM_CANCELMODE
Definition: winuser.h:1663
#define WM_SETFOCUS
Definition: winuser.h:1641
#define WM_KILLFOCUS
Definition: winuser.h:1642

Referenced by radio_test_dlg_proc(), and register_classes().

◆ PopupMsgCheckProcA()

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

Definition at line 11013 of file msg.c.

11014{
11015 static LONG defwndproc_counter = 0;
11016 LRESULT ret;
11017 struct recvd_message msg;
11018
11019 if (ignore_message( message )) return 0;
11020
11021 switch (message)
11022 {
11023 case WM_QUERYENDSESSION:
11024 case WM_ENDSESSION:
11025 lParam &= ~0x01; /* Vista adds a 0x01 flag */
11026 break;
11027 }
11028
11029 msg.hwnd = hwnd;
11030 msg.message = message;
11031 msg.flags = sent|wparam|lparam;
11032 if (defwndproc_counter) msg.flags |= defwinproc;
11033 msg.wParam = wParam;
11034 msg.lParam = lParam;
11035 msg.descr = "popup";
11036 add_message(&msg);
11037
11038 if (message == WM_CREATE)
11039 {
11042 }
11043
11044 defwndproc_counter++;
11046 defwndproc_counter--;
11047
11048 return ret;
11049}
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define WM_QUERYENDSESSION
Definition: winuser.h:1650
#define WM_ENDSESSION
Definition: winuser.h:1655

Referenced by register_classes().

◆ post_rbuttonup_msg()

static DWORD CALLBACK post_rbuttonup_msg ( void arg)
static

Definition at line 17953 of file msg.c.

17954{
17955 struct rbuttonup_thread_data *data = arg;
17956 DWORD ret;
17957
17958 ret = WaitForSingleObject( data->wndproc_finished, 500 );
17959 todo_wine ok( ret == WAIT_OBJECT_0, "WaitForSingleObject returned %lx\n", ret );
17960 if( ret == WAIT_OBJECT_0 ) return 0;
17961
17962 PostMessageA( data->hwnd, WM_RBUTTONUP, 0, 0 );
17963 return 0;
17964}
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define WM_RBUTTONUP
Definition: winuser.h:1808

Referenced by test_defwinproc().

◆ pump_msg_loop()

static void pump_msg_loop ( HWND  hwnd,
HACCEL  hAccel 
)
static

Definition at line 10576 of file msg.c.

10577{
10578 MSG msg;
10579
10580 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
10581 {
10582 struct recvd_message log_msg;
10583
10584 /* ignore some unwanted messages */
10585 if (msg.message == WM_MOUSEMOVE ||
10586 msg.message == WM_TIMER ||
10587 ignore_message( msg.message ))
10588 continue;
10589
10590 log_msg.hwnd = msg.hwnd;
10591 log_msg.message = msg.message;
10592 log_msg.flags = wparam|lparam;
10593 log_msg.wParam = msg.wParam;
10594 log_msg.lParam = msg.lParam;
10595 log_msg.descr = "accel";
10596 add_message(&log_msg);
10597
10599 {
10602 }
10603 }
10604}
HACCEL hAccel
Definition: main.c:47
int WINAPI TranslateAcceleratorA(_In_ HWND, _In_ HACCEL, _In_ LPMSG)

Referenced by test_accelerators(), and test_setwindowpos().

◆ pump_msg_loop_timeout()

static void pump_msg_loop_timeout ( DWORD  timeout,
BOOL  inject_mouse_move 
)
static

Definition at line 14831 of file msg.c.

14832{
14833 MSG msg;
14834 DWORD start_ticks, end_ticks;
14835
14836 start_ticks = GetTickCount();
14837 /* add some deviation (50%) to cover not expected delays */
14838 start_ticks += timeout / 2;
14839
14840 do
14841 {
14842 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
14843 {
14844 /* Timer proc messages are not dispatched to the window proc,
14845 * and therefore not logged.
14846 */
14847 if ((msg.message == WM_TIMER || msg.message == WM_SYSTIMER) && msg.hwnd)
14848 {
14849 struct recvd_message s_msg;
14850
14851 s_msg.hwnd = msg.hwnd;
14852 s_msg.message = msg.message;
14853 s_msg.flags = sent|wparam|lparam;
14854 s_msg.wParam = msg.wParam;
14855 s_msg.lParam = msg.lParam;
14856 s_msg.descr = "msg_loop";
14857 add_message(&s_msg);
14858 }
14860 }
14861
14862 end_ticks = GetTickCount();
14863
14864 /* inject WM_MOUSEMOVE to see how it changes tracking */
14865 if (inject_mouse_move && start_ticks + timeout / 2 >= end_ticks)
14866 {
14867 mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0);
14868 mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0);
14869
14870 inject_mouse_move = FALSE;
14871 }
14872 } while (start_ticks + timeout >= end_ticks);
14873}
#define WM_SYSTIMER
Definition: msg.c:53
Definition: dhcpd.h:248

Referenced by test_TrackMouseEvent().

◆ radio_test_dlg_proc()

static INT_PTR WINAPI radio_test_dlg_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 7480 of file msg.c.

7481{
7482 ParentMsgCheckProcA(hwnd, msg, wp, lp);
7483 return 1;
7484}
static LRESULT WINAPI ParentMsgCheckProcA(HWND, UINT, WPARAM, LPARAM)
Definition: msg.c:11051

Referenced by test_autoradio_BM_CLICK(), and test_autoradio_kbd_move().

◆ rec_get_message_hook()

static LRESULT WINAPI rec_get_message_hook ( int  code,
WPARAM  w,
LPARAM  l 
)
static

Definition at line 12591 of file msg.c.

12592{
12593 LRESULT res;
12594 MSG msg;
12595 BOOL b;
12596
12597 hook_depth++;
12600
12602 ok(b, "PeekMessage failed\n");
12603
12605
12606 hook_depth--;
12607 return res;
12608}
r l[0]
Definition: byte_order.h:168
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define b
Definition: ke_i.h:79
static HHOOK recursive_hook
Definition: msg.c:12565
static HWND hook_hwnd
Definition: msg.c:12564

Referenced by test_recursive_hook().

◆ recursive_messages_proc()

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

Definition at line 12782 of file msg.c.

12783{
12784 static int msg_depth;
12785 MSG msg;
12786
12787 if (message == WM_SETCURSOR && max_msg_depth < 15)
12788 {
12789 msg_depth++;
12790 max_msg_depth = max(max_msg_depth, msg_depth);
12791 PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE);
12792 msg_depth--;
12793 }
12794 return DefWindowProcA(hwnd, message, wp, lp);
12795}
static int max_msg_depth
Definition: msg.c:12780

Referenced by test_recursive_messages().

◆ recursive_viewer_proc()

static LRESULT CALLBACK recursive_viewer_proc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 18245 of file msg.c.

18246{
18247 static BOOL recursion_guard;
18248
18249 if (message == WM_DRAWCLIPBOARD && !recursion_guard)
18250 {
18251 recursion_guard = TRUE;
18253 recursion_guard = FALSE;
18254 }
18256}
static WNDPROC pOldViewerProc
Definition: msg.c:18243
#define clear_clipboard(hwnd)
Definition: msg.c:18225
#define WM_DRAWCLIPBOARD
Definition: winuser.h:1897

Referenced by test_clipboard_viewers().

◆ register_class()

static void register_class ( const WNDCLASSA class)
static

Definition at line 129 of file msg.c.

130{
131 BOOL ret = RegisterClassA(class);
132 ok(ret, "Failed to register class %s, error %lu.\n",
133 debugstr_a(class->lpszClassName), GetLastError());
134}
const WCHAR * class
Definition: main.c:68
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)

◆ register_classes()

static void register_classes ( void  )
static

Definition at line 11270 of file msg.c.

11271{
11272 WNDCLASSA cls;
11273 WNDCLASSW clsW;
11274
11275 cls.style = 0;
11277 cls.cbClsExtra = 0;
11278 cls.cbWndExtra = 0;
11279 cls.hInstance = GetModuleHandleA(0);
11280 cls.hIcon = 0;
11283 cls.lpszMenuName = NULL;
11284 cls.lpszClassName = "TestWindowClass";
11285 register_class(&cls);
11286
11288 cls.lpszClassName = "HotkeyWindowClass";
11289 register_class(&cls);
11290
11292 cls.lpszClassName = "ShowWindowClass";
11293 register_class(&cls);
11294
11296 cls.lpszClassName = "TestPopupClass";
11297 register_class(&cls);
11298
11300 cls.lpszClassName = "TestParentClass";
11301 register_class(&cls);
11302
11304 cls.lpszClassName = "StopQuitClass";
11305 register_class(&cls);
11306
11308 cls.lpszClassName = "SimpleWindowClass";
11309 register_class(&cls);
11310
11312 cls.lpszClassName = "PaintLoopWindowClass";
11313 register_class(&cls);
11314
11315 cls.style = CS_NOCLOSE;
11316 cls.lpszClassName = "NoCloseWindowClass";
11317 register_class(&cls);
11318
11319 ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n");
11320 cls.style = 0;
11321 cls.hInstance = GetModuleHandleA(0);
11322 cls.hbrBackground = 0;
11324 cls.lpszClassName = "TestDialogClass";
11325 register_class(&cls);
11326
11328 cls.style = CS_PARENTDC;
11329 cls.lpszClassName = "SimpleWindowClassWithParentDC";
11330 register_class(&cls);
11331
11332 clsW.style = 0;
11334 clsW.cbClsExtra = 0;
11335 clsW.cbWndExtra = 0;
11336 clsW.hInstance = GetModuleHandleW(0);
11337 clsW.hIcon = 0;
11338 clsW.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
11340 clsW.lpszMenuName = NULL;
11342 RegisterClassW(&clsW); /* ignore error, this fails on Win9x */
11343}
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
static LRESULT WINAPI MsgCheckProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11008
static LRESULT WINAPI ShowWindowProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11155
static const WCHAR testWindowClassW[]
Definition: msg.c:124
static LRESULT WINAPI PopupMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11013
static LRESULT WINAPI TestDlgProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11121
static LRESULT CALLBACK StopQuitMsgCheckProcA(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
Definition: msg.c:11106
static LRESULT WINAPI HotkeyMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11227
static LRESULT WINAPI PaintLoopProcA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11198
LPCWSTR lpszClassName
Definition: winuser.h:3293
LPCWSTR lpszMenuName
Definition: winuser.h:3292
HBRUSH hbrBackground
Definition: winuser.h:3291
HICON hIcon
Definition: winuser.h:3289
HINSTANCE hInstance
Definition: winuser.h:3288
int cbClsExtra
Definition: winuser.h:3286
UINT style
Definition: winuser.h:3284
WNDPROC lpfnWndProc
Definition: winuser.h:3285
int cbWndExtra
Definition: winuser.h:3287
HCURSOR hCursor
Definition: winuser.h:3290
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2474
#define CS_PARENTDC
Definition: winuser.h:664
#define CS_NOCLOSE
Definition: winuser.h:662

Referenced by START_TEST().

◆ register_wmime_keydown_class()

static void register_wmime_keydown_class ( void  )
static

Definition at line 8250 of file msg.c.

8251{
8252 WNDCLASSA cls;
8253
8254 ZeroMemory(&cls, sizeof(WNDCLASSA));
8256 cls.hInstance = GetModuleHandleA(0);
8257 cls.lpszClassName = "wmime_keydown_class";
8258 register_class(&cls);
8259}
#define ZeroMemory
Definition: minwinbase.h:31
static LRESULT WINAPI wmime_keydown_procA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:8235

Referenced by test_wmime_keydown_message().

◆ run_in_temp_desktop_()

static void run_in_temp_desktop_ ( const char file,
int  line,
const char name,
void(*)(void test_func 
)
static

Definition at line 9955 of file msg.c.

9956{
9958 HANDLE thread;
9959 DWORD result;
9960
9961 args.file = file;
9962 args.line = line;
9963 args.name = name;
9964 args.test_func = test_func;
9965
9967 ok_(file, line)( thread != NULL, "CreateThread error %lu\n", GetLastError() );
9968
9970 ok_(file, line)( result == WAIT_OBJECT_0, "WaitForSingleObject returned %lu, error %lu\n",
9971 result, GetLastError() );
9972
9974}
#define INFINITE
Definition: serial.h:102
static void test_func(IDispatchEx *obj)
Definition: script.c:1872
static DWORD WINAPI run_in_temp_desktop_thread_func(LPVOID param)
Definition: msg.c:9836
Definition: match.c:390
const char * file
Definition: msg.c:9830
const char * name
Definition: msg.c:9832

◆ run_in_temp_desktop_thread_func()

static DWORD WINAPI run_in_temp_desktop_thread_func ( LPVOID  param)
static

Definition at line 9836 of file msg.c.

9837{
9838 HDESK prev_thr_desktop, prev_inp_desktop, post_inp_desktop, temp_desktop;
9839 char temp_desktop_name[1024], curr_desktop_name[1024];
9841 const char *file = args->file;
9842 int line = args->line;
9843 LARGE_INTEGER qpc;
9844 DWORD length;
9845 int result;
9846
9848 ok_(file, line)( result, "QueryPerformanceCounter error %lu\n", GetLastError() );
9849
9850 /*
9851 * Temporary desktops from previous runs may leak due to a Windows bug.
9852 * Generate a unique name that is unlikely to collide with previous runs.
9853 */
9854 result = snprintf( temp_desktop_name, ARRAY_SIZE(temp_desktop_name),
9855 "WineTest-%08lX-%08lX-%08lX%08lX-%s",
9857 qpc.HighPart, qpc.LowPart, args->name );
9858 ok_(file, line)( result > 0 && result < ARRAY_SIZE(temp_desktop_name),
9859 "sprintf returned %d (out of memory, or name too long?)\n", result );
9860
9861 if (winetest_debug > 1)
9862 trace_(file, line)( "creating desktop: %s\n", debugstr_a( temp_desktop_name ) );
9863
9864 temp_desktop = CreateDesktopA( temp_desktop_name, NULL, NULL, 0, GENERIC_ALL, NULL );
9865 ok_(file, line)( temp_desktop != NULL, "CreateDesktopA(%s, ..) error %lu\n",
9866 debugstr_a( temp_desktop_name ), GetLastError() );
9867
9868 prev_inp_desktop = OpenInputDesktop( 0, FALSE, DESKTOP_SWITCHDESKTOP );
9869 ok_(file, line)( prev_inp_desktop != NULL, "OpenInputDesktop [prev] error %lu\n", GetLastError() );
9870
9871 if (winetest_debug > 1)
9872 trace_(file, line)( "sanity check: no concurrent WineTest desktop\n" );
9873
9874 /*
9875 * Check if the desktop has not been properly restored. This is done to
9876 * avoid any possible hard-to-debug failures due to unexpected desktop.
9877 */
9878 result = GetUserObjectInformationA( prev_inp_desktop, UOI_NAME,
9879 curr_desktop_name, sizeof(curr_desktop_name), &length );
9880 ok_(file, line)( result, "GetUserObjectInformationA error %lu [rl = %lu]\n",
9881 GetLastError(), length );
9882 ok_(file, line)( _strnicmp( curr_desktop_name, temp_desktop_name, 8 ) != 0,
9883 "unexpected input desktop name %s (concurrent WineTest run?)\n",
9884 debugstr_a( curr_desktop_name ) );
9885
9886 if (winetest_debug > 1)
9887 trace_(file, line)( "switching desktop to: %s (%p)\n", debugstr_a( temp_desktop_name ), temp_desktop );
9888
9889 result = SwitchDesktop( temp_desktop );
9890 ok_(file, line)( result, "SwitchDesktop(temp_desktop=%p) error %lu\n",
9891 temp_desktop, GetLastError() );
9892
9893 prev_thr_desktop = GetThreadDesktop( GetCurrentThreadId() );
9894 ok_(file, line)( prev_thr_desktop != NULL, "GetThreadDesktop error %lu\n", GetLastError() );
9895
9896 result = SetThreadDesktop( temp_desktop );
9897 ok_(file, line)( result, "SetThreadDesktop(temp_desktop=%p) error %lu\n",
9898 temp_desktop, GetLastError() );
9899
9900 if (winetest_debug > 1)
9901 trace_(file, line)( "running test function %s()\n", args->name );
9902
9903 args->test_func();
9904
9905 if (winetest_debug > 1)
9906 trace_(file, line)( "sanity check: input desktop has not been changed\n" );
9907
9908 /*
9909 * Check if the input desktop has been tampered with. This is done to
9910 * avoid any possible hard-to-debug failures due to unexpected desktop.
9911 */
9912 post_inp_desktop = OpenInputDesktop( 0, FALSE, DESKTOP_ENUMERATE );
9913 ok_(file, line)( post_inp_desktop != NULL, "OpenInputDesktop [post] error %lu\n", GetLastError() );
9914
9915 result = GetUserObjectInformationA( post_inp_desktop, UOI_NAME,
9916 curr_desktop_name, sizeof(curr_desktop_name), &length );
9917 ok_(file, line)( result, "GetUserObjectInformationA(post_inp_desktop=%p) error %lu [rl = %lu]\n",
9918 post_inp_desktop, GetLastError(), length );
9919 ok_(file, line)( strcmp( curr_desktop_name, temp_desktop_name ) == 0,
9920 "different desktop name: %s != %s (no switch or concurrent WineTest run?)\n",
9921 debugstr_a( curr_desktop_name ), debugstr_a( temp_desktop_name ) );
9922
9923 result = CloseDesktop( post_inp_desktop );
9924 ok_(file, line)( result, "CloseDesktop(post_inp_desktop=%p) error %lu\n",
9925 post_inp_desktop, GetLastError() );
9926
9927 if (winetest_debug > 1)
9928 trace_(file, line)( "restoring previous desktop\n" );
9929
9930 result = SetThreadDesktop( prev_thr_desktop );
9931 ok_(file, line)( result || broken( GetLastError() == ERROR_BUSY ) /* == W10 */,
9932 "SetThreadDesktop(prev_thr_desktop=%p) error %lu\n",
9933 prev_thr_desktop, GetLastError() );
9934
9935 result = SwitchDesktop( prev_inp_desktop );
9936 ok_(file, line)( result, "SwitchDesktop(prev_inp_desktop=%p) error %lu\n",
9937 prev_inp_desktop, GetLastError() );
9938
9939 result = CloseDesktop( prev_inp_desktop );
9940 ok_(file, line)( result, "CloseDesktop(prev_inp_desktop=%p) error %lu\n",
9941 prev_inp_desktop, GetLastError() );
9942
9943 if (winetest_debug > 1)
9944 trace_(file, line)( "closing desktop: %s (%p)\n", debugstr_a( temp_desktop_name ), temp_desktop );
9945
9946 result = CloseDesktop( temp_desktop );
9947 ok_(file, line)( result || broken( GetLastError() == ERROR_BUSY ) /* == W10 */,
9948 "CloseDesktop(temp_desktop=%p) error %lu\n",
9949 temp_desktop, GetLastError() );
9950
9951 return 0;
9952}
#define ERROR_BUSY
Definition: dderror.h:12
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define GENERIC_ALL
Definition: nt_native.h:92
ULONG LowPart
Definition: typedefs.h:106
HDESK WINAPI CreateDesktopA(LPCSTR lpszDesktop, LPCSTR lpszDevice, LPDEVMODEA pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
Definition: desktop.c:431
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1156
#define snprintf
Definition: wintirpc.h:48
HDESK WINAPI GetThreadDesktop(_In_ DWORD)
BOOL WINAPI SwitchDesktop(_In_ HDESK)
BOOL WINAPI SetThreadDesktop(_In_ HDESK)
#define UOI_NAME
Definition: winuser.h:1095
HDESK WINAPI OpenInputDesktop(_In_ DWORD, _In_ BOOL, _In_ DWORD)
#define DESKTOP_ENUMERATE
Definition: winuser.h:218
#define DESKTOP_SWITCHDESKTOP
Definition: winuser.h:223
BOOL WINAPI GetUserObjectInformationA(_In_ HANDLE hObj, _In_ int nIndex, _Out_writes_bytes_opt_(nLength) PVOID pvInfo, _In_ DWORD nLength, _Out_opt_ LPDWORD lpnLengthNeeded)
BOOL WINAPI CloseDesktop(_In_ HDESK)

Referenced by run_in_temp_desktop_().

◆ send_message_thread()

static DWORD WINAPI send_message_thread ( void arg)
static

Definition at line 20396 of file msg.c.

20397{
20398 HWND win = arg;
20399
20400 SendMessageA( win, WM_USER, 0, 0 );
20401 SendNotifyMessageA( win, WM_USER + 1, 0, 0 );
20402 SendMessageCallbackA( win, WM_USER + 2, 0, 0, msg_callback, 0 );
20403 PostMessageA( win, WM_USER + 3, 0, 0 );
20404 PostMessageA( win, WM_QUIT, 0, 0 );
20405 return 0;
20406}
static real win[4][36]
static void CALLBACK msg_callback(HWND hwnd, UINT msg, ULONG_PTR arg, LRESULT result)
Definition: msg.c:20390
#define WM_QUIT
Definition: winuser.h:1651
BOOL WINAPI SendNotifyMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SendMessageCallbackA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ SENDASYNCPROC, _In_ ULONG_PTR)

Referenced by test_InSendMessage().

◆ send_msg_delay_proc()

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

Definition at line 13174 of file msg.c.

13175{
13176 if (message == WM_USER) Sleep(200);
13177 return MsgCheckProcA( hwnd, message, wParam, lParam );
13178}

Referenced by test_SendMessageTimeout().

◆ send_msg_thread()

static DWORD CALLBACK send_msg_thread ( LPVOID  arg)
static

Definition at line 13153 of file msg.c.

13154{
13155 struct sendmsg_info *info = arg;
13156 SetLastError( 0xdeadbeef );
13157 SetEvent( info->ready );
13158 info->ret = SendMessageTimeoutA( info->hwnd, WM_USER, 0, 0, 0, info->timeout, NULL );
13159 if (!info->ret) ok( GetLastError() == ERROR_TIMEOUT ||
13160 broken(GetLastError() == 0), /* win9x */
13161 "unexpected error %ld\n", GetLastError());
13162 return 0;
13163}
#define ERROR_TIMEOUT
Definition: winerror.h:1286
LRESULT WINAPI SendMessageTimeoutA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)

Referenced by test_SendMessageTimeout().

◆ send_msg_thread_2()

static DWORD CALLBACK send_msg_thread_2 ( void param)
static

Definition at line 13840 of file msg.c.

13841{
13842 DWORD ret;
13843 struct peekmsg_info *info = param;
13844
13845 if (winetest_debug > 1) trace("thread: looping\n");
13846 SetEvent(info->hevent[EV_ACK]);
13847
13848 while (1)
13849 {
13851
13852 switch (ret)
13853 {
13854 case WAIT_OBJECT_0 + EV_STOP:
13855 if (winetest_debug > 1) trace("thread: exiting\n");
13856 return 0;
13857
13859 if (winetest_debug > 1) trace("thread: sending message\n");
13860 ret = SendNotifyMessageA(info->hwnd, WM_USER, 0, 0);
13861 ok(ret, "SendNotifyMessageA failed error %lu\n", GetLastError());
13862 SetEvent(info->hevent[EV_ACK]);
13863 break;
13864
13865 default:
13866 ok(0, "Unexpected return %#lx.\n", ret);
13867 break;
13868 }
13869 }
13870 return 0;
13871}
#define EV_ACK
Definition: msg.c:13832
#define EV_SENDMSG
Definition: msg.c:13831
#define EV_STOP
Definition: msg.c:13830
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
Definition: synch.c:151

Referenced by test_PeekMessage().

◆ SendMessage_thread_1()

static DWORD WINAPI SendMessage_thread_1 ( void param)
static

Definition at line 20180 of file msg.c.

20181{
20182 struct wnd_event *wnd_event = param;
20183 DWORD ret;
20184
20185 if (winetest_debug > 1) trace("thread: starting\n");
20187
20188 if (winetest_debug > 1) trace("thread: call PostMessage\n");
20190
20191 if (winetest_debug > 1) trace("thread: call PostMessage\n");
20193
20194 if (winetest_debug > 1) trace("thread: call SendMessage\n");
20198 ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed, ret:%lx\n", ret);
20199
20200 if (winetest_debug > 1) trace("thread: call SendMessage\n");
20202
20203 return 0;
20204}
HANDLE getmessage_complete
Definition: msg.c:9982

Referenced by test_SendMessage_other_thread().

◆ sequence_contains_message()

static BOOL sequence_contains_message ( const struct message expected,
const struct recvd_message actual 
)
static

Definition at line 2734 of file msg.c.

2735{
2736 while (expected->message)
2737 {
2738 if (messages_equal(expected, actual, FALSE, __FILE__, __LINE__))
2739 return TRUE;
2740 expected++;
2741 }
2742 return FALSE;
2743}

Referenced by dump_sequence(), and ok_sequence_().

◆ set_menu_style()

static void set_menu_style ( HMENU  hmenu,
DWORD  style 
)
static

Definition at line 17606 of file msg.c.

17607{
17608 MENUINFO mi;
17609 BOOL ret;
17610
17611 mi.cbSize = sizeof(mi);
17612 mi.fMask = MIM_STYLE;
17613 mi.dwStyle = style;
17614 SetLastError(0xdeadbeef);
17615 ret = SetMenuInfo(hmenu, &mi);
17616 ok(ret, "SetMenuInfo error %lu\n", GetLastError());
17617}
BOOL WINAPI SetMenuInfo(_In_ HMENU, _In_ LPCMENUINFO)

Referenced by test_menu_messages().

◆ set_radio()

static void set_radio ( HWND  radio1,
int  state1,
HWND  radio2,
int  state2,
HWND  radio3,
int  state3 
)
static

Definition at line 7579 of file msg.c.

7580{
7581 SendMessageA(radio1, BM_SETCHECK, state1 ? BST_CHECKED : BST_UNCHECKED, 0);
7582 SendMessageA(radio2, BM_SETCHECK, state2 ? BST_CHECKED : BST_UNCHECKED, 0);
7583 SendMessageA(radio3, BM_SETCHECK, state3 ? BST_CHECKED : BST_UNCHECKED, 0);
7584}
#define BST_UNCHECKED
Definition: winuser.h:199
#define BST_CHECKED
Definition: winuser.h:197

Referenced by test_autoradio_kbd_move().

◆ SetParent_thread()

static DWORD WINAPI SetParent_thread ( void param)
static

Definition at line 20295 of file msg.c.

20296{
20297 struct wnd_event *wnd_event = param;
20298
20299 if (winetest_debug > 1) trace("thread: started\n");
20301
20302 /* this leads to sending an internal message under Wine */
20303 if (winetest_debug > 1) trace("thread: call SetParent\n");
20305
20306 return 0;
20307}
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)

Referenced by test_setparent_status().

◆ show_window_thread()

static DWORD CALLBACK show_window_thread ( LPVOID  arg)
static

Definition at line 5528 of file msg.c.

5529{
5530 HWND hwnd = arg;
5531
5532 /* function will not return if ShowWindow(SW_SHOW) calls SendMessage() */
5533 ok( ShowWindow( hwnd, SW_SHOW ), "ShowWindow(SW_SHOW) expected TRUE\n" ); /* actually it's 24... */
5534
5535 return 0;
5536}

Referenced by test_messages().

◆ ShowWindowProcA()

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

Definition at line 11155 of file msg.c.

11156{
11157 static LONG defwndproc_counter = 0;
11158 LRESULT ret;
11159 struct recvd_message msg;
11160
11161 /* log only specific messages we are interested in */
11162 switch (message)
11163 {
11164#if 0 /* probably log these as well */
11165 case WM_ACTIVATE:
11166 case WM_SETFOCUS:
11167 case WM_KILLFOCUS:
11168#endif
11169 case WM_SHOWWINDOW:
11170 case WM_SIZE:
11171 case WM_MOVE:
11172 case WM_GETMINMAXINFO:
11175 break;
11176
11177 default: /* ignore */
11178 /*trace("showwindow: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);*/
11180 }
11181
11182 msg.hwnd = hwnd;
11183 msg.message = message;
11184 msg.flags = sent|wparam|lparam;
11185 if (defwndproc_counter) msg.flags |= defwinproc;
11186 msg.wParam = wParam;
11187 msg.lParam = lParam;
11188 msg.descr = "show";
11189 add_message(&msg);
11190
11191 defwndproc_counter++;
11193 defwndproc_counter--;
11194
11195 return ret;
11196}
#define WM_SIZE
Definition: winuser.h:1639
#define WM_ACTIVATE
Definition: winuser.h:1640
#define WM_SHOWWINDOW
Definition: winuser.h:1656
#define WM_MOVE
Definition: winuser.h:1638

Referenced by register_classes().

◆ simulate_click()

static void simulate_click ( BOOL  left,
int  x,
int  y 
)
static

Definition at line 12569 of file msg.c.

12570{
12571 POINT old_pt;
12572 INPUT input[2];
12573 UINT events_no;
12574
12575 GetCursorPos(&old_pt);
12576 SetCursorPos(x, y);
12577 memset(input, 0, sizeof(input));
12578 input[0].type = INPUT_MOUSE;
12579 input[0].mi.dx = x;
12580 input[0].mi.dy = y;
12582 input[1].type = INPUT_MOUSE;
12583 input[1].mi.dx = x;
12584 input[1].mi.dy = y;
12586 events_no = SendInput(2, input, sizeof(input[0]));
12587 ok(events_no == 2, "SendInput returned %d\n", events_no);
12588 SetCursorPos(old_pt.x, old_pt.y);
12589}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint left
Definition: glext.h:7726
GLenum GLenum GLenum input
Definition: glext.h:9031
unsigned int UINT
Definition: ndis.h:50
UINT WINAPI SendInput(UINT, LPINPUT, int)
Definition: ntwrapper.h:344
#define INPUT_MOUSE
Definition: winable.h:9
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3064
#define MOUSEEVENTF_RIGHTUP
Definition: winuser.h:1198
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:3056
#define MOUSEEVENTF_LEFTDOWN
Definition: winuser.h:1195
#define MOUSEEVENTF_RIGHTDOWN
Definition: winuser.h:1197

Referenced by test_recursive_hook(), and test_recursive_messages().

◆ START_TEST()

START_TEST ( msg  )

Definition at line 20880 of file msg.c.

20881{
20882 char **test_argv;
20883 BOOL ret;
20884 BOOL (WINAPI *pIsWinEventHookInstalled)(DWORD)= 0;/*GetProcAddress(user32, "IsWinEventHookInstalled");*/
20885 int argc;
20886
20887#ifdef __REACTOS__
20888 // Temp for now to see where this is crashing on WS03 testbot
20889 winetest_debug = 2;
20890#endif
20892 if (argc >= 3)
20893 {
20894 unsigned int arg;
20895 /* Child process. */
20896 sscanf (test_argv[2], "%d", (unsigned int *) &arg);
20898 return;
20899 }
20900
20902 init_procs();
20903 ImmDisableIME(0);
20904
20906
20907 if (pSetWinEventHook)
20908 {
20909 hEvent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX,
20911 0, GetCurrentThreadId(),
20913 if (pIsWinEventHookInstalled && hEvent_hook)
20914 {
20915 UINT event;
20916 for (event = EVENT_MIN; event <= EVENT_MAX; event++)
20917 ok(pIsWinEventHookInstalled(event), "IsWinEventHookInstalled(%u) failed\n", event);
20918 }
20919 }
20920 if (!hEvent_hook) win_skip( "no win event hook support\n" );
20921
20924 if (!hCBT_hook) win_skip( "cannot set global hook, will skip hook tests\n" );
20925
20930 test_SetFocus();
20941 test_messages();
20963 test_timers();
20966 if (hCBT_hook)
20967 {
20968 test_set_hook();
20970 }
20983
20984 if (!pTrackMouseEvent)
20985 win_skip("TrackMouseEvent is not available\n");
20986 else
20988
20990 test_sys_menu();
20996#ifdef __REACTOS__
20997 trace("Running test_defwinproc()...\n");
20999 trace("Running test_desktop_winproc()...\n");
21001 trace("Running test_clipboard_viewers()...\n");
21003 trace("Running test_keyflags()...\n");
21004 test_keyflags();
21005 trace("Running test_hotkey()...\n");
21006 test_hotkey();
21007 trace("Running test_layered_window()...\n");
21009 trace("Running test_TrackPopupMenu()...\n");
21011 trace("Running test_TrackPopupMenuEmpty()...\n");
21013 trace("Running test_DoubleSetCapture()...\n");
21015 trace("Running test_create_name()...\n");
21017 trace("Running test_hook_changing_window_proc()...\n");
21019 trace("Running test_hook_cleanup()...\n");
21021#else
21025 test_keyflags();
21026 test_hotkey();
21033#endif
21034 /* keep it the last test, under Windows it tends to break the tests
21035 * which rely on active/foreground windows being correct.
21036 */
21037#ifdef __REACTOS__
21038 trace("Running test_SetForegroundWindow()...");
21039#endif
21041
21043 if (pUnhookWinEvent && hEvent_hook)
21044 {
21045 ret = pUnhookWinEvent(hEvent_hook);
21046 ok( ret, "UnhookWinEvent error %ld\n", GetLastError());
21047 SetLastError(0xdeadbeef);
21048 ok(!pUnhookWinEvent(hEvent_hook), "UnhookWinEvent succeeded\n");
21049 ok(GetLastError() == ERROR_INVALID_HANDLE || /* Win2k */
21050 GetLastError() == 0xdeadbeef, /* Win9x */
21051 "unexpected error %ld\n", GetLastError());
21052 }
21054}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
MonoAssembly int argc
Definition: metahost.c:107
_ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl _ACRTIMP int __cdecl sscanf(const char *, const char *,...) __WINE_CRT_SCANF_ATTR(2
BOOL WINAPI ImmDisableIME(_In_ DWORD dwThreadId)
Definition: ime.c:631
#define win_skip
Definition: minitest.h:67
static char ** test_argv
Definition: cursoricon.c:296
static void test_nullCallback(void)
Definition: msg.c:16328
static void test_swp_paint_region_on_extend_zerosize(void)
Definition: msg.c:9646
static void test_WaitForInputIdle(char *argv0)
Definition: msg.c:18842
static void test_DispatchMessage(void)
Definition: msg.c:13064
static void test_SendMessage_other_thread(void)
Definition: msg.c:20206
static void do_wait_idle_child(int arg)
Definition: msg.c:18662
static void test_notify_message(void)
Definition: msg.c:14762
static void test_edit_messages(void)
Definition: msg.c:13696
static void test_dialog_messages(void)
Definition: msg.c:15988
static void test_SetFocus(void)
Definition: msg.c:19625
static void test_PeekMessage3(void)
Definition: msg.c:14486
static void test_InSendMessage(void)
Definition: msg.c:20408
static void init_procs(void)
Definition: msg.c:2354
static void CALLBACK win_event_proc(HWINEVENTHOOK hevent, DWORD event, HWND hwnd, LONG object_id, LONG child_id, DWORD thread_id, DWORD event_time)
Definition: msg.c:11432
static void test_restore_messages(void)
Definition: msg.c:20522
static void test_layered_window(void)
Definition: msg.c:19868
static void test_button_messages(void)
Definition: msg.c:6869
static void test_invalid_window(void)
Definition: msg.c:20575
static void test_DestroyWindow(void)
Definition: msg.c:12945
static void test_clipboard_viewers(void)
Definition: msg.c:18258
static void test_paint_messages(void)
Definition: msg.c:8487
static void test_static_messages(void)
Definition: msg.c:7801
static void test_button_style(void)
Definition: msg.c:20591
static void test_sys_menu(void)
Definition: msg.c:5246
static void test_desktop_winproc(void)
Definition: msg.c:18135
static void test_messages(void)
Definition: msg.c:5556
static void test_autoradio_BM_CLICK(void)
Definition: msg.c:7486
static void test_swp_paint_region_on_show(void)
Definition: msg.c:9551
static void test_hvredraw(void)
Definition: msg.c:9808
static void register_classes(void)
Definition: msg.c:11270
static void test_PostMessage(void)
Definition: msg.c:18393
static void test_SetParent(void)
Definition: msg.c:18956
static void test_swp_paint_regions(void)
Definition: msg.c:9543
static void test_unicode_wm_char(void)
Definition: msg.c:16886
static void test_SetWindowRgn(void)
Definition: msg.c:15111
static void test_wmime_keydown_message(void)
Definition: msg.c:8261
static void test_timers_no_wnd(void)
Definition: msg.c:11810
static void test_keyflags(void)
Definition: msg.c:19055
static void test_autoradio_kbd_move(void)
Definition: msg.c:7586
static void test_TrackMouseEvent(void)
Definition: msg.c:14875
static void test_SetForegroundWindow(void)
Definition: msg.c:16527
static void test_quit_message(void)
Definition: msg.c:14663
static void test_defwinproc(void)
Definition: msg.c:17966
static void test_setparent_status(void)
Definition: msg.c:20309
static void test_menu_messages(void)
Definition: msg.c:17634
static void invisible_parent_tests(void)
Definition: msg.c:6289
static void test_TrackPopupMenuEmpty(void)
Definition: msg.c:20133
static void test_create_name(void)
Definition: msg.c:20641
static void test_SetActiveWindow(void)
Definition: msg.c:16456
static void test_PeekMessage2(void)
Definition: msg.c:14393
static void test_message_conversion(void)
Definition: msg.c:11516
static void test_mdi_messages(void)
Definition: msg.c:4177
static void test_winevents(void)
Definition: msg.c:12172
static LRESULT CALLBACK cbt_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11373
static void test_paintingloop(void)
Definition: msg.c:17800
static void test_recursive_hook(void)
Definition: msg.c:12680
static void test_broadcast(void)
Definition: msg.c:18476
static void test_radiobutton_focus(void)
Definition: msg.c:20700
static void test_PeekMessage(void)
Definition: msg.c:13873
static void test_EndDialog(void)
Definition: msg.c:16214
static void test_listbox_messages(void)
Definition: msg.c:17164
static void test_scrollwindowex(void)
Definition: msg.c:12855
static void test_DoubleSetCapture(void)
Definition: msg.c:20446
static void test_showwindow(void)
Definition: msg.c:5037
#define run_in_temp_desktop(f)
Definition: msg.c:9954
static void test_ShowWindow(void)
Definition: msg.c:15486
static void test_TrackPopupMenu(void)
Definition: msg.c:20054
static DWORD winevent_hook_thread_id
Definition: msg.c:122
static void test_combobox_messages(void)
Definition: msg.c:8079
static void test_recursive_messages(void)
Definition: msg.c:12797
static void test_hotkey(void)
Definition: msg.c:19278
static void test_timers_exceptions(void)
Definition: msg.c:11898
static void test_button_bm_get_set_image(void)
Definition: msg.c:7202
static void test_hook_changing_window_proc(void)
Definition: msg.c:20683
static void test_dbcs_wm_char(void)
Definition: msg.c:16565
static void test_interthread_messages(void)
Definition: msg.c:10111
static void test_set_hook(void)
Definition: msg.c:12406
static void test_hook_cleanup(void)
Definition: msg.c:20848
static void test_setwindowpos(void)
Definition: msg.c:6213
static void test_accelerators(void)
Definition: msg.c:10606
static void test_SendMessageTimeout(void)
Definition: msg.c:13180
static void test_timers(void)
Definition: msg.c:11745
#define BOOL
Definition: nt_native.h:43
#define DWORD
Definition: nt_native.h:44
int winetest_get_mainargs(char ***pargv)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:687
#define WINEVENT_INCONTEXT
Definition: winable.h:35
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define WINAPI
Definition: msvc.h:6
#define WH_CBT
Definition: winuser.h:35
HHOOK WINAPI SetWindowsHookExA(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
BOOL WINAPI UnhookWindowsHookEx(_In_ HHOOK)

◆ static_hook_proc()

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

Definition at line 7760 of file msg.c.

7761{
7762 static LONG defwndproc_counter = 0;
7763 LRESULT ret;
7764 struct recvd_message msg;
7765
7766 if (ignore_message( message )) return 0;
7767
7768 msg.hwnd = hwnd;
7769 msg.message = message;
7770 msg.flags = sent|wparam|lparam;
7771 if (defwndproc_counter) msg.flags |= defwinproc;
7772 msg.wParam = wParam;
7773 msg.lParam = lParam;
7774 msg.descr = "static";
7775 add_message(&msg);
7776
7777 defwndproc_counter++;
7779 defwndproc_counter--;
7780
7781 return ret;
7782}
static WNDPROC old_static_proc
Definition: msg.c:7758

Referenced by subclass_static().

◆ StopQuitMsgCheckProcA()

static LRESULT CALLBACK StopQuitMsgCheckProcA ( HWND  hwnd,
UINT  message,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 11106 of file msg.c.

11107{
11108 if (message == WM_CREATE)
11109 PostMessageA(hwnd, WM_CLOSE, 0, 0);
11110 else if (message == WM_CLOSE)
11111 {
11112 /* Only the first WM_QUIT will survive the window destruction */
11113 PostMessageA(hwnd, WM_USER, 0x1234, 0x5678);
11114 PostMessageA(hwnd, WM_QUIT, 0x1234, 0x5678);
11115 PostMessageA(hwnd, WM_QUIT, 0x4321, 0x8765);
11116 }
11117
11118 return DefWindowProcA(hwnd, message, wp, lp);
11119}
#define WM_CLOSE
Definition: winuser.h:1649

Referenced by register_classes().

◆ subclass_button()

static void subclass_button ( void  )
static

Definition at line 6852 of file msg.c.

6853{
6854 WNDCLASSA cls;
6855 BOOL ret;
6856
6857 ret = GetClassInfoA(0, "button", &cls);
6858 ok(ret, "Failed to get class info, error %lu.\n", GetLastError());
6859
6861
6864 cls.lpszClassName = "my_button_class";
6866 register_class(&cls);
6867}
static LRESULT CALLBACK button_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:6801
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)

Referenced by test_autoradio_BM_CLICK(), test_autoradio_kbd_move(), and test_button_messages().

◆ subclass_combobox()

static void subclass_combobox ( void  )
static

Definition at line 8062 of file msg.c.

8063{
8064 WNDCLASSA cls;
8065 BOOL ret;
8066
8067 ret = GetClassInfoA(0, "ComboBox", &cls);
8068 ok(ret, "Failed to get class info, error %lu.\n", GetLastError());
8069
8071
8074 cls.lpszClassName = "my_combobox_class";
8076 register_class(&cls);
8077}
static LRESULT CALLBACK combobox_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:8030

Referenced by test_combobox_messages().

◆ subclass_edit()

static void subclass_edit ( void  )
static

Definition at line 13679 of file msg.c.

13680{
13681 WNDCLASSA cls;
13682 BOOL ret;
13683
13684 ret = GetClassInfoA(0, "edit", &cls);
13685 ok(ret, "Failed to get class info, error %lu.\n", GetLastError());
13686
13688
13691 cls.lpszClassName = "my_edit_class";
13693 register_class(&cls);
13694}
static LRESULT CALLBACK edit_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:13405

Referenced by test_dialog_messages(), and test_edit_messages().

◆ subclass_static()

static void subclass_static ( void  )
static

Definition at line 7784 of file msg.c.

7785{
7786 WNDCLASSA cls;
7787 BOOL ret;
7788
7789 ret = GetClassInfoA(0, "static", &cls);
7790 ok(ret, "Failed to get class info, error %lu.\n", GetLastError());
7791
7793
7796 cls.lpszClassName = "my_static_class";
7798 register_class(&cls);
7799}
static LRESULT CALLBACK static_hook_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:7760

Referenced by test_static_messages().

◆ subtest_hvredraw()

static void subtest_hvredraw ( HWND  hparent,
UINT  class_style,
DWORD  style 
)
static

Definition at line 9703 of file msg.c.

9704{
9705 static const struct movesize_test {
9706 int dx, dy, dw, dh;
9707 } movesize_tests[] = {
9708 { 0, 0, 0, 5 },
9709 { 0, 0, 5, 0 },
9710 { 0, 0, 5, 5 },
9711 { 0, 0, -5, -5 },
9712 { -5, -5, 0, 5 },
9713 { -5, -5, 5, 0 },
9714 { -5, -5, 5, 5 },
9715 };
9716 HRGN hrgn_old_vis = CreateRectRgn( 0, 0, 0, 0 );
9717 HRGN hrgn_new_vis = CreateRectRgn( 0, 0, 0, 0 );
9718 HRGN hrgn_expect = CreateRectRgn( 0, 0, 0, 0 );
9719 HRGN hrgn_actual = CreateRectRgn( 0, 0, 0, 0 );
9720 const int x0 = 100, y0 = 100, w0 = 150, h0 = 150;
9721 size_t i;
9722 HWND hwnd;
9723 WNDCLASSA cls = {
9724 .style = class_style,
9725 .lpfnWndProc = DefWindowProcA,
9726 .hInstance = GetModuleHandleA(0),
9727 .hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW),
9728 .hbrBackground = GetStockObject(WHITE_BRUSH),
9729 .lpszClassName = "TestHVRedrawClass"
9730 };
9731
9732 register_class(&cls);
9733
9734 hwnd = CreateWindowExA( 0, cls.lpszClassName, "Test window", style, x0, y0, w0, h0, hparent, 0, 0, NULL );
9735 ok(hwnd != NULL, "Failed to create the window\n");
9736
9738 UpdateWindow( hwnd );
9739
9740 for (i = 0; i < ARRAY_SIZE(movesize_tests); i++)
9741 {
9742 const struct movesize_test *test = &movesize_tests[i];
9743 int is_redraw = (test->dw != 0 && (class_style & CS_HREDRAW)) ||
9744 (test->dh != 0 && (class_style & CS_VREDRAW));
9745 RECT rect_old_vis, rect_new_vis;
9746 BOOL rgn_ok;
9747
9748 winetest_push_context( "%x %08lx SetWindowPos redraw #%Id (%d, %d, %d, %d)",
9749 class_style, style, i, test->dx, test->dy, test->dw, test->dh );
9750
9752
9753 GetClientRect( hwnd, &rect_old_vis );
9754 SetRectRgn( hrgn_old_vis, rect_old_vis.left, rect_old_vis.top, rect_old_vis.right, rect_old_vis.bottom );
9755
9756 UpdateWindow( hparent );
9757 flush_events();
9758
9760 x0 + test->dx, y0 + test->dy,
9761 w0 + test->dw, h0 + test->dh, SWP_NOACTIVATE );
9762 ok( GetUpdateRgn( hwnd, hrgn_actual, FALSE ) != ERROR, "GetUpdateRgn shall succeed\n" );
9763
9764 GetClientRect( hwnd, &rect_new_vis );
9765 SetRectRgn( hrgn_new_vis, rect_new_vis.left, rect_new_vis.top, rect_new_vis.right, rect_new_vis.bottom );
9766 CombineRgn( hrgn_expect, hrgn_new_vis, hrgn_old_vis, is_redraw ? RGN_COPY : RGN_DIFF );
9767
9768 rgn_ok = EqualRgn( hrgn_expect, hrgn_actual );
9769#ifdef __REACTOS__
9770 ok( !!rgn_ok || broken(GetNTVersion() == _WIN32_WINNT_WINBLUE), "Update region shall match expected region\n" );
9771#else
9772 ok( !!rgn_ok, "Update region shall match expected region\n" );
9773#endif
9774
9775 if (!rgn_ok)
9776 {
9777 trace( "Expected update region: " );
9778 dump_region( hrgn_expect );
9779 trace( "Actual update region: " );
9780 dump_region( hrgn_actual );
9781 trace( "Old window visible area: %s\n", wine_dbgstr_rect( &rect_old_vis ) );
9782 trace( "New window visible area: %s\n", wine_dbgstr_rect( &rect_new_vis ) );
9783 }
9784
9786 {
9787 if (!rgn_ok)
9788 {
9789 visualize_region_differences( hwnd, NULL, hrgn_expect, hrgn_actual );
9790 }
9791
9792 /* Let the position change be visible to the user */
9793 flush_events();
9794 }
9795
9797 }
9798
9800 DeleteObject( hrgn_actual );
9801 DeleteObject( hrgn_expect );
9802 DeleteObject( hrgn_new_vis );
9803 DeleteObject( hrgn_old_vis );
9805}
#define GetNTVersion()
Definition: apitest.h:17
REFIID LPVOID DWORD_PTR dw
Definition: atlbase.h:40
GLint dy
Definition: linetemp.h:97
GLint x0
Definition: linetemp.h:95
GLint y0
Definition: linetemp.h:96
GLint dx
Definition: linetemp.h:97
int winetest_interactive
static void visualize_region_differences(HWND hwnd, HWND hother, HRGN hrgn_expect, HRGN hrgn_actual)
Definition: msg.c:9176
#define test
Definition: rosglue.h:37
#define _WIN32_WINNT_WINBLUE
Definition: sdkddkver.h:30
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define RGN_DIFF
Definition: wingdi.h:358
BOOL WINAPI EqualRgn(_In_ HRGN, _In_ HRGN)
#define RGN_COPY
Definition: wingdi.h:357
BOOL WINAPI SetRectRgn(_In_ HRGN, _In_ int, _In_ int, _In_ int, _In_ int)
#define CS_VREDRAW
Definition: winuser.h:666
#define CS_HREDRAW
Definition: winuser.h:661
#define HWND_TOP
Definition: winuser.h:1218
BOOL WINAPI UpdateWindow(_In_ HWND)

Referenced by test_hvredraw().

◆ subtest_swp_paint_regions_()

static void subtest_swp_paint_regions_ ( int  line,
int  wrap_toplevel,
LPCSTR  parent_class,
LPCSTR  child_class 
)
static

Definition at line 9279 of file msg.c.

9280{
9281 static const struct exposure_test {
9282 int ex_style, style;
9283 BOOL shuffle_zorder;
9284 } exposure_tests[] = {
9285 { 0, WS_CLIPCHILDREN, FALSE },
9286 { 0, 0, FALSE },
9288 { WS_EX_COMPOSITED, 0, FALSE },
9289 { WS_EX_COMPOSITED, 0, TRUE },
9290 };
9291 size_t i;
9292 HWND htoplevel = NULL, hparent, hchild, hauxchild;
9293 const RECT rect_old = { 10, 10, 100, 100 };
9294 HRGN hrgn_old_vis = CreateRectRgn( 0, 0, 0, 0 );
9295 HRGN hrgn_new_vis = CreateRectRgn( 0, 0, 0, 0 );
9296 HRGN hrgn_expect = CreateRectRgn( 0, 0, 0, 0 );
9297 HRGN hrgn_actual = CreateRectRgn( 0, 0, 0, 0 );
9298 HRGN hrgn_old_vis_child = CreateRectRgn( 0, 0, 0, 0 );
9299 HRGN hrgn_new_vis_child = CreateRectRgn( 0, 0, 0, 0 );
9300 HRGN hrgn_expect_child = CreateRectRgn( 0, 0, 0, 0 );
9301 HRGN hrgn_actual_child = CreateRectRgn( 0, 0, 0, 0 );
9302 int base_style;
9303 BOOL is_composition_possible, has_parentdc_anomaly;
9304 WNDCLASSA parent_wc;
9305
9306 if (wrap_toplevel)
9307 {
9308 htoplevel = CreateWindowExA( 0, "SimpleWindowClass", "Test toplevel", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
9309 100, 100, 400, 400, 0, 0, 0, NULL );
9310 ok( htoplevel != 0, "Failed to create top-level window: %lu\n", GetLastError() );
9311 base_style = WS_CHILD | WS_VISIBLE;
9312 }
9313 else
9314 {
9315 base_style = WS_OVERLAPPEDWINDOW | WS_VISIBLE;
9316 }
9317
9318 ok( GetClassInfoA( GetModuleHandleA( NULL ), parent_class, &parent_wc ),
9319 "GetClassInfoA failed\n" );
9320
9321 is_composition_possible = (base_style & (WS_POPUP|WS_CHILD)) != WS_CHILD ||
9322 (parent_wc.style & CS_PARENTDC) == 0;
9323
9324 has_parentdc_anomaly = (base_style & (WS_POPUP|WS_CHILD)) != WS_CHILD &&
9325 (parent_wc.style & CS_PARENTDC) != 0;
9326
9327 hparent = CreateWindowExA( 0, parent_class, "Test parent", base_style,
9328 80, 80, 200, 200, htoplevel, 0, 0, NULL );
9329 ok( hparent != 0, "Creating parent window (%s) returned error %lu\n",
9330 debugstr_a( parent_class ), GetLastError() );
9331
9332 hchild = CreateWindowExA( 0, child_class, "Test child", WS_CHILD | WS_VISIBLE | WS_BORDER,
9333 rect_old.left, rect_old.top,
9334 rect_old.right - rect_old.left, rect_old.bottom - rect_old.top,
9335 hparent, 0, 0, NULL );
9336 ok( hchild != 0, "Creating child window (%s) returned error %lu\n",
9337 debugstr_a( child_class ), GetLastError() );
9338
9339 hauxchild = CreateWindowExA( 0, child_class, "Auxiliary child for z order test", WS_CHILD | WS_VISIBLE,
9340 110, 0, 0, 0, hparent, 0, 0, NULL );
9341 ok( hauxchild != 0, "Creating child window (%s) returned error %lu\n",
9342 debugstr_a( child_class ), GetLastError() );
9343
9344 SetWindowPos( htoplevel ? htoplevel : hparent, NULL, 0, 0, 0, 0,
9346
9347 for (i = 0; i < ARRAY_SIZE(exposure_tests); i++)
9348 {
9349 const struct exposure_test *extest = &exposure_tests[i];
9350 BOOL has_ws_ex_composited = (extest->ex_style & WS_EX_COMPOSITED) != 0;
9351 BOOL is_composited = is_composition_possible && has_ws_ex_composited;
9352 BOOL is_zorder_redraw = is_composited && extest->shuffle_zorder;
9353 int delta;
9354
9355 winetest_push_context( "%d: SetWindowPos redraw #%Id (ex_style = %#x, style = %#x, shuffle_zorder = %d)",
9356 line, i, extest->ex_style, extest->style, extest->shuffle_zorder );
9357
9358 SetWindowLongA( hparent, GWL_EXSTYLE, extest->ex_style );
9359 SetWindowLongA( hparent, GWL_STYLE, base_style | extest->style );
9361
9362 for (delta = -20; delta <= 0; delta += 20)
9363 {
9364 RECT rect_old_vis, rect_new, rect_new_vis;
9365 RECT rect_parent_clip, rect_child_clip;
9366 RECT rect_old_vis_child, rect_new_vis_child;
9367 BOOL rgn_ok;
9368
9369 winetest_push_context( "delta = %+d", delta );
9370
9371 SetWindowPos( hchild, HWND_TOP,
9372 rect_old.left,
9373 rect_old.top,
9374 rect_old.right - rect_old.left,
9375 rect_old.bottom - rect_old.top,
9377
9378 rect_new = rect_old;
9379 OffsetRect( &rect_new, delta, delta );
9380
9381 rect_old_vis_child = rect_old;
9382 MapWindowPoints( hparent, hchild, (POINT *)&rect_old_vis_child, 2 );
9383
9384 SetRectRgn( hrgn_actual, 0, 0, 0, 0 );
9385 SetRectRgn( hrgn_actual_child, 0, 0, 0, 0 );
9386
9387 UpdateWindow( hparent );
9388 flush_events();
9389
9390 if (extest->shuffle_zorder)
9391 {
9392 /* bring sibling to top/bottom first so we can trigger z-order change */
9393 SetWindowPos( hauxchild, HWND_TOP, 0, 0, 0, 0,
9395 }
9396
9397 SetWindowPos( hchild, HWND_TOP,
9398 rect_new.left,
9399 rect_new.top,
9400 rect_new.right - rect_new.left,
9401 rect_new.bottom - rect_new.top,
9403 (extest->shuffle_zorder ? 0 : SWP_NOZORDER) );
9404
9405 ok( GetUpdateRgn( hparent, hrgn_actual, FALSE ) != ERROR,
9406 "GetUpdateRgn on parentshall succeed\n" );
9407 ok( GetUpdateRgn( hchild, hrgn_actual_child, FALSE ) != ERROR,
9408 "GetUpdateRgn on child shall succeed\n" );
9409
9410 /* Compute parent window expose region */
9411 GetClientRect( hparent, &rect_parent_clip );
9412 IntersectRect( &rect_old_vis, &rect_old, &rect_parent_clip );
9413 SetRectRgn( hrgn_old_vis, rect_old_vis.left, rect_old_vis.top, rect_old_vis.right, rect_old_vis.bottom );
9414 IntersectRect( &rect_new_vis, &rect_new, &rect_parent_clip );
9415 SetRectRgn( hrgn_new_vis, rect_new_vis.left, rect_new_vis.top, rect_new_vis.right, rect_new_vis.bottom );
9416
9417 if (!EqualRect( &rect_old, &rect_new ) || is_zorder_redraw)
9418 {
9419 CombineRgn( hrgn_expect, hrgn_old_vis, hrgn_new_vis, is_composited ? RGN_OR : RGN_DIFF );
9420 }
9421 else
9422 {
9423 SetRectRgn( hrgn_expect, 0, 0, 0, 0 );
9424 }
9425
9426 rgn_ok = EqualRgn( hrgn_expect, hrgn_actual );
9427 if (!rgn_ok && broken( has_parentdc_anomaly && is_composited /* Win7 */ ))
9428 {
9429 if (winetest_debug > 1)
9430 {
9431 trace( "Forcing non-composited update region (broken)\n" );
9432 }
9433 rgn_ok = 1;
9434 }
9435 else
9436 {
9437 ok( !!rgn_ok, "Parent update region shall match expected region\n" );
9438 }
9439
9440 if (!rgn_ok)
9441 {
9442 trace( "Expected parent update region: " );
9443 dump_region( hrgn_expect );
9444 trace( "Actual parent update region: " );
9445 dump_region( hrgn_actual );
9446 trace( "Old child window visible area: %s\n", wine_dbgstr_rect( &rect_old_vis ) );
9447 trace( "New child window visible area: %s\n", wine_dbgstr_rect( &rect_new_vis ) );
9448 }
9449
9451 {
9452 if (!rgn_ok)
9453 {
9454 visualize_region_differences( hparent, hchild, hrgn_expect, hrgn_actual );
9455 }
9456
9457 /* Let the position change be visible to the user */
9458 flush_events();
9459 }
9460
9461 rect_new_vis_child = rect_new;
9462 MapWindowPoints( hparent, hchild, (POINT *)&rect_new_vis_child, 2 );
9463
9464 /* Compute child window expose region */
9465 GetClientRect( hchild, &rect_child_clip );
9466 if (is_composited)
9467 {
9468 RECT rect_outer_clip;
9469 GetClientRect( hparent, &rect_outer_clip );
9470 MapWindowPoints( hparent, hchild, (POINT *)&rect_outer_clip, 2 );
9471 IntersectRect( &rect_child_clip, &rect_child_clip, &rect_outer_clip );
9472 }
9473 IntersectRect( &rect_old_vis_child, &rect_old_vis_child, &rect_child_clip );
9474 SetRectRgn( hrgn_old_vis_child, rect_old_vis_child.left, rect_old_vis_child.top, rect_old_vis_child.right, rect_old_vis_child.bottom );
9475 IntersectRect( &rect_new_vis_child, &rect_new_vis_child, &rect_child_clip );
9476 SetRectRgn( hrgn_new_vis_child, rect_new_vis_child.left, rect_new_vis_child.top, rect_new_vis_child.right, rect_new_vis_child.bottom );
9477
9478 if (!EqualRect( &rect_old, &rect_new ) || is_zorder_redraw)
9479 {
9480 CombineRgn( hrgn_expect_child, hrgn_new_vis_child, hrgn_old_vis_child, is_composited ? RGN_OR : RGN_DIFF );
9481 }
9482 else
9483 {
9484 SetRectRgn( hrgn_expect_child, 0, 0, 0, 0 );
9485 }
9486
9487 rgn_ok = EqualRgn( hrgn_expect_child, hrgn_actual_child );
9488 if (!rgn_ok && broken( has_parentdc_anomaly && is_composited /* Win7 */ ))
9489 {
9490 if (winetest_debug > 1)
9491 {
9492 trace( "Forcing non-composited update region (broken)\n" );
9493 }
9494 rgn_ok = 1;
9495 }
9496 else
9497 {
9498 ok( !!rgn_ok, "Child update region shall match expected region\n" );
9499 }
9500
9501 if (!rgn_ok)
9502 {
9503 trace( "Expected child update region: " );
9504 dump_region( hrgn_expect_child );
9505 trace( "Actual child update region: " );
9506 dump_region( hrgn_actual_child );
9507 trace( "Old child window client visible area: %s\n", wine_dbgstr_rect( &rect_old_vis_child ) );
9508 trace( "New child window client visible area: %s\n", wine_dbgstr_rect( &rect_new_vis_child ) );
9509 }
9510
9512 {
9513 if (!rgn_ok)
9514 {
9515 visualize_region_differences( hchild, NULL, hrgn_expect_child, hrgn_actual_child );
9516 }
9517
9518 /* Let the position change be visible to the user */
9519 flush_events();
9520 }
9521
9523 }
9524
9526 }
9527
9528 DestroyWindow( hauxchild );
9529 DestroyWindow( hchild );
9530 DestroyWindow( hparent );
9531 if (htoplevel) DestroyWindow( htoplevel );
9532
9533 DeleteObject( hrgn_actual_child );
9534 DeleteObject( hrgn_expect_child );
9535 DeleteObject( hrgn_new_vis_child );
9536 DeleteObject( hrgn_old_vis_child );
9537 DeleteObject( hrgn_actual );
9538 DeleteObject( hrgn_expect );
9539 DeleteObject( hrgn_new_vis );
9540 DeleteObject( hrgn_old_vis );
9541}
#define WS_BORDER
Definition: pedump.c:625
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define RGN_OR
Definition: wingdi.h:359
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define WS_EX_COMPOSITED
Definition: winuser.h:385
#define RDW_ERASE
Definition: winuser.h:1222
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define RDW_FRAME
Definition: winuser.h:1223
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define RDW_INVALIDATE
Definition: winuser.h:1225
#define GWL_EXSTYLE
Definition: winuser.h:862

◆ test_accelerators()

static void test_accelerators ( void  )
static

Definition at line 10606 of file msg.c.

10607{
10608 RECT rc;
10609 POINT pt;
10610 SHORT state;
10611 HACCEL hAccel;
10612 HWND hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
10613 100, 100, 200, 200, 0, 0, 0, NULL);
10614 BOOL us_kbd = (GetKeyboardLayout(0) == (HKL)(ULONG_PTR)0x04090409);
10615 BOOL ret;
10616
10617 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
10619 flush_events();
10621
10622 SetFocus(hwnd);
10623 ok(GetFocus() == hwnd, "wrong focus window %p\n", GetFocus());
10624
10626 ok(!(state & 0x8000), "wrong Shift state %04x\n", state);
10628 ok(state == 0, "wrong CapsLock state %04x\n", state);
10629
10631 ok(!!hAccel, "Failed to load accelerators, error %lu.\n", GetLastError());
10632
10633 flush_events();
10634 pump_msg_loop(hwnd, 0);
10636
10637 if (!us_kbd)
10638 {
10639 skip("skipping ascii VK events on non-us keyboard\n");
10640 goto done;
10641 }
10642
10643 if (winetest_debug > 1) trace("testing VK_N press/release\n");
10645 keybd_event('N', 0, 0, 0);
10646 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10648 if (!sequence_cnt) /* we didn't get any message */
10649 {
10650 skip( "queuing key events not supported\n" );
10651 goto done;
10652 }
10653 ok_sequence(WmVkN, "VK_N press/release", FALSE);
10654
10655 if (winetest_debug > 1) trace("testing Shift+VK_N press/release\n");
10657 keybd_event(VK_SHIFT, 0, 0, 0);
10658 keybd_event('N', 0, 0, 0);
10659 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10662 ok_sequence(WmShiftVkN, "Shift+VK_N press/release", FALSE);
10663
10664 if (winetest_debug > 1) trace("testing Ctrl+VK_N press/release\n");
10666 keybd_event(VK_CONTROL, 0, 0, 0);
10667 keybd_event('N', 0, 0, 0);
10668 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10671#ifdef __REACTOS__
10672 if (0) // Test failures on WS03-Win10 1607
10673#endif
10674 ok_sequence(WmCtrlVkN, "Ctrl+VK_N press/release", FALSE);
10675
10676 if (winetest_debug > 1) trace("testing Alt+VK_N press/release\n");
10678 keybd_event(VK_MENU, 0, 0, 0);
10679 keybd_event('N', 0, 0, 0);
10680 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10683 ok_sequence(WmAltVkN, "Alt+VK_N press/release", FALSE);
10684
10685 if (winetest_debug > 1) trace("testing Ctrl+Alt+VK_N press/release 1\n");
10687 keybd_event(VK_CONTROL, 0, 0, 0);
10688 keybd_event(VK_MENU, 0, 0, 0);
10689 keybd_event('N', 0, 0, 0);
10690 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10694 ok_sequence(WmCtrlAltVkN, "Ctrl+Alt+VK_N press/release 1", FALSE);
10695
10697 ok( ret, "DestroyAcceleratorTable error %ld\n", GetLastError());
10698
10700 ok(!!hAccel, "Failed to load accelerators, error %lu.\n", GetLastError());
10701
10702 if (winetest_debug > 1) trace("testing VK_N press/release\n");
10704 keybd_event('N', 0, 0, 0);
10705 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10707 ok_sequence(WmVkN, "VK_N press/release", FALSE);
10708
10709 if (winetest_debug > 1) trace("testing Shift+VK_N press/release\n");
10711 keybd_event(VK_SHIFT, 0, 0, 0);
10712 keybd_event('N', 0, 0, 0);
10713 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10716 ok_sequence(WmShiftVkN, "Shift+VK_N press/release", FALSE);
10717
10718 if (winetest_debug > 1) trace("testing Ctrl+VK_N press/release 2\n");
10720 keybd_event(VK_CONTROL, 0, 0, 0);
10721 keybd_event('N', 0, 0, 0);
10722 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10725 ok_sequence(WmCtrlVkN_2, "Ctrl+VK_N press/release 2", FALSE);
10726
10727 if (winetest_debug > 1) trace("testing Alt+VK_N press/release 2\n");
10729 keybd_event(VK_MENU, 0, 0, 0);
10730 keybd_event('N', 0, 0, 0);
10731 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10734 ok_sequence(WmAltVkN_2, "Alt+VK_N press/release 2", FALSE);
10735
10736 if (winetest_debug > 1) trace("testing Ctrl+Alt+VK_N press/release 2\n");
10738 keybd_event(VK_CONTROL, 0, 0, 0);
10739 keybd_event(VK_MENU, 0, 0, 0);
10740 keybd_event('N', 0, 0, 0);
10741 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10745 ok_sequence(WmCtrlAltVkN, "Ctrl+Alt+VK_N press/release 2", FALSE);
10746
10747 if (winetest_debug > 1) trace("testing Ctrl+Shift+VK_N press/release\n");
10749 keybd_event(VK_CONTROL, 0, 0, 0);
10750 keybd_event(VK_SHIFT, 0, 0, 0);
10751 keybd_event('N', 0, 0, 0);
10752 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10756 ok_sequence(WmCtrlShiftVkN, "Ctrl+Shift+VK_N press/release", FALSE);
10757
10758 if (winetest_debug > 1) trace("testing Ctrl+Alt+Shift+VK_N press/release\n");
10760 keybd_event(VK_CONTROL, 0, 0, 0);
10761 keybd_event(VK_MENU, 0, 0, 0);
10762 keybd_event(VK_SHIFT, 0, 0, 0);
10763 keybd_event('N', 0, 0, 0);
10764 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
10769 ok_sequence(WmCtrlAltShiftVkN, "Ctrl+Alt+Shift+VK_N press/release", FALSE);
10770
10772 ok( ret, "DestroyAcceleratorTable error %ld\n", GetLastError());
10773 hAccel = 0;
10774
10775 if (winetest_debug > 1) trace("testing Alt press/release\n");
10777 keybd_event(VK_MENU, 0, 0, 0);
10779 keybd_event(VK_MENU, 0, 0, 0);
10781 pump_msg_loop(hwnd, 0);
10782 /* this test doesn't pass in Wine for managed windows */
10783 ok_sequence(WmAltPressRelease, "Alt press/release", TRUE);
10784
10785 if (winetest_debug > 1) trace("testing VK_F1 press/release\n");
10786 keybd_event(VK_F1, 0, 0, 0);
10788 pump_msg_loop(hwnd, 0);
10789 ok_sequence(WmF1Seq, "F1 press/release", FALSE);
10790
10791 if (winetest_debug > 1) trace("testing VK_APPS press/release\n");
10792 keybd_event(VK_APPS, 0, 0, 0);
10794 pump_msg_loop(hwnd, 0);
10795 ok_sequence(WmVkAppsSeq, "VK_APPS press/release", FALSE);
10796
10797 if (winetest_debug > 1) trace("testing VK_F10 press/release\n");
10798 keybd_event(VK_F10, 0, 0, 0);
10800 keybd_event(VK_F10, 0, 0, 0);
10802 pump_msg_loop(hwnd, 0);
10803 ok_sequence(WmVkF10Seq, "VK_F10 press/release", TRUE);
10804
10805 if (winetest_debug > 1) trace("testing SHIFT+F10 press/release\n");
10806 keybd_event(VK_SHIFT, 0, 0, 0);
10807 keybd_event(VK_F10, 0, 0, 0);
10810 keybd_event(VK_ESCAPE, 0, 0, 0);
10812 pump_msg_loop(hwnd, 0);
10813 ok_sequence(WmShiftF10Seq, "SHIFT+F10 press/release", TRUE);
10814
10815 if (winetest_debug > 1) trace("testing Shift+MouseButton press/release\n");
10816 /* first, move mouse pointer inside of the window client area */
10817 GetClientRect(hwnd, &rc);
10818 MapWindowPoints(hwnd, 0, (LPPOINT)&rc, 2);
10819 rc.left += (rc.right - rc.left)/2;
10820 rc.top += (rc.bottom - rc.top)/2;
10821 SetCursorPos(rc.left, rc.top);
10823
10824 flush_events();
10826 GetCursorPos(&pt);
10827 if (pt.x == rc.left && pt.y == rc.top)
10828 {
10829 int i;
10830 keybd_event(VK_SHIFT, 0, 0, 0);
10831 mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
10832 mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
10834 pump_msg_loop(hwnd, 0);
10835 for (i = 0; i < sequence_cnt; i++) if (sequence[i].message == WM_LBUTTONDOWN) break;
10836 if (i < sequence_cnt)
10837 ok_sequence(WmShiftMouseButton, "Shift+MouseButton press/release", FALSE);
10838 else
10839 skip( "Shift+MouseButton event didn't get to the window\n" );
10840 }
10841
10842done:
10845}
static int state
Definition: maze.c:121
#define skip(...)
Definition: atltest.h:64
#define pt(x, y)
Definition: drawing.c:79
static const struct message WmVkN[]
Definition: msg.c:10264
static const struct message WmAltVkN[]
Definition: msg.c:10324
static const struct message WmAltVkN_2[]
Definition: msg.c:10358
static const struct message WmVkAppsSeq[]
Definition: msg.c:10502
static const struct message WmCtrlVkN[]
Definition: msg.c:10292
static const struct message WmShiftF10Seq[]
Definition: msg.c:10543
static const struct message WmShiftMouseButton[]
Definition: msg.c:10473
static const struct message WmCtrlAltVkN[]
Definition: msg.c:10373
static const struct message WmCtrlShiftVkN[]
Definition: msg.c:10396
static void pump_msg_loop(HWND hwnd, HACCEL hAccel)
Definition: msg.c:10576
static const struct message WmCtrlVkN_2[]
Definition: msg.c:10309
static const struct message WmVkF10Seq[]
Definition: msg.c:10513
static const struct message WmCtrlAltShiftVkN[]
Definition: msg.c:10417
static const struct message WmF1Seq[]
Definition: msg.c:10490
static const struct message WmAltPressRelease[]
Definition: msg.c:10444
static const struct message WmShiftVkN[]
Definition: msg.c:10275
short SHORT
Definition: pedump.c:59
uint32_t ULONG_PTR
Definition: typedefs.h:65
HWND WINAPI GetFocus(void)
Definition: window.c:1863
#define VK_APPS
Definition: winuser.h:2273
#define VK_F10
Definition: winuser.h:2300
#define VK_CAPITAL
Definition: winuser.h:2242
#define VK_CONTROL
Definition: winuser.h:2239
#define VK_F1
Definition: winuser.h:2291
HACCEL WINAPI LoadAcceleratorsA(_In_opt_ HINSTANCE, _In_ LPCSTR)
HWND WINAPI SetActiveWindow(_In_ HWND)
VOID WINAPI keybd_event(_In_ BYTE, _In_ BYTE, _In_ DWORD, _In_ ULONG_PTR)
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
#define VK_SHIFT
Definition: winuser.h:2238
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
#define VK_ESCAPE
Definition: winuser.h:2250
#define KEYEVENTF_KEYUP
Definition: winuser.h:1113
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2240

Referenced by START_TEST().

◆ test_autoradio_BM_CLICK()

static void test_autoradio_BM_CLICK ( void  )
static

Definition at line 7486 of file msg.c.

7487{
7488 HWND parent, radio1, radio2, radio3;
7489 RECT rc;
7490 MSG msg;
7491 DWORD ret;
7492
7494
7495 parent = CreateDialogParamA(0, "AUTORADIO_TEST_DIALOG_1", 0, radio_test_dlg_proc, 0);
7496 ok(parent != 0, "failed to create parent window\n");
7497
7498 radio1 = GetDlgItem(parent, ID_RADIO1);
7499 radio2 = GetDlgItem(parent, ID_RADIO2);
7500 radio3 = GetDlgItem(parent, ID_RADIO3);
7501
7502 /* this avoids focus messages in the generated sequence */
7503 SetFocus(radio2);
7504
7505 flush_events();
7507
7508 ret = SendMessageA(radio1, BM_GETCHECK, 0, 0);
7509 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7510 ret = SendMessageA(radio2, BM_GETCHECK, 0, 0);
7511 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7512 ret = SendMessageA(radio3, BM_GETCHECK, 0, 0);
7513 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7514
7516
7517 ret = SendMessageA(radio1, BM_GETCHECK, 0, 0);
7518 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7519 ret = SendMessageA(radio2, BM_GETCHECK, 0, 0);
7520 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7521 ret = SendMessageA(radio3, BM_GETCHECK, 0, 0);
7522 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7523
7525
7526 ret = SendMessageA(radio1, BM_GETCHECK, 0, 0);
7527 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7528 ret = SendMessageA(radio2, BM_GETCHECK, 0, 0);
7529 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7530 ret = SendMessageA(radio3, BM_GETCHECK, 0, 0);
7531 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7532
7534
7535 ret = SendMessageA(radio1, BM_GETCHECK, 0, 0);
7536 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7537 ret = SendMessageA(radio2, BM_GETCHECK, 0, 0);
7538 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7539 ret = SendMessageA(radio3, BM_GETCHECK, 0, 0);
7540 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7541
7542 GetWindowRect(radio2, &rc);
7543 SetCursorPos(rc.left+1, rc.top+1);
7544
7545 flush_events();
7547
7549
7550 SendMessageA(radio2, BM_CLICK, 0, 0);
7551 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7552 ok_sequence(auto_radio_button_BM_CLICK, "BM_CLICK on auto-radio button", FALSE);
7553
7555
7556 ret = SendMessageA(radio1, BM_GETCHECK, 0, 0);
7557 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7558 ret = SendMessageA(radio2, BM_GETCHECK, 0, 0);
7559 ok(ret == BST_CHECKED, "got %08lx\n", ret);
7560 ret = SendMessageA(radio3, BM_GETCHECK, 0, 0);
7561 ok(ret == BST_UNCHECKED, "got %08lx\n", ret);
7562
7564}
#define ID_RADIO1
Definition: msg.c:7317
static INT_PTR WINAPI radio_test_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: msg.c:7480
static const struct message auto_radio_button_BM_CLICK[]
Definition: msg.c:7322
static void subclass_button(void)
Definition: msg.c:6852
#define ID_RADIO3
Definition: msg.c:7319
#define ID_RADIO2
Definition: msg.c:7318
HWND WINAPI CreateDialogParamA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define BM_CLICK
Definition: winuser.h:1946

Referenced by START_TEST().

◆ test_autoradio_kbd_move()

static void test_autoradio_kbd_move ( void  )
static

Definition at line 7586 of file msg.c.

7587{
7588 HWND parent, radio1, radio2, radio3, hwnd;
7589 RECT rc;
7590 MSG msg;
7591 DWORD ret;
7592
7594
7595 parent = CreateDialogParamA(0, "AUTORADIO_TEST_DIALOG_2", 0, radio_test_dlg_proc, 0);
7596 ok(parent != 0, "failed to create parent window\n");
7597
7598 radio1 = GetDlgItem(parent, ID_RADIO1);
7599 radio2 = GetDlgItem(parent, ID_RADIO2);
7600 radio3 = GetDlgItem(parent, ID_RADIO3);
7601
7602 flush_events();
7604
7605 test_radio(radio1, 0, radio2, 0, radio3, 0);
7606 set_radio(radio1, 1, radio2, 1, radio3, 1);
7607 test_radio(radio1, 1, radio2, 1, radio3, 1);
7608
7609 SetFocus(radio3);
7610
7611 flush_events();
7613
7615
7616 SendMessageA(radio3, WM_KEYDOWN, VK_UP, 0);
7617 SendMessageA(radio3, WM_KEYUP, VK_UP, 0);
7618 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7619 ok_sequence(auto_radio_button_VK_UP_child, "press/release VK_UP on auto-radio button", FALSE);
7620
7621 test_radio(radio1, 1, radio2, 1, radio3, 1);
7622
7623 flush_events();
7625
7628 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7629 ok_sequence(auto_radio_button_VK_UP_parent, "press/release VK_UP on dialog", FALSE);
7630
7631 test_radio(radio1, 1, radio2, 1, radio3, 1);
7632
7633 SetFocus(radio3);
7634 GetWindowRect(radio3, &rc);
7635
7636 flush_events();
7638
7639 msg.hwnd = parent;
7640 msg.message = WM_KEYDOWN;
7641 msg.wParam = VK_UP;
7642 msg.lParam = 0;
7643 msg.pt.x = rc.left + 1;
7644 msg.pt.y = rc.top + 1;
7646 ok(ret, "IsDialogMessage should return TRUE\n");
7647 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7648 if (0) /* actual message sequence is different on every run in some Windows setups */
7649 ok_sequence(auto_radio_button_VK_UP_dialog, "IsDialogMessage(VK_UP) #1", FALSE);
7650 /* what really matters is that nothing has changed */
7651 test_radio(radio1, 1, radio2, 1, radio3, 1);
7652
7653 set_radio(radio1, 0, radio2, 1, radio3, 1);
7654 test_radio(radio1, 0, radio2, 1, radio3, 1);
7655
7656 flush_events();
7658
7660 ok(ret, "IsDialogMessage should return TRUE\n");
7661 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7662 if (0) /* actual message sequence is different on every run in some Windows setups */
7663 ok_sequence(auto_radio_button_VK_UP_dialog, "IsDialogMessage(VK_UP) #2", FALSE);
7664 /* what really matters is that nothing has changed */
7665 test_radio(radio1, 0, radio2, 1, radio3, 1);
7666
7667 /* switch from radio3 ro radio1 */
7668 SetFocus(radio3);
7669 GetWindowRect(radio3, &rc);
7670
7671 flush_events();
7673
7674 msg.hwnd = parent;
7675 msg.message = WM_KEYDOWN;
7676 msg.wParam = VK_DOWN;
7677 msg.lParam = 0;
7678 msg.pt.x = rc.left + 1;
7679 msg.pt.y = rc.top + 1;
7681 ok(ret, "IsDialogMessage should return TRUE\n");
7682 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7683 ok_sequence(auto_radio_button_VK_DOWN_dialog, "IsDialogMessage(VK_DOWN)", TRUE);
7684
7685 test_radio(radio1, 1, radio2, 0, radio3, 0);
7686
7687 hwnd = GetFocus();
7688 ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
7689 GetWindowRect(radio1, &rc);
7690
7691 msg.hwnd = parent;
7692 msg.message = WM_KEYDOWN;
7693 msg.wParam = VK_DOWN;
7694 msg.lParam = 0;
7695 msg.pt.x = rc.left + 1;
7696 msg.pt.y = rc.top + 1;
7698 ok(ret, "IsDialogMessage should return TRUE\n");
7699 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7701
7702 test_radio(radio1, 1, radio2, 0, radio3, 0);
7703
7704 hwnd = GetFocus();
7705 ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
7706
7707 flush_events();
7709
7710 msg.hwnd = parent;
7711 msg.message = WM_KEYDOWN;
7712 msg.wParam = VK_UP;
7713 msg.lParam = 0;
7714 msg.pt.x = rc.left + 1;
7715 msg.pt.y = rc.top + 1;
7717 ok(ret, "IsDialogMessage should return TRUE\n");
7718 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7720
7721 test_radio(radio1, 1, radio2, 0, radio3, 0);
7722
7723 hwnd = GetFocus();
7724 ok(hwnd == radio1, "focus should be on radio1, not on %p\n", hwnd);
7725
7726 flush_events();
7728
7729 msg.hwnd = parent;
7730 msg.message = WM_KEYDOWN;
7731 msg.wParam = VK_UP;
7732 msg.lParam = 0;
7733 msg.pt.x = rc.left + 1;
7734 msg.pt.y = rc.top + 1;
7736 ok(ret, "IsDialogMessage should return TRUE\n");
7737 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7738 if (0) /* actual message sequence is different on every run in some Windows setups */
7739 ok_sequence(auto_radio_button_VK_UP_dialog, "IsDialogMessage(VK_UP) #3", FALSE);
7740 /* what really matters is that nothing has changed */
7741 test_radio(radio1, 1, radio2, 0, radio3, 0);
7742
7744
7746}
static const struct message auto_radio_button_VK_UP_parent[]
Definition: msg.c:7361
static const struct message auto_radio_button_VK_DOWN_radio3[]
Definition: msg.c:7459
static const struct message auto_radio_button_VK_DOWN_dialog[]
Definition: msg.c:7407
#define test_radio(r1, s1, r2, s2, r3, s3)
Definition: msg.c:7566
static void set_radio(HWND radio1, int state1, HWND radio2, int state2, HWND radio3, int state3)
Definition: msg.c:7579
static const struct message auto_radio_button_VK_UP_child[]
Definition: msg.c:7354
static const struct message auto_radio_button_VK_UP_radio1[]
Definition: msg.c:7474
static const struct message auto_radio_button_VK_UP_dialog[]
Definition: msg.c:7368
#define VK_UP
Definition: winuser.h:2261
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI IsDialogMessageA(_In_ HWND, _In_ LPMSG)
#define VK_DOWN
Definition: winuser.h:2263

Referenced by START_TEST().

◆ test_broadcast()

static void test_broadcast ( void  )
static

Definition at line 18476 of file msg.c.

18477{
18478 static const UINT messages[] =
18479 {
18480 WM_USER-1,
18481 WM_USER,
18482 WM_USER+1,
18483 0xc000-1,
18484 0xc000, /* lowest possible atom returned by RegisterWindowMessage */
18485 0xffff,
18486 };
18487 static const struct
18488 {
18489 LONG style;
18490 BOOL receive;
18491 } bcast_expect[] =
18492 {
18497 {WS_CHILD, FALSE},
18502 {WS_POPUP, TRUE},
18506 };
18507 WNDPROC oldproc;
18508 unsigned int i, j;
18509 HWND hwnd;
18510 HWND *hwnd_sub;
18511
18512 hwnd_sub = malloc(ARRAY_SIZE(bcast_expect) * sizeof(*hwnd_sub));
18513 g_oldproc_sub = malloc(ARRAY_SIZE(bcast_expect) * sizeof(*g_oldproc_sub));
18515
18516 hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 0, 0, 0, 0, 0, NULL);
18517 ok(hwnd != NULL, "got %p\n", hwnd);
18518
18521
18522 for (i = 0; i < ARRAY_SIZE(messages); i++)
18523 {
18524 BOOL ret;
18525 BOOL msg_expected = (messages[i] < WM_USER || messages[i] >= 0xc000);
18526 MSG msg;
18527
18528 flush_events();
18529 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
18530 ;
18531
18532 /* post, broadcast */
18534 ok(ret, "%d: got %d, error %ld\n", i, ret, GetLastError());
18535
18536 memset(&msg, 0xab, sizeof(msg));
18537 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
18538 ok(ret == msg_expected, "%d: message %04x, got %d, error %ld\n", i, messages[i], ret, GetLastError());
18539 if (msg_expected)
18540 ok(msg.hwnd == hwnd, "%d: got %p\n", i, msg.hwnd);
18541
18542 /* post, topmost */
18544 ok(ret, "%d: got %d, error %ld\n", i, ret, GetLastError());
18545
18546 memset(&msg, 0xab, sizeof(msg));
18547 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
18548 ok(ret == msg_expected, "%d: message %04x, got %d, error %ld\n", i, messages[i], ret, GetLastError());
18549 if (msg_expected)
18550 ok(msg.hwnd == hwnd, "%d: got %p\n", i, msg.hwnd);
18551 }
18552
18553 for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
18554 {
18555 hwnd_sub[j] = CreateWindowA("static", NULL, bcast_expect[j].style, 0, 0, 0, 0, hwnd, 0, 0, NULL);
18556 ok(hwnd_sub[j] != NULL, "got %p\n", hwnd_sub[j]);
18557 /* CreateWindow adds extra style flags, so call SetWindowLong to clear some of those. */
18558 SetWindowLongA(hwnd_sub[j], GWL_STYLE, bcast_expect[j].style);
18559
18562 }
18563
18564 for (i = 0; i < ARRAY_SIZE(messages); i++)
18565 {
18566 BOOL ret;
18567 BOOL msg_expected = (messages[i] < WM_USER || messages[i] >= 0xc000);
18568
18569 /* send, broadcast */
18570 g_broadcast_wparam = 0xdead;
18571 for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
18572 g_broadcast_sub_wparam[j] = 0xdead;
18574 ret = SendMessageTimeoutA(HWND_BROADCAST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL);
18575 if (!ret && GetLastError() == ERROR_TIMEOUT)
18576 win_skip("broadcasting test %d, timeout\n", i);
18577 else
18578 {
18579 WPARAM wparam_expected = msg_expected ? 0xbaadbeef : 0xdead;
18580 ok(g_broadcast_wparam == wparam_expected, "%d: message %04x, got %#Ix, error %ld\n",
18582 for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
18583 {
18584 wparam_expected = (msg_expected && bcast_expect[j].receive) ? 0xbaadbeef : 0xdead;
18585 ok(g_broadcast_sub_wparam[j] == wparam_expected,
18586 "%d,%d: message %04x, got %#Ix, error %ld\n", i, j, messages[i],
18588 }
18589 }
18590
18591 /* send, topmost */
18592 g_broadcast_wparam = 0xdead;
18593 for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
18594 g_broadcast_sub_wparam[j] = 0xdead;
18595 ret = SendMessageTimeoutA(HWND_TOPMOST, messages[i], 0xbaadbeef, 0, SMTO_NORMAL, 2000, NULL);
18596 if (!ret && GetLastError() == ERROR_TIMEOUT)
18597 win_skip("broadcasting test %d, timeout\n", i);
18598 else
18599 {
18600 WPARAM wparam_expected = msg_expected ? 0xbaadbeef : 0xdead;
18601 ok(g_broadcast_wparam == wparam_expected, "%d: message %04x, got %#Ix, error %ld\n",
18603 for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
18604 {
18605 wparam_expected = (msg_expected && bcast_expect[j].receive) ? 0xbaadbeef : 0xdead;
18606 ok(g_broadcast_sub_wparam[j] == wparam_expected,
18607 "%d,%d: message %04x, got %#Ix, error %ld\n", i, j, messages[i],
18609 }
18610 }
18611 }
18612
18613 for (j = 0; j < ARRAY_SIZE(bcast_expect); j++)
18614 DestroyWindow(hwnd_sub[j]);
18615
18618 free(hwnd_sub);
18619
18621}
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 GLint GLint j
Definition: glfuncs.h:250
static LRESULT WINAPI broadcast_test_sub_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:18466
static LRESULT WINAPI broadcast_test_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:18455
#define WS_CAPTION
Definition: pedump.c:624
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_DLGFRAME
Definition: pedump.c:626
#define SetWindowLongPtrA
Definition: winuser.h:5511
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4469
#define SMTO_NORMAL
Definition: winuser.h:1236

Referenced by START_TEST().

◆ test_button_bm_get_set_image()

static void test_button_bm_get_set_image ( void  )
static

Definition at line 7202 of file msg.c.

7203{
7204 HWND hwnd;
7205 HDC hdc;
7206 HBITMAP hbmp1x1;
7207 HBITMAP hbmp2x2;
7208 HBITMAP hmask2x2;
7209 ICONINFO icon_info2x2;
7210 HICON hicon2x2;
7211 HBITMAP hbmp;
7212 HICON hicon;
7213 ICONINFO icon_info;
7214 BITMAP bm;
7215 DWORD default_style = BS_PUSHBUTTON | WS_TABSTOP | WS_POPUP | WS_VISIBLE;
7216 LRESULT ret;
7217
7218 hdc = GetDC(0);
7219 hbmp1x1 = CreateCompatibleBitmap(hdc, 1, 1);
7220 hbmp2x2 = CreateCompatibleBitmap(hdc, 2, 2);
7221 ZeroMemory(&bm, sizeof(bm));
7222 ok(GetObjectW(hbmp1x1, sizeof(bm), &bm), "Expect GetObjectW() success\n");
7223 ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
7224 bm.bmWidth, bm.bmHeight);
7225 ZeroMemory(&bm, sizeof(bm));
7226 ok(GetObjectW(hbmp2x2, sizeof(bm), &bm), "Expect GetObjectW() success\n");
7227 ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
7228 bm.bmWidth, bm.bmHeight);
7229
7230 hmask2x2 = CreateCompatibleBitmap(hdc, 2, 2);
7231 ZeroMemory(&icon_info2x2, sizeof(icon_info2x2));
7232 icon_info2x2.fIcon = TRUE;
7233 icon_info2x2.hbmMask = hmask2x2;
7234 icon_info2x2.hbmColor = hbmp2x2;
7235 hicon2x2 = CreateIconIndirect(&icon_info2x2);
7236
7237 ZeroMemory(&icon_info, sizeof(icon_info));
7238 ok(GetIconInfo(hicon2x2, &icon_info), "Expect GetIconInfo() success\n");
7239 ZeroMemory(&bm, sizeof(bm));
7240 ok(GetObjectW(icon_info.hbmColor, sizeof(bm), &bm), "Expect GetObjectW() success\n");
7241 ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
7242 bm.bmWidth, bm.bmHeight);
7243 DeleteObject(icon_info.hbmColor);
7244 DeleteObject(icon_info.hbmMask);
7245
7246 /* Set bitmap with BS_BITMAP */
7247 hwnd = CreateWindowA("Button", "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0, 0, 0);
7248 ok(hwnd != NULL, "Expect hwnd not NULL\n");
7251 ok(hbmp != 0, "Expect hbmp not 0\n");
7252 ZeroMemory(&bm, sizeof(bm));
7253 ok(GetObjectW(hbmp, sizeof(bm), &bm), "Expect GetObjectW() success\n");
7254 ok(bm.bmWidth == 1 && bm.bmHeight == 1, "Expect bitmap size: %d,%d, got: %d,%d\n", 1, 1,
7255 bm.bmWidth, bm.bmHeight);
7257
7258 /* Set bitmap without BS_BITMAP */
7259 hwnd = CreateWindowA("Button", "test", default_style, 0, 0, 100, 100, 0, 0, 0, 0);
7260 ok(hwnd != NULL, "Expect hwnd not NULL\n");
7262 ok(ret == 0, "Expect ret to be 0\n");
7264 ok(hbmp == NULL, "Expect hbmp to be NULL\n");
7266
7267 /* Set icon with BS_ICON */
7268 hwnd = CreateWindowA("Button", "test", default_style | BS_ICON, 0, 0, 100, 100, 0, 0, 0, 0);
7269 ok(hwnd != NULL, "Expect hwnd not NULL\n");
7272 ok(hicon != NULL, "Expect hicon not NULL\n");
7273 ZeroMemory(&icon_info, sizeof(icon_info));
7274 ok(GetIconInfo(hicon, &icon_info), "Expect GetIconInfo() success\n");
7275 ZeroMemory(&bm, sizeof(bm));
7276 ok(GetObjectW(icon_info.hbmColor, sizeof(bm), &bm), "Expect GetObjectW() success\n");
7277 ok(bm.bmWidth == 2 && bm.bmHeight == 2, "Expect bitmap size: %d,%d, got: %d,%d\n", 2, 2,
7278 bm.bmWidth, bm.bmHeight);
7279 DeleteObject(icon_info.hbmColor);
7280 DeleteObject(icon_info.hbmMask);
7282
7283 /* Set icon without BS_ICON */
7284 hwnd = CreateWindowA("Button", "test", default_style, 0, 0, 100, 100, 0, 0, 0, 0);
7285 ok(hwnd != NULL, "Expect hwnd not NULL\n");
7287 ok(ret == 0, "Expect ret to be 0\n");
7289 ok(hicon == NULL, "Expect hicon to be NULL\n");
7291
7292 /* Set icon with BS_BITMAP */
7293 hwnd = CreateWindowA("Button", "test", default_style | BS_BITMAP, 0, 0, 100, 100, 0, 0, 0, 0);
7294 ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
7296 ok(ret == 0, "Expect ret to be 0\n");
7298 ok(hicon == NULL, "Expect hicon to be NULL\n");
7300
7301 /* Set bitmap with BS_ICON */
7302 hwnd = CreateWindowA("Button", "test", default_style | BS_ICON, 0, 0, 100, 100, 0, 0, 0, 0);
7303 ok(hwnd != NULL, "Expect hwnd to be not NULL\n");
7305 ok(ret == 0, "Expect ret to be 0\n");
7307 ok(hbmp == NULL, "Expect hbmp to be NULL\n");
7309
7310 DestroyIcon(hicon2x2);
7311 DeleteObject(hmask2x2);
7312 DeleteObject(hbmp2x2);
7313 DeleteObject(hbmp1x1);
7314 ReleaseDC(0, hdc);
7315}
HBITMAP hbmp
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HICON
Definition: imagelist.c:80
static HDC
Definition: msg.c:2347
#define WS_TABSTOP
Definition: pedump.c:634
#define BS_PUSHBUTTON
Definition: pedump.c:651
BOOL fIcon
Definition: winuser.h:3231
HBITMAP hbmColor
Definition: winuser.h:3235
HBITMAP hbmMask
Definition: winuser.h:3234
LONG bmHeight
Definition: wingdi.h:1869
LONG bmWidth
Definition: wingdi.h:1868
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define BS_BITMAP
Definition: winuser.h:258
#define IMAGE_BITMAP
Definition: winuser.h:211
HICON WINAPI CreateIconIndirect(_In_ PICONINFO)
Definition: cursoricon.c:2975
#define IMAGE_ICON
Definition: winuser.h:212
BOOL WINAPI GetIconInfo(_In_ HICON, _Out_ PICONINFO)
Definition: cursoricon.c:2414
#define BS_ICON
Definition: winuser.h:264
#define BM_SETIMAGE
Definition: winuser.h:1951
#define BM_GETIMAGE
Definition: winuser.h:1948
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2422

Referenced by START_TEST().

◆ test_button_messages()

static void test_button_messages ( void  )
static

Definition at line 6869 of file msg.c.

6870{
6871 static const struct
6872 {
6873 DWORD style;
6874 DWORD dlg_code;
6875 const struct message *setfocus;
6876 const struct message *killfocus;
6877 const struct message *setstyle;
6878 const struct message *setstate;
6879 const struct message *clearstate;
6880 const struct message *setcheck;
6881 const struct message *lbuttondown;
6882 const struct message *lbuttonup;
6883 const struct message *setfont;
6884 const struct message *settext;
6885 } button[] = {
6934 NULL /* avoid infinite loop */, WmLButtonUpBrokenSeq, WmSetFontStaticSeq,
6941 };
6942 LOGFONTA logfont = { 0 };
6943 HFONT zfont, hfont2;
6944 unsigned int i;
6945 HWND hwnd, parent;
6946 DWORD dlg_code;
6947
6948 /* selection with VK_SPACE should capture button window */
6949 hwnd = CreateWindowExA(0, "button", "test", BS_CHECKBOX | WS_VISIBLE | WS_POPUP,
6950 0, 0, 50, 14, 0, 0, 0, NULL);
6951 ok(hwnd != 0, "Failed to create button window\n");
6953 SetFocus(hwnd);
6955 ok(GetCapture() == hwnd, "Should be captured on VK_SPACE WM_KEYDOWN\n");
6958
6960
6961 parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
6962 100, 100, 200, 200, 0, 0, 0, NULL);
6963 ok(parent != 0, "Failed to create parent window\n");
6964
6965 memset(&logfont, 0, sizeof(logfont));
6966 logfont.lfHeight = -12;
6967 logfont.lfWeight = FW_NORMAL;
6968 strcpy(logfont.lfFaceName, "Tahoma");
6969
6970 hfont2 = CreateFontIndirectA(&logfont);
6971 ok(hfont2 != NULL, "Failed to create Tahoma font\n");
6972
6973 for (i = 0; i < ARRAY_SIZE(button); i++)
6974 {
6975 MSG msg;
6976 DWORD style, state;
6977 HFONT prevfont;
6978 char desc[64];
6979 HDC hdc;
6980
6981 if (winetest_debug > 1) trace("button style %08lx\n", button[i].style);
6982
6983 hwnd = CreateWindowExA(0, "my_button_class", "test", button[i].style | WS_CHILD | BS_NOTIFY,
6984 0, 0, 50, 14, parent, (HMENU)ID_BUTTON, 0, NULL);
6985 ok(hwnd != 0, "Failed to create button window\n");
6986
6988 style &= ~(WS_CHILD | BS_NOTIFY);
6989 /* XP turns a BS_USERBUTTON into BS_PUSHBUTTON */
6990 if (button[i].style == BS_USERBUTTON)
6991 ok(style == BS_PUSHBUTTON, "expected style BS_PUSHBUTTON got %lx\n", style);
6992 else
6993 ok(style == button[i].style, "expected style %lx got %lx\n", button[i].style, style);
6994
6995 dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
6996 ok(dlg_code == button[i].dlg_code, "%u: wrong dlg_code %08lx\n", i, dlg_code);
6997
7000 SetFocus(0);
7001 flush_events();
7002 SetFocus(0);
7004
7006
7007 ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
7008 SetFocus(hwnd);
7009 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7010 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7011 ok_sequence(button[i].setfocus, "SetFocus(hwnd) on a button", FALSE);
7012
7013 SetFocus(0);
7014 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7015 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7016 ok_sequence(button[i].killfocus, "SetFocus(0) on a button", FALSE);
7017
7018 ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
7019
7021 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7022 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7023 ok_sequence(button[i].setstyle, "BM_SETSTYLE on a button", FALSE);
7024
7027 /* XP doesn't turn a BS_USERBUTTON into BS_PUSHBUTTON here! */
7028 ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
7029
7031 ok(state == 0, "expected state 0, got %04lx\n", state);
7032
7034
7036 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7037 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7038 ok_sequence(button[i].setstate, "BM_SETSTATE/TRUE on a button", FALSE);
7039
7041 ok(state == 0x0004, "expected state 0x0004, got %04lx\n", state);
7042
7045 ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
7046
7048
7050 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7051 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7052 ok_sequence(button[i].clearstate, "BM_SETSTATE/FALSE on a button", FALSE);
7053
7055 ok(state == 0, "expected state 0, got %04lx\n", state);
7056
7059 ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
7060
7062 ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04lx\n", state);
7063
7065
7067 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7068 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7069 ok_sequence(WmSetCheckIgnoredSeq, "BM_SETCHECK on a button", FALSE);
7070
7072 ok(state == BST_UNCHECKED, "expected BST_UNCHECKED, got %04lx\n", state);
7073
7076 ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
7077
7079
7081 SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
7082 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
7083 ok_sequence(button[i].setcheck, "BM_SETCHECK on a button", FALSE);
7084
7085 SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"Text 1");
7086 sprintf(desc, "button[%i]: WM_SETTEXT on a visible button", i);
7087 ok_sequence(button[i].settext, desc, FALSE);
7088
7090 flush_events();
7092
7093 SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"Text 2");
7094 sprintf(desc, "button[%i]: WM_SETTEXT on an invisible button", i);
7096
7099 flush_events();
7101
7102 SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"Text 3");
7103 sprintf(desc, "button[%i]: WM_SETTEXT on an invisible button", i);
7105
7107 flush_events();
7108
7110 if (button[i].style == BS_PUSHBUTTON ||
7112 button[i].style == BS_GROUPBOX ||
7115 ok(state == BST_UNCHECKED, "expected check 0, got %04lx\n", state);
7116 else
7117 ok(state == BST_CHECKED, "expected check 1, got %04lx\n", state);
7118
7121 if (button[i].style == BS_RADIOBUTTON ||
7123 ok(style == (button[i].style | WS_TABSTOP), "expected style %04lx | WS_TABSTOP got %04lx\n", button[i].style, style);
7124 else
7125 ok(style == button[i].style, "expected style %04lx got %04lx\n", button[i].style, style);
7126
7128
7130
7131 hwnd = CreateWindowExA(0, "my_button_class", "test", button[i].style | WS_POPUP | WS_VISIBLE,
7132 0, 0, 50, 14, 0, 0, 0, NULL);
7133 ok(hwnd != 0, "Failed to create button window\n");
7134
7136 flush_events();
7137
7139 SetFocus(0);
7141
7142 if (button[i].lbuttondown)
7143 {
7145 sprintf(desc, "button[%i]: WM_LBUTTONDOWN on a button", i);
7146 ok_sequence(button[i].lbuttondown, desc, FALSE);
7147 }
7148
7150 sprintf(desc, "button[%i]: WM_LBUTTONUP on a button", i);
7151 ok_sequence(button[i].lbuttonup, desc, FALSE);
7152
7157 sprintf(desc, "button[%i]: WM_SETFONT on a button", i);
7158 ok_sequence(button[i].setfont, desc, FALSE);
7159
7160 /* Test that original font is not selected back after painting */
7162
7163 prevfont = SelectObject(hdc, hfont2);
7164 ok(prevfont == GetStockObject(SYSTEM_FONT), "Unexpected default font\n");
7166 ok(hfont2 != GetCurrentObject(hdc, OBJ_FONT), "button[%u]: unexpected font selected after WM_PRINTCLIENT\n", i);
7167 SelectObject(hdc, prevfont);
7168
7169 prevfont = SelectObject(hdc, hfont2);
7170 ok(prevfont == GetStockObject(SYSTEM_FONT), "Unexpected default font\n");
7172 ok(hfont2 != GetCurrentObject(hdc, OBJ_FONT), "button[%u]: unexpected font selected after WM_PAINT\n", i);
7173 SelectObject(hdc, prevfont);
7174
7175 DeleteDC(hdc);
7176
7178 }
7179
7180 DeleteObject(hfont2);
7182
7183 /* Test if WM_LBUTTONDOWN and WM_LBUTTONUP to a disabled button leads to a WM_COMMAND for the parent */
7184
7185 parent = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
7186 100, 100, 200, 200, 0, 0, 0, NULL);
7187 ok (hwnd != 0, "Failed to create overlapped window\n");
7188
7189 hwnd = CreateWindowExA(0, "my_button_class", "test", BS_DEFPUSHBUTTON | WS_VISIBLE | WS_CHILD,
7190 0, 0, 50, 14, parent, 0, 0, NULL);
7191
7196 ok_sequence(WmDisableButtonSeq, "Mouseclick on a disabled button", FALSE);
7197
7200}
DWORD button
Definition: button.c:166
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1204
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static const struct message WmSetStyleButtonSeq[]
Definition: msg.c:6667
static const struct message WmLButtonUpAutoSeq[]
Definition: msg.c:6589
#define ID_BUTTON
Definition: msg.c:6455
static const struct message WmLButtonUpBrokenSeq[]
Definition: msg.c:6604
static const struct message WmSetFontStaticSeq[]
Definition: msg.c:6626
static const struct message WmSetStyleUserSeq[]
Definition: msg.c:6687
static const struct message WmSetStateStaticSeq[]
Definition: msg.c:6719
static const struct message WmSetFontButtonSeq[]
Definition: msg.c:6609
static const struct message WmSetCheckStaticSeq[]
Definition: msg.c:6790
static const struct message WmLButtonUpStaticSeq[]
Definition: msg.c:6579
static const struct message WmSetStateUserSeq[]
Definition: msg.c:6727
static const struct message WmSetFocusStaticSeq[]
Definition: msg.c:6483
static const struct message WmSetStateOwnerdrawSeq[]
Definition: msg.c:6736
static const struct message WmSetTextStaticSeq[]
Definition: msg.c:6644
static const struct message WmKillFocusOwnerdrawSeq[]
Definition: msg.c:6523
static const struct message WmLButtonUpSeq[]
Definition: msg.c:6569
static const struct message WmClearStateOwnerdrawSeq[]
Definition: msg.c:6775
static const struct message WmSetCheckIgnoredSeq[]
Definition: msg.c:6784
static const struct message WmSetFocusOwnerdrawSeq[]
Definition: msg.c:6510
static const struct message WmKillFocusStaticSeq[]
Definition: msg.c:6496
static const struct message WmClearStateButtonSeq[]
Definition: msg.c:6745
static const struct message WmSetFontOwnerdrawSeq[]
Definition: msg.c:6617
static const struct message WmDisableButtonSeq[]
Definition: msg.c:6754
static const struct message WmSetStyleStaticSeq[]
Definition: msg.c:6677
static const struct message WmSetTextGroupSeq[]
Definition: msg.c:6652
static const struct message WmSetTextButtonSeq[]
Definition: msg.c:6634
static const struct message WmLButtonDownStaticSeq[]
Definition: msg.c:6554
static const struct message WmLButtonDownSeq[]
Definition: msg.c:6539
static const struct message WmSetStyleOwnerdrawSeq[]
Definition: msg.c:6699
static const struct message WmSetStateButtonSeq[]
Definition: msg.c:6711
static const struct message WmKillFocusButtonSeq[]
Definition: msg.c:6469
static const struct message WmSetTextInvisibleSeq[]
Definition: msg.c:6661
static const struct message WmSetFocusButtonSeq[]
Definition: msg.c:6457
#define OBJ_FONT
Definition: objidl.idl:1019
#define BS_AUTORADIOBUTTON
Definition: pedump.c:660
#define BS_USERBUTTON
Definition: pedump.c:659
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define BS_GROUPBOX
Definition: pedump.c:658
#define BS_OWNERDRAW
Definition: pedump.c:661
#define BS_3STATE
Definition: pedump.c:656
#define BS_CHECKBOX
Definition: pedump.c:653
#define BS_AUTO3STATE
Definition: pedump.c:657
#define BS_RADIOBUTTON
Definition: pedump.c:655
#define BS_DEFPUSHBUTTON
Definition: pedump.c:652
#define WM_PRINTCLIENT
Definition: richedit.h:70
strcpy
Definition: string.h:131
LONG lfHeight
Definition: dimm.idl:42
LONG lfWeight
Definition: dimm.idl:46
CHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:55
HFONT WINAPI CreateFontIndirectA(_In_ const LOGFONTA *)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
Definition: dc.c:428
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define FW_NORMAL
Definition: wingdi.h:373
#define SYSTEM_FONT
Definition: wingdi.h:911
BOOL WINAPI DeleteDC(_In_ HDC)
#define BM_GETSTATE
Definition: winuser.h:1949
#define DLGC_BUTTON
Definition: winuser.h:2662
#define VK_SPACE
Definition: winuser.h:2255
#define DLGC_UNDEFPUSHBUTTON
Definition: winuser.h:2658
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define BS_BOTTOM
Definition: winuser.h:259
#define BS_NOTIFY
Definition: winuser.h:268
#define DLGC_DEFPUSHBUTTON
Definition: winuser.h:2657
#define WM_SETTEXT
Definition: winuser.h:1645
#define DLGC_RADIOBUTTON
Definition: winuser.h:2659
#define WM_SETFONT
Definition: winuser.h:1678
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define BM_SETSTYLE
Definition: winuser.h:1953
#define DLGC_STATIC
Definition: winuser.h:2661
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define MK_LBUTTON
Definition: winuser.h:2403

Referenced by START_TEST().

◆ test_button_style()

static void test_button_style ( void  )
static

Definition at line 20591 of file msg.c.

20592{
20593 DWORD type, expected_type;
20594 HWND button;
20595 LRESULT ret;
20596 DWORD i, j;
20597
20598 for (i = BS_PUSHBUTTON; i <= BS_DEFCOMMANDLINK; ++i)
20599 {
20600 button = CreateWindowA(WC_BUTTONA, "test", i, 0, 0, 50, 50, NULL, 0, 0, NULL);
20601 ok(button != NULL, "Expected button not null.\n");
20602
20604 expected_type = (i == BS_USERBUTTON ? BS_PUSHBUTTON : i);
20605 ok(type == expected_type, "Expected type %#lx, got %#lx.\n", expected_type, type);
20606
20607 for (j = BS_PUSHBUTTON; j <= BS_DEFCOMMANDLINK; ++j)
20608 {
20610 ok(ret == 0, "Expected %#x, got %#Ix.\n", 0, ret);
20611
20613 expected_type = j;
20614
20615 ok(type == expected_type, "Original type %#lx, expected new type %#lx, got %#lx.\n", i,
20616 expected_type, type);
20617 }
20619 }
20620}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define BS_DEFCOMMANDLINK
Definition: commctrl.h:4678
#define WC_BUTTONA
Definition: commctrl.h:4627
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define BS_TYPEMASK
Definition: winuser.h:270

Referenced by START_TEST().

◆ test_clipboard_viewers()

static void test_clipboard_viewers ( void  )
static

Definition at line 18258 of file msg.c.

18259{
18260 static struct message wm_change_cb_chain[] =
18261 {
18263 { 0 }
18264 };
18265 static const struct message wm_clipboard_destroyed[] =
18266 {
18268 { 0 }
18269 };
18270 static struct message wm_clipboard_changed[] =
18271 {
18273 { 0 }
18274 };
18275 static struct message wm_clipboard_changed_and_owned[] =
18276 {
18279 { 0 }
18280 };
18281
18284 HWND hOrigViewer;
18285 HWND hRet;
18286
18287 hWnd1 = CreateWindowExA(0, "TestWindowClass", "Clipboard viewer test wnd 1",
18291 ok(!!hWnd1, "Failed to create window, error %lu.\n", GetLastError());
18292 hWnd2 = CreateWindowExA(0, "SimpleWindowClass", "Clipboard viewer test wnd 2",
18296 ok(!!hWnd2, "Failed to create window, error %lu.\n", GetLastError());
18297 hWnd3 = CreateWindowExA(0, "SimpleWindowClass", "Clipboard viewer test wnd 3",
18301 ok(!!hWnd3, "Failed to create window, error %lu.\n", GetLastError());
18302 if (winetest_debug > 1) trace("clipbd viewers: hWnd1=%p, hWnd2=%p, hWnd3=%p\n", hWnd1, hWnd2, hWnd3);
18303
18304 CountClipboardFormats(); /* Ensure that we do not have an X11 update to the clipboard */
18306
18307 /* Test getting the clipboard viewer and setting the viewer to NULL. */
18308 hOrigViewer = GetClipboardViewer();
18309 hRet = SetClipboardViewer(NULL);
18310 ok_sequence(WmEmptySeq, "set viewer to NULL", FALSE);
18311 expect_HWND(hOrigViewer, hRet);
18313
18314 /* Test registering hWnd1 as a viewer. */
18315 hRet = SetClipboardViewer(hWnd1);
18316 wm_clipboard_changed[0].wParam = (WPARAM) GetClipboardOwner();
18317 ok_sequence(wm_clipboard_changed, "set viewer NULL->1", FALSE);
18318 expect_HWND(NULL, hRet);
18320
18321 /* Test that changing the clipboard actually refreshes the registered viewer. */
18323 wm_clipboard_changed[0].wParam = (WPARAM) GetClipboardOwner();
18324 ok_sequence(wm_clipboard_changed, "clear clipbd (viewer=owner=1)", FALSE);
18325
18326 /* Again, but with different owner. */
18328 wm_clipboard_changed_and_owned[1].wParam = (WPARAM) GetClipboardOwner();
18329 ok_sequence(wm_clipboard_changed_and_owned, "clear clipbd (viewer=1, owner=2)", FALSE);
18330
18331 /* Test re-registering same window. */
18332 hRet = SetClipboardViewer(hWnd1);
18333 wm_clipboard_changed[0].wParam = (WPARAM) GetClipboardOwner();
18334 ok_sequence(wm_clipboard_changed, "set viewer 1->1", FALSE);
18335 expect_HWND(hWnd1, hRet);
18337
18338 /* Test ChangeClipboardChain. */
18340 wm_change_cb_chain[0].wParam = (WPARAM) hWnd2;
18341 wm_change_cb_chain[0].lParam = (LPARAM) hWnd3;
18342 ok_sequence(wm_change_cb_chain, "change chain (viewer=1, remove=2, next=3)", FALSE);
18344
18346 wm_change_cb_chain[0].wParam = (WPARAM) hWnd2;
18347 wm_change_cb_chain[0].lParam = 0;
18348 ok_sequence(wm_change_cb_chain, "change chain (viewer=1, remove=2, next=NULL)", FALSE);
18350
18352 ok_sequence(WmEmptySeq, "change chain (viewer=1, remove=NULL, next=2)", FALSE);
18354
18355 /* Actually change clipboard viewer with ChangeClipboardChain. */
18357 ok_sequence(WmEmptySeq, "change chain (viewer=remove=1, next=2)", FALSE);
18359
18360 /* Test that no refresh messages are sent when viewer has unregistered. */
18362 ok_sequence(WmEmptySeq, "clear clipd (viewer=2, owner=1)", FALSE);
18363
18364 /* Register hWnd1 again. */
18366 ok_sequence(WmEmptySeq, "change chain (viewer=remove=2, next=1)", FALSE);
18368
18369 /* Subclass hWnd1 so that when it receives a WM_DRAWCLIPBOARD message, it
18370 * changes the clipboard. When this happens, the system shouldn't send
18371 * another WM_DRAWCLIPBOARD (as this could cause an infinite loop).
18372 */
18375 /* The clipboard owner is changed in recursive_viewer_proc: */
18376 wm_clipboard_changed[0].wParam = (WPARAM) hWnd2;
18377 ok_sequence(wm_clipboard_changed, "recursive clear clipbd (viewer=1, owner=2)", TRUE);
18378
18379 /* Test unregistering. */
18381 ok_sequence(WmEmptySeq, "change chain (viewer=remove=1, next=NULL)", FALSE);
18383
18385 ok_sequence(wm_clipboard_destroyed, "clear clipbd (no viewer, owner=1)", FALSE);
18386
18390 SetClipboardViewer(hOrigViewer);
18391}
static HWND hWnd3
HINSTANCE hInst
Definition: dxdiag.c:13
HWND hWnd1
Definition: button.c:416
HWND hWnd2
Definition: button.c:416
static LPARAM
Definition: msg.c:17109
#define expect_HWND(expected, got)
Definition: msg.c:18237
static WPARAM
Definition: msg.c:17109
static LRESULT CALLBACK recursive_viewer_proc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:18245
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define WM_DESTROYCLIPBOARD
Definition: winuser.h:1896
HWND WINAPI GetClipboardOwner(void)
Definition: ntwrapper.h:196
#define WM_CHANGECBCHAIN
Definition: winuser.h:1902
HWND WINAPI SetClipboardViewer(_In_ HWND)
BOOL WINAPI ChangeClipboardChain(_In_ HWND, _In_ HWND)
int WINAPI CountClipboardFormats(void)
Definition: ntwrapper.h:184
#define CW_USEDEFAULT
Definition: winuser.h:225
HWND WINAPI GetClipboardViewer(void)
Definition: ntwrapper.h:208

Referenced by START_TEST().

◆ test_combobox_messages()

static void test_combobox_messages ( void  )
static

Definition at line 8079 of file msg.c.

8080{
8081 HWND parent, combo, button, edit, lbox;
8082 LRESULT ret;
8083 COMBOBOXINFO cbInfo;
8084 BOOL res;
8085
8087
8088 parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
8089 100, 100, 200, 200, 0, 0, 0, NULL);
8090 ok(parent != 0, "Failed to create parent window\n");
8092
8093 combo = CreateWindowExA(0, "my_combobox_class", "test", WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS,
8094 0, 0, 100, 150, parent, (HMENU)ID_COMBOBOX, 0, NULL);
8095 ok(combo != 0, "Failed to create combobox window\n");
8096
8097 UpdateWindow(combo);
8098
8099 ret = SendMessageA(combo, WM_GETDLGCODE, 0, 0);
8100 ok(ret == (DLGC_WANTCHARS | DLGC_WANTARROWS), "wrong dlg_code %08Ix\n", ret);
8101
8102 ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 0");
8103 ok(ret == 0, "expected 0, got %Id\n", ret);
8104 ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 1");
8105 ok(ret == 1, "expected 1, got %Id\n", ret);
8106 ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 2");
8107 ok(ret == 2, "expected 2, got %Id\n", ret);
8108
8109 SendMessageA(combo, CB_SETCURSEL, 0, 0);
8110 SetFocus(combo);
8112
8114 SendMessageA(combo, WM_KEYDOWN, VK_DOWN, 0);
8115 SendMessageA(combo, WM_KEYUP, VK_DOWN, 0);
8117 ok_sequence(WmKeyDownComboSeq, "WM_KEYDOWN/VK_DOWN on a ComboBox", FALSE);
8118
8120 SetWindowPos(combo, 0, 10, 10, 120, 130, SWP_NOZORDER);
8121 ok_sequence(WmSetPosComboSeq, "repositioning messages on a ComboBox", FALSE);
8122
8123 DestroyWindow(combo);
8125
8126 /* Start again. Test combobox text selection when getting and losing focus */
8127 parent = CreateWindowExA(0, "TestParentClass", "Parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
8128 10, 10, 300, 300, NULL, NULL, NULL, NULL);
8129 ok(parent != 0, "Failed to create parent window\n");
8130
8131 combo = CreateWindowExA(0, "my_combobox_class", "test", WS_CHILD | WS_VISIBLE | CBS_DROPDOWN,
8132 5, 5, 100, 100, parent, (HMENU)ID_COMBOBOX, NULL, NULL);
8133 ok(combo != 0, "Failed to create combobox window\n");
8134
8135 cbInfo.cbSize = sizeof(COMBOBOXINFO);
8136 SetLastError(0xdeadbeef);
8137 res = GetComboBoxInfo(combo, &cbInfo);
8138 ok(res, "Failed to get COMBOBOXINFO structure; LastError: %lu\n", GetLastError());
8139 edit = cbInfo.hwndItem;
8140
8143
8145 5, 50, 100, 20, parent, NULL,
8147 ok(button != 0, "Failed to create button window\n");
8148
8151 SendMessageA(combo, WM_SETFOCUS, 0, (LPARAM)edit);
8153 ok_sequence(WMSetFocusComboBoxSeq, "WM_SETFOCUS on a ComboBox", TRUE);
8154
8159 ok_sequence(SetFocusButtonSeq, "SetFocus on a Button", TRUE);
8160
8161 SendMessageA(combo, WM_SETTEXT, 0, (LPARAM)"Wine Test");
8162
8165 SetFocus(combo);
8167 ok_sequence(SetFocusComboBoxSeq, "SetFocus on a ComboBox", TRUE);
8168
8173 ok_sequence(SetFocusButtonSeq2, "SetFocus on a Button (2)", TRUE);
8174
8175 SetFocus(combo);
8176 SendMessageA(combo, WM_SETREDRAW, FALSE, 0);
8179 SendMessageA(combo, CB_SETCURSEL, 0, 0);
8181 ok_sequence(SetCurSelComboSeq_edit, "CB_SETCURSEL on a ComboBox with edit control", FALSE);
8182
8184 DestroyWindow(combo);
8185
8186 combo = CreateWindowExA(0, "my_combobox_class", "test",
8188 5, 5, 100, 100, parent, (HMENU)ID_COMBOBOX, NULL, NULL);
8189 ok(combo != 0, "Failed to create combobox window\n");
8190
8191 ret = SendMessageA(combo, CB_ADDSTRING, 0, (LPARAM)"item 0");
8192 ok(ret == 0, "expected 0, got %Id\n", ret);
8193
8194 cbInfo.cbSize = sizeof(COMBOBOXINFO);
8195 SetLastError(0xdeadbeef);
8196 res = GetComboBoxInfo(combo, &cbInfo);
8197 ok(res, "Failed to get COMBOBOXINFO structure; LastError: %lu\n", GetLastError());
8198 lbox = cbInfo.hwndList;
8202
8204 SendMessageA(combo, CB_SETCURSEL, 0, 0);
8206 ok_sequence(SetCurSelComboSeq, "CB_SETCURSEL on a ComboBox", FALSE);
8207
8208 ShowWindow(combo, SW_HIDE);
8211 SendMessageA(combo, CB_SETCURSEL, 0, 0);
8213 ok_sequence(SetCurSelComboSeq2, "CB_SETCURSEL on a ComboBox", FALSE);
8214
8215 DestroyWindow(combo);
8217}
static const struct message SetFocusComboBoxSeq[]
Definition: msg.c:7933
static const struct message WMSetFocusComboBoxSeq[]
Definition: msg.c:7905
static const struct message SetCurSelComboSeq[]
Definition: msg.c:7844
static const struct message SetFocusButtonSeq2[]
Definition: msg.c:7948
static LRESULT CALLBACK combobox_lbox_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:7998
static const struct message WmSetPosComboSeq[]
Definition: msg.c:7890
static const struct message SetCurSelComboSeq2[]
Definition: msg.c:7859
static LRESULT CALLBACK combobox_edit_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:7965
static const struct message WmKeyDownComboSeq[]
Definition: msg.c:7879
static const struct message SetCurSelComboSeq_edit[]
Definition: msg.c:7871
static const struct message SetFocusButtonSeq[]
Definition: msg.c:7918
#define ID_COMBOBOX
Definition: msg.c:7842
static void subclass_combobox(void)
Definition: msg.c:8062
#define CBS_OWNERDRAWFIXED
Definition: winuser.h:289
#define CBS_DROPDOWNLIST
Definition: winuser.h:284
#define DLGC_WANTCHARS
Definition: winuser.h:2660
#define CB_SETCURSEL
Definition: winuser.h:1990
#define GWLP_HINSTANCE
Definition: winuser.h:867
BOOL WINAPI GetComboBoxInfo(_In_ HWND, _Inout_ PCOMBOBOXINFO)
#define DLGC_WANTARROWS
Definition: winuser.h:2652
#define CB_ADDSTRING
Definition: winuser.h:1965
struct tagCOMBOBOXINFO COMBOBOXINFO
#define CBS_DROPDOWN
Definition: winuser.h:283
#define CBS_HASSTRINGS
Definition: winuser.h:285
#define WM_SETREDRAW
Definition: winuser.h:1644

Referenced by START_TEST().

◆ test_create()

static HANDLE test_create ( const char file)
static

Definition at line 10084 of file msg.c.

10085{
10087 ACTCTXW actctx;
10088 HANDLE handle;
10089
10091 memset(&actctx, 0, sizeof(ACTCTXW));
10092 actctx.cbSize = sizeof(ACTCTXW);
10093 actctx.lpSource = path;
10094
10096 ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %lu\n", GetLastError());
10097
10098 ok(actctx.cbSize == sizeof(actctx), "cbSize=%ld\n", actctx.cbSize);
10099 ok(actctx.dwFlags == 0, "dwFlags=%ld\n", actctx.dwFlags);
10100 ok(actctx.lpSource == path, "lpSource=%p\n", actctx.lpSource);
10101 ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture);
10102 ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId);
10103 ok(actctx.lpAssemblyDirectory == NULL, "lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory);
10104 ok(actctx.lpResourceName == NULL, "lpResourceName=%p\n", actctx.lpResourceName);
10105 ok(actctx.lpApplicationName == NULL, "lpApplicationName=%p\n", actctx.lpApplicationName);
10106 ok(actctx.hModule == NULL, "hModule=%p\n", actctx.hModule);
10107
10108 return handle;
10109}
HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
Definition: actctx.c:102
#define actctx
Definition: kernel32.h:8

◆ test_create_name()

static void test_create_name ( void  )
static

Definition at line 20641 of file msg.c.

20642{
20643 WNDCLASSW clsW = { 0 };
20644 WCHAR name_buf[3];
20645 HWND hwnd;
20646
20648 clsW.lpszClassName = L"TestCreateNameClassW";
20649 RegisterClassW( &clsW );
20650
20651 hwnd = CreateWindowExW( 0, L"TestCreateNameClassW", L"\xffff\x6162",
20652 WS_POPUP, 0,0,0,0,0,0,0, name_buf );
20653 ok( hwnd != NULL, "CreateWindowEx failed: %lu\n", GetLastError() );
20654 ok(!memcmp(name_buf, L"\xffff\x6162", 2 * sizeof(WCHAR)),
20655 "name param = %s\n", debugstr_wn(name_buf, 2));
20657
20658 hwnd = CreateWindowExA( 0, "TestCreateNameClassW", "\xff\0\x61\x60",
20659 WS_POPUP, 0,0,0,0,0,0,0, name_buf );
20660 ok( hwnd != NULL, "CreateWindowEx failed: %lu\n", GetLastError() );
20661 ok(!memcmp(name_buf, L"\xffff\x6100", 2 * sizeof(WCHAR)),
20662 "name param = %s\n", debugstr_wn(name_buf, 2));
20664
20665 UnregisterClassW( L"TestCreateNameClassW", NULL );
20666}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2802
#define L(x)
Definition: resources.c:13
#define debugstr_wn
Definition: kernel32.h:33
static LRESULT WINAPI test_create_name_procW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: msg.c:20622
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by START_TEST().

◆ test_create_name_procW()

static LRESULT WINAPI test_create_name_procW ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 20622 of file msg.c.

20623{
20624 switch (msg)
20625 {
20626 case WM_NCCREATE:
20627 case WM_CREATE:
20628 {
20630 memcpy( cs->lpCreateParams, cs->lpszName, 3 * sizeof(WCHAR) );
20631 break;
20632 }
20633 case WM_SETTEXT:
20634 if (winetest_debug > 1) trace("%s\n", debugstr_w((const WCHAR *)lparam));
20635 break;
20636 }
20637
20638 return DefWindowProcW( hwnd, msg, wparam, lparam );
20639}
#define cs
Definition: i386-dis.c:442
#define debugstr_w
Definition: kernel32.h:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WM_NCCREATE
Definition: winuser.h:1711

Referenced by test_create_name().

◆ test_dbcs_wm_char()

static void test_dbcs_wm_char ( void  )
static

Definition at line 16565 of file msg.c.

16566{
16567 BYTE dbch[2];
16568 WCHAR wch, bad_wch;
16569 HWND hwnd, hwnd2;
16570 MSG msg;
16571 DWORD time;
16572 POINT pt;
16573 DWORD_PTR res;
16574 CPINFOEXA cpinfo;
16575 UINT i, j, k;
16576 struct message wmCharSeq[2];
16577 BOOL ret;
16579
16580 if (!pGetCPInfoExA)
16581 {
16582 win_skip("GetCPInfoExA is not available\n");
16583 return;
16584 }
16585
16586 pGetCPInfoExA( cp, 0, &cpinfo );
16587 if (cpinfo.MaxCharSize != 2)
16588 {
16589 skip( "Skipping DBCS WM_CHAR test in SBCS codepage '%s'\n", cpinfo.CodePageName );
16590 return;
16591 }
16592
16593 dbch[0] = dbch[1] = 0;
16594 wch = 0;
16595 bad_wch = cpinfo.UnicodeDefaultChar;
16596 for (i = 0; !wch && i < MAX_LEADBYTES && cpinfo.LeadByte[i]; i += 2)
16597 for (j = cpinfo.LeadByte[i]; !wch && j <= cpinfo.LeadByte[i+1]; j++)
16598 for (k = 128; k <= 255; k++)
16599 {
16600 char str[2];
16601 WCHAR wstr[2];
16602 str[0] = j;
16603 str[1] = k;
16604 if (MultiByteToWideChar( cp, 0, str, 2, wstr, 2 ) == 1 &&
16605 WideCharToMultiByte( cp, 0, wstr, 1, str, 2, NULL, NULL ) == 2 &&
16606 (BYTE)str[0] == j && (BYTE)str[1] == k &&
16607 HIBYTE(wstr[0]) && HIBYTE(wstr[0]) != 0xff)
16608 {
16609 dbch[0] = j;
16610 dbch[1] = k;
16611 wch = wstr[0];
16612 break;
16613 }
16614 }
16615
16616 if (!wch)
16617 {
16618 skip( "Skipping DBCS WM_CHAR test, no appropriate char found\n" );
16619 return;
16620 }
16621 if (winetest_debug > 1) trace( "using dbcs char %02x,%02x wchar %04x bad wchar %04x codepage '%s'\n",
16622 dbch[0], dbch[1], wch, bad_wch, cpinfo.CodePageName );
16623
16625 WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL);
16627 WS_OVERLAPPEDWINDOW, 100, 100, 200, 200, 0, 0, 0, NULL);
16628 ok (hwnd != 0, "Failed to create overlapped window\n");
16629 ok (hwnd2 != 0, "Failed to create overlapped window\n");
16630 flush_events();
16632
16633 memset( wmCharSeq, 0, sizeof(wmCharSeq) );
16634 wmCharSeq[0].message = WM_CHAR;
16635 wmCharSeq[0].flags = sent|wparam;
16636 wmCharSeq[0].wParam = wch;
16637
16638 /* posted message */
16639 PostMessageA( hwnd, WM_CHAR, dbch[0], 0 );
16640 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16641 ok( !ret, "got message %x\n", msg.message );
16642 PostMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16643 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16644 ok( ret, "no message\n" );
16645 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16646 ok( msg.wParam == wch, "bad wparam %Ix/%x\n", msg.wParam, wch );
16647 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16648 ok( !ret, "got message %x\n", msg.message );
16649
16650 /* posted thread message */
16652 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16653 ok( !ret, "got message %x\n", msg.message );
16654 PostMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16655 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16656 ok( ret, "no message\n" );
16657 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16658 ok( msg.wParam == wch, "bad wparam %Ix/%x\n", msg.wParam, wch );
16659 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16660 ok( !ret, "got message %x\n", msg.message );
16661
16662 /* sent message */
16664 SendMessageA( hwnd, WM_CHAR, dbch[0], 0 );
16665 ok_sequence( WmEmptySeq, "no messages", FALSE );
16666 SendMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16667 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16668 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16669 ok( !ret, "got message %x\n", msg.message );
16670
16671 /* sent message with timeout */
16673 SendMessageTimeoutA( hwnd, WM_CHAR, dbch[0], 0, SMTO_NORMAL, 0, &res );
16674 ok_sequence( WmEmptySeq, "no messages", FALSE );
16675 SendMessageTimeoutA( hwnd, WM_CHAR, dbch[1], 0, SMTO_NORMAL, 0, &res );
16676 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16677 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16678 ok( !ret, "got message %x\n", msg.message );
16679
16680 /* sent message with timeout and callback */
16682 SendMessageTimeoutA( hwnd, WM_CHAR, dbch[0], 0, SMTO_NORMAL, 0, &res );
16683 ok_sequence( WmEmptySeq, "no messages", FALSE );
16684 SendMessageCallbackA( hwnd, WM_CHAR, dbch[1], 0, NULL, 0 );
16685 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16686 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16687 ok( !ret, "got message %x\n", msg.message );
16688
16689 /* sent message with callback */
16691 SendNotifyMessageA( hwnd, WM_CHAR, dbch[0], 0 );
16692 ok_sequence( WmEmptySeq, "no messages", FALSE );
16693 SendMessageCallbackA( hwnd, WM_CHAR, dbch[1], 0, NULL, 0 );
16694 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16695 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16696 ok( !ret, "got message %x\n", msg.message );
16697
16698 /* direct window proc call */
16701 ok_sequence( WmEmptySeq, "no messages", FALSE );
16703 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16704
16705 /* dispatch message */
16706 msg.hwnd = hwnd;
16707 msg.message = WM_CHAR;
16708 msg.wParam = dbch[0];
16709 msg.lParam = 0;
16711 ok_sequence( WmEmptySeq, "no messages", FALSE );
16712 msg.wParam = dbch[1];
16714 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16715
16716 /* window handle is irrelevant */
16718 SendMessageA( hwnd2, WM_CHAR, dbch[0], 0 );
16719 ok_sequence( WmEmptySeq, "no messages", FALSE );
16720 SendMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16721 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16722 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16723 ok( !ret, "got message %x\n", msg.message );
16724
16725 /* interleaved post and send */
16727 PostMessageA( hwnd2, WM_CHAR, dbch[0], 0 );
16728 SendMessageA( hwnd2, WM_CHAR, dbch[0], 0 );
16729 ok_sequence( WmEmptySeq, "no messages", FALSE );
16730 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16731 ok( !ret, "got message %x\n", msg.message );
16732 PostMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16733 ok_sequence( WmEmptySeq, "no messages", FALSE );
16734 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16735 ok( ret, "no message\n" );
16736 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16737 ok( msg.wParam == wch, "bad wparam %Ix/%x\n", msg.wParam, wch );
16738 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16739 ok( !ret, "got message %x\n", msg.message );
16740 SendMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16741 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16742 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16743 ok( !ret, "got message %x\n", msg.message );
16744
16745 /* interleaved sent message and winproc */
16747 SendMessageA( hwnd, WM_CHAR, dbch[0], 0 );
16749 ok_sequence( WmEmptySeq, "no messages", FALSE );
16750 SendMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16751 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16753 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16754
16755 /* interleaved winproc and dispatch */
16756 msg.hwnd = hwnd;
16757 msg.message = WM_CHAR;
16758 msg.wParam = dbch[0];
16759 msg.lParam = 0;
16762 ok_sequence( WmEmptySeq, "no messages", FALSE );
16763 msg.wParam = dbch[1];
16765 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16767 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16768
16769 /* interleaved sends */
16771 SendMessageA( hwnd, WM_CHAR, dbch[0], 0 );
16772 SendMessageCallbackA( hwnd, WM_CHAR, dbch[0], 0, NULL, 0 );
16773 ok_sequence( WmEmptySeq, "no messages", FALSE );
16774 SendMessageTimeoutA( hwnd, WM_CHAR, dbch[1], 0, SMTO_NORMAL, 0, &res );
16775 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16776 SendMessageA( hwnd, WM_CHAR, dbch[1], 0 );
16777 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16778
16779 /* dbcs WM_CHAR */
16781 SendMessageA( hwnd2, WM_CHAR, (dbch[1] << 8) | dbch[0], 0 );
16782 ok_sequence( wmCharSeq, "Unicode WM_CHAR", FALSE );
16783 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16784 ok( !ret, "got message %x\n", msg.message );
16785
16786 /* other char messages are not magic */
16787 PostMessageA( hwnd, WM_SYSCHAR, dbch[0], 0 );
16788 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16789 ok( ret, "no message\n" );
16790 ok( msg.message == WM_SYSCHAR, "unexpected message %x\n", msg.message );
16791 ok( msg.wParam == bad_wch, "bad wparam %Ix/%x\n", msg.wParam, bad_wch );
16792 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16793 ok( !ret, "got message %x\n", msg.message );
16794 PostMessageA( hwnd, WM_DEADCHAR, dbch[0], 0 );
16795 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16796 ok( ret, "no message\n" );
16797 ok( msg.message == WM_DEADCHAR, "unexpected message %x\n", msg.message );
16798 ok( msg.wParam == bad_wch, "bad wparam %Ix/%x\n", msg.wParam, bad_wch );
16799 ret = PeekMessageW( &msg, hwnd, 0, 0, PM_REMOVE );
16800 ok( !ret, "got message %x\n", msg.message );
16801
16802 /* test retrieving messages */
16803
16804 PostMessageW( hwnd, WM_CHAR, wch, 0 );
16805 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16806 ok( ret, "no message\n" );
16807 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16808 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16809 ok( msg.wParam == dbch[0], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16810 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16811 ok( ret, "no message\n" );
16812 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16813 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16814 ok( msg.wParam == dbch[1], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16815 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16816 ok( !ret, "got message %x\n", msg.message );
16817
16818 /* message filters */
16819 PostMessageW( hwnd, WM_CHAR, wch, 0 );
16820 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16821 ok( ret, "no message\n" );
16822 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16823 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16824 ok( msg.wParam == dbch[0], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16825 /* message id is filtered, hwnd is not */
16827 ok( !ret, "no message\n" );
16828 ret = PeekMessageA( &msg, hwnd2, 0, 0, PM_REMOVE );
16829 ok( ret, "no message\n" );
16830 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16831 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16832 ok( msg.wParam == dbch[1], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16833 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16834 ok( !ret, "got message %x\n", msg.message );
16835
16836 /* mixing GetMessage and PostMessage */
16837 PostMessageW( hwnd, WM_CHAR, wch, 0xbeef );
16838 ok( GetMessageA( &msg, hwnd, 0, 0 ), "no message\n" );
16839 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16840 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16841 ok( msg.wParam == dbch[0], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16842 ok( msg.lParam == 0xbeef, "bad lparam %Ix\n", msg.lParam );
16843 time = msg.time;
16844 pt = msg.pt;
16845 ok( time - GetTickCount() <= 100, "bad time %lx\n", msg.time );
16846 ret = PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
16847 ok( ret, "no message\n" );
16848 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16849 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16850 ok( msg.wParam == dbch[1], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16851 ok( msg.lParam == 0xbeef, "bad lparam %Ix\n", msg.lParam );
16852 ok( msg.time == time, "bad time %lx/%lx\n", msg.time, time );
16853 ok( msg.pt.x == pt.x && msg.pt.y == pt.y, "bad point %lu,%lu/%lu,%lu\n", msg.pt.x, msg.pt.y, pt.x, pt.y );
16854 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16855 ok( !ret, "got message %x\n", msg.message );
16856
16857 /* without PM_REMOVE */
16858 PostMessageW( hwnd, WM_CHAR, wch, 0 );
16859 ret = PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16860 ok( ret, "no message\n" );
16861 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16862 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16863 ok( msg.wParam == dbch[0], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16864 ret = PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
16865 ok( ret, "no message\n" );
16866 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16867 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16868 ok( msg.wParam == dbch[0], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16869 ret = PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE );
16870 ok( ret, "no message\n" );
16871 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16872 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16873 ok( msg.wParam == dbch[1], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16874 ret = PeekMessageA( &msg, 0, 0, 0, PM_REMOVE );
16875 ok( ret, "no message\n" );
16876 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16877 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16878 ok( msg.wParam == dbch[1], "bad wparam %Ix/%x\n", msg.wParam, dbch[0] );
16879 ret = PeekMessageA( &msg, hwnd, 0, 0, PM_REMOVE );
16880 ok( !ret, "got message %x\n", msg.message );
16881
16883 DestroyWindow(hwnd2);
16884}
#define WideCharToMultiByte
Definition: compat.h:111
#define HIBYTE(W)
Definition: jmemdos.c:486
static DWORD get_input_codepage(void)
Definition: msg.c:16553
int k
Definition: mpi.c:3369
UINT MaxCharSize
Definition: winnls.h:655
WCHAR UnicodeDefaultChar
Definition: winnls.h:658
BYTE LeadByte[MAX_LEADBYTES]
Definition: winnls.h:657
CHAR CodePageName[MAX_PATH]
Definition: winnls.h:660
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define MAX_LEADBYTES
Definition: winnls.h:14
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_DEADCHAR
Definition: winuser.h:1746
unsigned char BYTE
Definition: xxhash.c:193

Referenced by START_TEST().

◆ test_defwinproc()

static void test_defwinproc ( void  )
static

Definition at line 17966 of file msg.c.

17967{
17968 HWND hwnd, child[3];
17969 MSG msg;
17970 BOOL gotwmquit = FALSE;
17971 POINT pos;
17972 RECT rect;
17973 INT x, y;
17974 LRESULT res;
17976 char buffA[64];
17977 HANDLE thread;
17978
17979 hwnd = CreateWindowExA(0, "TestWindowClass", "test_defwndproc",
17980 WS_VISIBLE | WS_CAPTION | WS_OVERLAPPEDWINDOW, 0,0,500,100,0,0,0, NULL);
17981 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
17982 flush_events();
17983
17984 buffA[0] = 0;
17985 GetWindowTextA(hwnd, buffA, ARRAY_SIZE(buffA));
17986 ok(!strcmp(buffA, "test_defwndproc"), "unexpected window text, %s\n", buffA);
17987
17988 /* Zero high word of the lParam */
17989 res = DefWindowProcA(hwnd, WM_SETTEXT, 0, 0x1234);
17990 ok(res == 0, "WM_SETTEXT was expected to fail, %Id\n", res);
17991
17992 GetWindowTextA(hwnd, buffA, ARRAY_SIZE(buffA));
17993 ok(!strcmp(buffA, "test_defwndproc"), "unexpected window text, %s\n", buffA);
17994
17995 res = DefWindowProcW(hwnd, WM_SETTEXT, 0, 0x1234);
17996 ok(res == 0, "WM_SETTEXT was expected to fail, %Id\n", res);
17997
17998 GetWindowTextA(hwnd, buffA, ARRAY_SIZE(buffA));
17999 ok(!strcmp(buffA, "test_defwndproc"), "unexpected window text, %s\n", buffA);
18000
18002 flush_events();
18004
18006 flush_events();
18007#if !defined(__REACTOS__) || !defined(_MSC_VER) // Fails on Windows when built with MSVC
18008 ok_sequence(WmRestoreMinimizedOverlappedSeq, "DefWindowProcA(SC_RESTORE):overlapped", TRUE);
18009#endif
18010
18013 ok(GetActiveWindow() == hwnd, "Unexpected active window\n");
18014 flush_events();
18017 flush_events();
18018#ifdef __REACTOS__
18020#endif
18021 ok_sequence(WmRestoreActiveMinimizedOverlappedSeq, "DefWindowProcA(SC_RESTORE):active minimized overlapped", TRUE);
18022
18023#ifdef __REACTOS__
18024 if (!is_reactos() && GetNTVersion() == _WIN32_WINNT_WS03) {
18025 skip("The rest of these tests crash on WHS testbot!\n");
18028 return;
18029 }
18030#endif
18031 child[0] = CreateWindowExA(0, "TestWindowClass", "1st child",
18032 WS_VISIBLE | WS_CHILD, 0,0,500,100, hwnd, 0, 0, NULL);
18033 child[1] = CreateWindowExA(0, "TestWindowClass", "2nd child",
18034 WS_VISIBLE | WS_CHILD, 0,0,500,100, child[0], 0, 0, NULL);
18035 child[2] = CreateWindowExA(0, "TestWindowClass", "3rd child",
18036 WS_VISIBLE | WS_CHILD, 0,0,500,100, child[1], 0, 0, NULL);
18037 flush_events();
18040 DefWindowProcA(child[2], WM_CONTEXTMENU, 0xcafe, 0);
18042 WmContextMenuSeq[0].wParam = (WPARAM)child[2];
18043 WmContextMenuSeq[1].wParam = (WPARAM)child[1];
18044 WmContextMenuSeq[2].wParam = (WPARAM)child[0];
18045 ok_sequence(WmContextMenuSeq, "DefWindowProcA(WM_CONTEXTMENU)", FALSE);
18046 DestroyWindow(child[0]);
18047
18048 GetCursorPos(&pos);
18050 x = (rect.left+rect.right) / 2;
18051 y = rect.top + GetSystemMetrics(SM_CYFRAME) + 1;
18052 SetCursorPos(x, y);
18053 flush_events();
18055 ok(res == HTCAPTION, "WM_NCHITTEST returned %Id\n", res);
18056
18057 mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
18058 mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
18059 flush_events();
18060
18062 mouse_event( MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0 );
18063 /* workaround for missing support for clicking on window frame */
18064 data.hwnd = hwnd;
18065 data.wndproc_finished = CreateEventA( NULL, FALSE, FALSE, NULL );
18066 thread = CreateThread( NULL, 0, post_rbuttonup_msg, (void*)&data, 0, NULL );
18067
18069 ok_sequence(NCRBUTTONDOWNSeq, "WM_NCRBUTTONDOWN on caption", FALSE);
18070
18071 res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, 0, MAKELPARAM(x, y));
18072 ok(!res, "WM_NCXBUTTONUP returned %Id\n", res);
18073 ok_sequence(WmEmptySeq, "WM_NCXBUTTONUP without button", FALSE);
18074
18075 res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, MAKEWPARAM(0, XBUTTON1), MAKELPARAM(x, y));
18076 ok(!res, "WM_NCXBUTTONUP returned %Id\n", res);
18077 ok_sequence(NCXBUTTONUPSeq1, "WM_NCXBUTTONUP with XBUTTON1", FALSE);
18078
18079 res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, MAKEWPARAM(0, XBUTTON2), MAKELPARAM(x, y));
18080 ok(!res, "WM_NCXBUTTONUP returned %Id\n", res);
18081 ok_sequence(NCXBUTTONUPSeq2, "WM_NCXBUTTONUP with XBUTTON2", FALSE);
18082
18083 res = DefWindowProcA(hwnd, WM_NCXBUTTONUP, MAKEWPARAM(0, 3), MAKELPARAM(x, y));
18084 ok(!res, "WM_NCXBUTTONUP returned %Id\n", res);
18085 ok_sequence(WmEmptySeq, "WM_NCXBUTTONUP with invalid button", FALSE);
18086
18087 /* Test WM_MOUSEACTIVATE */
18088#define TEST_MOUSEACTIVATE(A,B,C) \
18089 res = DefWindowProcA(hwnd, WM_MOUSEACTIVATE, (WPARAM)hwnd, (LPARAM)MAKELRESULT(A,0)); \
18090 ok(res == B, "WM_MOUSEACTIVATE for %s returned %Id\n", #A, res); \
18091 res = DefWindowProcA(hwnd, WM_MOUSEACTIVATE, (WPARAM)hwnd, (LPARAM)MAKELRESULT(A,WM_LBUTTONDOWN)); \
18092 ok(res == C, "WM_MOUSEACTIVATE for %s returned %Id\n", #A, res);
18093
18118
18119 SetEvent( data.wndproc_finished );
18120 WaitForSingleObject( thread, 1000 );
18121 CloseHandle( data.wndproc_finished );
18123
18124 SetCursorPos(pos.x, pos.y);
18125
18127 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) {
18128 if( msg.message == WM_QUIT) gotwmquit = TRUE;
18130 }
18131 ok(!gotwmquit, "Unexpected WM_QUIT message!\n");
18133}
static HWND child
Definition: cursoricon.c:298
static const struct message WmRestoreActiveMinimizedOverlappedSeq[]
Definition: msg.c:17898
static DWORD CALLBACK post_rbuttonup_msg(void *arg)
Definition: msg.c:17953
static const struct message NCXBUTTONUPSeq2[]
Definition: msg.c:17845
#define TEST_MOUSEACTIVATE(A, B, C)
static const struct message NCXBUTTONUPSeq1[]
Definition: msg.c:17839
static struct message WmContextMenuSeq[]
Definition: msg.c:17940
static const struct message NCRBUTTONDOWNSeq[]
Definition: msg.c:17830
static const struct message WmRestoreMinimizedOverlappedSeq[]
Definition: msg.c:17852
#define _WIN32_WINNT_WS03
Definition: sdkddkver.h:23
#define _WIN32_WINNT_WIN7
Definition: sdkddkver.h:28
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:573
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1300
#define HTTOPRIGHT
Definition: winuser.h:2528
#define HTCLOSE
Definition: winuser.h:2535
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define HTCAPTION
Definition: winuser.h:2512
#define HTTOPLEFT
Definition: winuser.h:2527
#define HTBOTTOM
Definition: winuser.h:2529
#define HTBORDER
Definition: winuser.h:2533
#define HTERROR
Definition: winuser.h:2508
#define HTVSCROLL
Definition: winuser.h:2518
#define MA_ACTIVATE
Definition: winuser.h:2537
#define HTHSCROLL
Definition: winuser.h:2517
#define MA_NOACTIVATE
Definition: winuser.h:2539
#define HTMAXBUTTON
Definition: winuser.h:2520
#define HTOBJECT
Definition: winuser.h:2534
#define SM_CYFRAME
Definition: winuser.h:1007
#define HTMENU
Definition: winuser.h:2516
#define HTHELP
Definition: winuser.h:2536
#define HTRIGHT
Definition: winuser.h:2525
#define HTBOTTOMRIGHT
Definition: winuser.h:2531
#define HTNOWHERE
Definition: winuser.h:2510
#define HTSIZE
Definition: winuser.h:2515
#define HTBOTTOMLEFT
Definition: winuser.h:2530
#define HTTOP
Definition: winuser.h:2526
#define HTTRANSPARENT
Definition: winuser.h:2509
#define HTMINBUTTON
Definition: winuser.h:2519
#define HTSYSMENU
Definition: winuser.h:2513
#define HTLEFT
Definition: winuser.h:2523
#define SC_RESTORE
Definition: winuser.h:2634
int WINAPI GetSystemMetrics(_In_ int)
#define WM_NCRBUTTONDOWN
Definition: winuser.h:1723

Referenced by START_TEST().

◆ test_desktop_winproc()

static void test_desktop_winproc ( void  )
static

Definition at line 18135 of file msg.c.

18136{
18138 RECT rect, default_rect;
18139 WNDPROC desktop_proc;
18140 char buffer[256];
18141 WNDCLASSA cls;
18142 LRESULT res;
18143 HWND hwnd;
18144 BOOL ret;
18145
18146 ret = GetClassInfoA(instance, (const CHAR *)MAKEINTATOM(32769), &cls);
18147 ok(ret, "Failed to get desktop class.\n");
18148 desktop_proc = cls.lpfnWndProc;
18149
18150 memset(&cls, 0, sizeof(cls));
18151 cls.lpfnWndProc = desktop_proc;
18152 cls.hInstance = instance;
18155 cls.lpszClassName = "TestDesktopClass";
18156 register_class(&cls);
18157
18158 hwnd = CreateWindowExA(0, cls.lpszClassName, "test_desktop_wndproc",
18159 WS_VISIBLE | WS_CAPTION | WS_OVERLAPPEDWINDOW, 0, 0, 500, 100, 0, 0, 0, NULL);
18160 if (!hwnd) /* win2003 */
18161 {
18162 skip("Failed to create window with desktop window procedure.\n");
18163 goto out_unregister;
18164 }
18165
18166 memset(&cls, 0, sizeof(cls));
18167 ret = GetClassInfoA(instance, "TestDesktopClass", &cls);
18168 ok(ret, "Failed to get class info.\n");
18169 ok(cls.lpfnWndProc == desktop_proc, "Got %p, expected %p.\n", cls.lpfnWndProc, desktop_proc);
18170
18172 todo_wine ok(!strcmp(buffer, "test_desktop_wndproc"), "Got unexpected window text: %s.\n", buffer);
18173
18174 res = CallWindowProcA(desktop_proc, hwnd, WM_SETTEXT, 0, (LPARAM)"test");
18175 ok(res == TRUE, "Failed to set text, %Id.\n", res);
18177 ok(!strcmp(buffer, "test"), "Got unexpected window text: %s.\n", buffer);
18178
18179 SetRect(&default_rect, 0, 0, 100, 100);
18180 res = DefWindowProcW(hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&default_rect);
18181 ok(!res, "Got unexpected result %Id.\n", res);
18182
18183 SetRect(&rect, 0, 0, 100, 100);
18184 res = CallWindowProcA(desktop_proc, hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rect);
18185 ok(!res, "Got unexpected result %Id.\n", res);
18186 todo_wine ok(EqualRect(&rect, &default_rect), "rect Got %s, expected %s.\n",
18187 wine_dbgstr_rect(&rect), wine_dbgstr_rect(&default_rect));
18188
18190
18191out_unregister:
18192 UnregisterClassA("TestDesktopClass", instance);
18193}
static HINSTANCE instance
Definition: main.c:40
#define MAKEINTATOM(i)
Definition: winbase.h:1220
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ test_DestroyWindow()

static void test_DestroyWindow ( void  )
static

Definition at line 12945 of file msg.c.

12946{
12947 BOOL ret;
12948 HWND parent, child1, child2, child3, child4, test;
12949 UINT_PTR child_id = WND_CHILD_ID + 1;
12950
12951 parent = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
12952 100, 100, 200, 200, 0, 0, 0, NULL);
12953 ok(!!parent, "Failed to create window, error %lu.\n", GetLastError());
12954 child1 = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD,
12955 0, 0, 50, 50, parent, (HMENU)child_id++, 0, NULL);
12956 ok(!!child1, "Failed to create window, error %lu.\n", GetLastError());
12957 child2 = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD,
12958 0, 0, 50, 50, GetDesktopWindow(), (HMENU)child_id++, 0, NULL);
12959 ok(!!child2, "Failed to create window, error %lu.\n", GetLastError());
12960 child3 = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD,
12961 0, 0, 50, 50, child1, (HMENU)child_id++, 0, NULL);
12962 ok(!!child3, "Failed to create window, error %lu.\n", GetLastError());
12963 child4 = CreateWindowExA(0, "TestWindowClass", NULL, WS_POPUP,
12964 0, 0, 50, 50, parent, 0, 0, NULL);
12965 ok(!!child4, "Failed to create window, error %lu.\n", GetLastError());
12966
12967 /* test owner/parent of child2 */
12968 test = GetParent(child2);
12969 ok(test == GetDesktopWindow(), "wrong parent %p\n", test);
12970 ok(!IsChild(parent, child2), "wrong parent/child %p/%p\n", parent, child2);
12971 test = GetAncestor(child2, GA_PARENT);
12972 ok(test == GetDesktopWindow(), "wrong parent %p\n", test);
12973 test = GetWindow(child2, GW_OWNER);
12974 ok(!test, "wrong owner %p\n", test);
12975
12976 test = SetParent(child2, parent);
12977 ok(test == GetDesktopWindow(), "wrong old parent %p\n", test);
12978
12979 /* test owner/parent of the parent */
12981 ok(!test, "wrong parent %p\n", test);
12982 ok(!IsChild(GetDesktopWindow(), parent), "wrong parent/child %p/%p\n", GetDesktopWindow(), parent);
12984 ok(test == GetDesktopWindow(), "wrong parent %p\n", test);
12986 ok(!test, "wrong owner %p\n", test);
12987
12988 /* test owner/parent of child1 */
12989 test = GetParent(child1);
12990 ok(test == parent, "wrong parent %p\n", test);
12991 ok(IsChild(parent, child1), "wrong parent/child %p/%p\n", parent, child1);
12992 test = GetAncestor(child1, GA_PARENT);
12993 ok(test == parent, "wrong parent %p\n", test);
12994 test = GetWindow(child1, GW_OWNER);
12995 ok(!test, "wrong owner %p\n", test);
12996
12997 /* test owner/parent of child2 */
12998 test = GetParent(child2);
12999 ok(test == parent, "wrong parent %p\n", test);
13000 ok(IsChild(parent, child2), "wrong parent/child %p/%p\n", parent, child2);
13001 test = GetAncestor(child2, GA_PARENT);
13002 ok(test == parent, "wrong parent %p\n", test);
13003 test = GetWindow(child2, GW_OWNER);
13004 ok(!test, "wrong owner %p\n", test);
13005
13006 /* test owner/parent of child3 */
13007 test = GetParent(child3);
13008 ok(test == child1, "wrong parent %p\n", test);
13009 ok(IsChild(parent, child3), "wrong parent/child %p/%p\n", parent, child3);
13010 test = GetAncestor(child3, GA_PARENT);
13011 ok(test == child1, "wrong parent %p\n", test);
13012 test = GetWindow(child3, GW_OWNER);
13013 ok(!test, "wrong owner %p\n", test);
13014
13015 /* test owner/parent of child4 */
13016 test = GetParent(child4);
13017 ok(test == parent, "wrong parent %p\n", test);
13018 ok(!IsChild(parent, child4), "wrong parent/child %p/%p\n", parent, child4);
13019 test = GetAncestor(child4, GA_PARENT);
13020 ok(test == GetDesktopWindow(), "wrong parent %p\n", test);
13021 test = GetWindow(child4, GW_OWNER);
13022 ok(test == parent, "wrong owner %p\n", test);
13023
13025
13026 if (winetest_debug > 1) trace("parent %p, child1 %p, child2 %p, child3 %p, child4 %p\n",
13027 parent, child1, child2, child3, child4);
13028
13029 SetCapture(child4);
13030 test = GetCapture();
13031 ok(test == child4, "wrong capture window %p\n", test);
13032
13035 ok( ret, "DestroyWindow() error %ld\n", GetLastError());
13037 ok_sequence(destroy_window_with_children, "destroy window with children", FALSE);
13038
13039 ok(!IsWindow(parent), "parent still exists\n");
13040 ok(!IsWindow(child1), "child1 still exists\n");
13041 ok(!IsWindow(child2), "child2 still exists\n");
13042 ok(!IsWindow(child3), "child3 still exists\n");
13043 ok(!IsWindow(child4), "child4 still exists\n");
13044
13045 test = GetCapture();
13046 ok(!test, "wrong capture window %p\n", test);
13047}
#define WND_CHILD_ID
Definition: msg.c:58
static const struct message destroy_window_with_children[]
Definition: msg.c:12922
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define GW_OWNER
Definition: winuser.h:777
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)

Referenced by START_TEST().

◆ test_dialog_messages()

static void test_dialog_messages ( void  )
static

Definition at line 15988 of file msg.c.

15989{
15990 WNDCLASSA cls;
15991 HWND hdlg, hedit1, hedit2, hfocus, parent, child, child2;
15992 LRESULT ret;
15993
15994#define set_selection(hctl, start, end) \
15995 ret = SendMessageA(hctl, EM_SETSEL, start, end); \
15996 ok(ret == 1, "EM_SETSEL returned %Id\n", ret);
15997
15998#define check_selection(hctl, start, end) \
15999 ret = SendMessageA(hctl, EM_GETSEL, 0, 0); \
16000 ok(ret == MAKELRESULT(start, end), "wrong selection (%d - %d)\n", LOWORD(ret), HIWORD(ret));
16001
16002 subclass_edit();
16003
16004 hdlg = CreateWindowExA(WS_EX_DLGMODALFRAME, "TestDialogClass", NULL,
16006 0, 0, 100, 100, 0, 0, 0, NULL);
16007 ok(hdlg != 0, "Failed to create custom dialog window\n");
16008
16009 hedit1 = CreateWindowExA(0, "my_edit_class", NULL,
16011 0, 0, 80, 20, hdlg, (HMENU)1, 0, NULL);
16012 ok(hedit1 != 0, "Failed to create edit control\n");
16013 hedit2 = CreateWindowExA(0, "my_edit_class", NULL,
16015 0, 40, 80, 20, hdlg, (HMENU)2, 0, NULL);
16016 ok(hedit2 != 0, "Failed to create edit control\n");
16017
16018 SendMessageA(hedit1, WM_SETTEXT, 0, (LPARAM)"hello");
16019 SendMessageA(hedit2, WM_SETTEXT, 0, (LPARAM)"bye");
16020
16021 hfocus = GetFocus();
16022 ok(hfocus == hdlg, "wrong focus %p\n", hfocus);
16023
16024 SetFocus(hedit2);
16025 hfocus = GetFocus();
16026 ok(hfocus == hedit2, "wrong focus %p\n", hfocus);
16027
16028 check_selection(hedit1, 0, 0);
16029 check_selection(hedit2, 0, 0);
16030
16031 set_selection(hedit2, 0, -1);
16032 check_selection(hedit2, 0, 3);
16033
16034 SetFocus(0);
16035 hfocus = GetFocus();
16036 ok(hfocus == 0, "wrong focus %p\n", hfocus);
16037
16039 ret = DefDlgProcA(hdlg, WM_SETFOCUS, 0, 0);
16040 ok(ret == 0, "WM_SETFOCUS returned %Id\n", ret);
16041 ok_sequence(WmDefDlgSetFocus_1, "DefDlgProc(WM_SETFOCUS) 1", FALSE);
16042
16043 hfocus = GetFocus();
16044 ok(hfocus == hedit1, "wrong focus %p\n", hfocus);
16045
16046 check_selection(hedit1, 0, 5);
16047 check_selection(hedit2, 0, 3);
16048
16050 ret = DefDlgProcA(hdlg, WM_SETFOCUS, 0, 0);
16051 ok(ret == 0, "WM_SETFOCUS returned %Id\n", ret);
16052 ok_sequence(WmDefDlgSetFocus_2, "DefDlgProc(WM_SETFOCUS) 2", FALSE);
16053
16054 hfocus = GetFocus();
16055 ok(hfocus == hedit1, "wrong focus %p\n", hfocus);
16056
16057 check_selection(hedit1, 0, 5);
16058 check_selection(hedit2, 0, 3);
16059
16060 EndDialog(hdlg, 0);
16061 DestroyWindow(hedit1);
16062 DestroyWindow(hedit2);
16063 DestroyWindow(hdlg);
16065
16066#undef set_selection
16067#undef check_selection
16068
16069 ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n");
16070 cls.lpszClassName = "MyDialogClass";
16072 /* need a cast since a dlgproc is used as a wndproc */
16074 register_class(&cls);
16075
16076 SetFocus(0);
16078 hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 0);
16079 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16080 ok_sequence(WmCreateDialogParamSeq_0, "CreateDialogParam_0", FALSE);
16081 hfocus = GetFocus();
16082 ok(hfocus == 0, "wrong focus %p\n", hfocus);
16083 EndDialog(hdlg, 0);
16084 DestroyWindow(hdlg);
16086
16087 SetFocus(0);
16089 hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, test_dlg_proc, 1);
16090 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16091 ok_sequence(WmCreateDialogParamSeq_1, "CreateDialogParam_1", FALSE);
16092 hfocus = GetFocus();
16093 ok(hfocus == hdlg, "wrong focus %p\n", hfocus);
16094 EndDialog(hdlg, 0);
16095 DestroyWindow(hdlg);
16097
16098 hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", 0, NULL, 0);
16099 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16100 ok_sequence(WmCreateDialogParamSeq_2, "CreateDialogParam_2", FALSE);
16101 EndDialog(hdlg, 0);
16102 DestroyWindow(hdlg);
16104
16105 hdlg = CreateDialogParamA(0, "FOCUS_TEST_DIALOG_3", 0, test_dlg_proc2, 0);
16106 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16107#ifdef __REACTOS__
16109#endif
16110 ok_sequence(WmCreateDialogParamSeq_3, "CreateDialogParam_3", TRUE);
16111 EndDialog(hdlg, 0);
16112 DestroyWindow(hdlg);
16114
16117 register_class(&cls);
16118 hdlg = CreateDialogParamA(0, "FOCUS_TEST_DIALOG_4", 0, test_dlg_proc3, 0);
16119 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16120#ifdef __REACTOS__
16122#endif
16123 ok_sequence(WmCreateDialogParamSeq_4, "CreateDialogParam_4", TRUE);
16124 EndDialog(hdlg, 0);
16125 DestroyWindow(hdlg);
16127
16129
16130 parent = CreateWindowExA(0, "TestParentClass", "Test parent",
16132 100, 100, 200, 200, 0, 0, 0, NULL);
16133 ok (parent != 0, "Failed to create parent window\n");
16134
16135 /* This child has no parent set. We will later call SetParent on it,
16136 * so that it will have a parent set, but no WS_CHILD style. */
16137 child = CreateWindowExA(0, "TestWindowClass", "Test child",
16139 100, 100, 200, 200, 0, 0, 0, NULL);
16140 ok (child != 0, "Failed to create child window\n");
16141
16142 /* This is a regular child window. When used as an owner, the other
16143 * child window will be used. */
16144 child2 = CreateWindowExA(0, "SimpleWindowClass", "Test child2",
16146 100, 100, 200, 200, child, 0, 0, NULL);
16147 ok (child2 != 0, "Failed to create child window\n");
16148
16150 SetFocus(child);
16151
16153 DialogBoxA( 0, "TEST_DIALOG", child2, TestModalDlgProc2 );
16154 ok_sequence(WmModalDialogSeq_2, "ModalDialog2", TRUE);
16155
16156 DestroyWindow(child2);
16160}
static const struct message WmCreateDialogParamSeq_4[]
Definition: msg.c:15947
#define set_selection(hctl, start, end)
static void subclass_edit(void)
Definition: msg.c:13679
static LRESULT WINAPI test_dlg_proc4(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:15802
static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:15728
static const struct message WmCreateDialogParamSeq_0[]
Definition: msg.c:15858
static const struct message WmModalDialogSeq_2[]
Definition: msg.c:1891
static const struct message WmCreateDialogParamSeq_2[]
Definition: msg.c:15902
static INT_PTR CALLBACK TestModalDlgProc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:4823
static const struct message WmDefDlgSetFocus_1[]
Definition: msg.c:15825
static const struct message WmDefDlgSetFocus_2[]
Definition: msg.c:15846
static INT_PTR WINAPI test_dlg_proc2(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:15773
static const struct message WmCreateDialogParamSeq_3[]
Definition: msg.c:15914
#define check_selection(hctl, start, end)
static INT_PTR WINAPI test_dlg_proc3(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:15796
static const struct message WmCreateDialogParamSeq_1[]
Definition: msg.c:15872
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define DialogBoxA(i, t, p, f)
Definition: winuser.h:4552
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by START_TEST().

◆ test_DispatchMessage()

static void test_DispatchMessage ( void  )
static

Definition at line 13064 of file msg.c.

13065{
13066 RECT rect;
13067 MSG msg;
13068 int count;
13069 HWND hwnd = CreateWindowA( "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
13070 100, 100, 200, 200, 0, 0, 0, NULL);
13072 UpdateWindow( hwnd );
13073 flush_events();
13076
13077 SetRect( &rect, -5, -5, 5, 5 );
13079 count = 0;
13080 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
13081 {
13082 if (msg.message != WM_PAINT) DispatchMessageA( &msg );
13083 else
13084 {
13087 /* DispatchMessage will send WM_NCPAINT if non client area is still invalid after WM_PAINT */
13088 if (!count) ok_sequence( WmDispatchPaint, "WmDispatchPaint", FALSE );
13089 else ok_sequence( WmEmptySeq, "WmEmpty", FALSE );
13090 if (++count > 10) break;
13091 }
13092 }
13093 ok( msg.message == WM_PAINT && count > 10, "WM_PAINT messages stopped\n" );
13094
13095 if (winetest_debug > 1) trace("now without DispatchMessage\n");
13098 count = 0;
13099 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
13100 {
13101 if (msg.message != WM_PAINT) DispatchMessageA( &msg );
13102 else
13103 {
13104 HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
13106 /* this will send WM_NCCPAINT just like DispatchMessage does */
13108 ok_sequence( WmDispatchPaint, "WmDispatchPaint", FALSE );
13109 DeleteObject( hrgn );
13110 GetClientRect( hwnd, &rect );
13111 ValidateRect( hwnd, &rect ); /* this will stop WM_PAINTs */
13112 ok( !count, "Got multiple WM_PAINTs\n" );
13113 if (++count > 10) break;
13114 }
13115 }
13116
13119 count = 0;
13120 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
13121 {
13122 if (msg.message != WM_PAINT) DispatchMessageA( &msg );
13123 else
13124 {
13125 HDC hdc;
13126
13128 hdc = BeginPaint( hwnd, NULL );
13129 ok( !hdc, "got valid hdc %p from BeginPaint\n", hdc );
13130 ok( !EndPaint( hwnd, NULL ), "EndPaint succeeded\n" );
13131 ok_sequence( WmDispatchPaint, "WmDispatchPaint", FALSE );
13132 ok( !count, "Got multiple WM_PAINTs\n" );
13133 if (++count > 10) break;
13134 }
13135 }
13137}
static const struct message WmDispatchPaint[]
Definition: msg.c:13050
static LRESULT WINAPI DispatchMessageCheckProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:13058
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)

Referenced by START_TEST().

◆ test_dlg_proc()

static INT_PTR WINAPI test_dlg_proc ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 15728 of file msg.c.

15729{
15730 struct recvd_message msg;
15731
15732 if (ignore_message( message )) return 0;
15733
15734 msg.hwnd = hwnd;
15735 msg.message = message;
15736 msg.flags = sent|wparam|lparam;
15737 msg.wParam = wParam;
15738 msg.lParam = lParam;
15739 msg.descr = "dialog";
15740 add_message(&msg);
15741
15742 /* calling DefDlgProc leads to a recursion under XP */
15743
15744 switch (message)
15745 {
15746 case WM_INITDIALOG:
15747 return lParam;
15748
15749 case WM_GETDLGCODE:
15750 return 0;
15751 }
15752 return 1;
15753}
#define WM_INITDIALOG
Definition: winuser.h:1767

Referenced by test_dialog_messages(), and test_EndDialog().

◆ test_dlg_proc2()

static INT_PTR WINAPI test_dlg_proc2 ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 15773 of file msg.c.

15774{
15775 struct recvd_message msg;
15776
15777 if (ignore_message( message )) return 0;
15778
15779 msg.hwnd = hwnd;
15780 msg.message = message;
15781 msg.flags = sent|wparam|lparam|parent;
15782 msg.wParam = wParam;
15783 msg.lParam = lParam;
15784 msg.descr = "dialog";
15785 add_message(&msg);
15786
15787 if (message == WM_INITDIALOG)
15788 {
15791 }
15792
15793 return 1;
15794}
static LRESULT WINAPI dlg_creation_edit_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
Definition: msg.c:15756
#define LONG_PTR
Definition: treelist.c:79

Referenced by test_dialog_messages().

◆ test_dlg_proc3()

static INT_PTR WINAPI test_dlg_proc3 ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 15796 of file msg.c.

15797{
15798 ok( 0, "should not be called since DefDlgProc is not used\n" );
15799 return 0;
15800}

Referenced by test_dialog_messages().

◆ test_dlg_proc4()

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

Definition at line 15802 of file msg.c.

15803{
15804 struct recvd_message msg;
15805
15806 if (!ignore_message( message ))
15807 {
15808 msg.hwnd = hwnd;
15809 msg.message = message;
15810 msg.flags = sent|wparam|lparam|parent;
15811 msg.wParam = wParam;
15812 msg.lParam = lParam;
15813 msg.descr = "dialog";
15814 add_message(&msg);
15815 }
15816 if (message == WM_INITDIALOG)
15817 {
15820 return 1;
15821 }
15823}

Referenced by test_dialog_messages().

◆ test_DoubleSetCapture()

static void test_DoubleSetCapture ( void  )
static

Definition at line 20446 of file msg.c.

20447{
20448 HWND hwnd;
20449
20450 hwnd = CreateWindowExA(0, "TestWindowClass", "Test DoubleSetCapture",
20452 100, 100, 200, 200, 0, 0, 0, NULL);
20453 ok (hwnd != 0, "Failed to create overlapped window\n");
20454
20456 UpdateWindow( hwnd );
20457 flush_events();
20459
20460 SetCapture( hwnd );
20461 SetCapture( hwnd );
20462 ok_sequence(DoubleSetCaptureSeq, "SetCapture( hwnd ) twice", FALSE);
20463
20465}
static const struct message DoubleSetCaptureSeq[]
Definition: msg.c:20437

Referenced by START_TEST().

◆ test_edit_ime_messages()

static DWORD WINAPI test_edit_ime_messages ( void unused_arg)
static

Definition at line 13525 of file msg.c.

13526{
13527 static const HKL korean_hkl = (HKL)0x04120412;
13529 LRESULT lr;
13530 HIMC himc;
13531 HWND hwnd;
13532 BOOL ret;
13533 HKL hkl;
13534 MSG msg;
13535
13537
13538 hwnd = CreateWindowA(WC_EDITA, "Test", WS_POPUP | WS_VISIBLE, 10, 10, 300, 300, NULL, NULL,
13539 NULL, NULL);
13540 ok(hwnd != NULL, "CreateWindowA failed.\n");
13541
13542 /* Test EM_{GET|SET}IMESTATUS */
13543 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13544 ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
13545
13546 /* Note that EM_SETIMESTATUS always return 1, which is contrary to what MSDN says about
13547 * returning the previous LPARAM value */
13548 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE);
13549 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13550 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13551 ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr);
13552
13553 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_CANCELCOMPSTRINFOCUS);
13554 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13555 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13556 ok(lr == EIMES_CANCELCOMPSTRINFOCUS, "Got unexpected lr %#Ix.\n", lr);
13557
13558 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_COMPLETECOMPSTRKILLFOCUS);
13559 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13560 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13561 ok(lr == EIMES_COMPLETECOMPSTRKILLFOCUS, "Got unexpected lr %#Ix.\n", lr);
13562
13563 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE
13564 | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS);
13565 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13566 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13567 ok(lr == (EIMES_GETCOMPSTRATONCE | EIMES_CANCELCOMPSTRINFOCUS | EIMES_COMPLETECOMPSTRKILLFOCUS),
13568 "Got unexpected lr %#Ix.\n", lr);
13569
13570 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13571 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13572 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13573 ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
13574
13575 /* Invalid EM_{GET|SET}IMESTATUS status types and flags */
13576 lr = SendMessageA(hwnd, EM_GETIMESTATUS, 0, 0);
13577 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13578
13579 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING + 1, 0);
13580 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13581
13582 lr = SendMessageA(hwnd, EM_SETIMESTATUS, 0, EIMES_GETCOMPSTRATONCE);
13583 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13584 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13585 ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
13586
13587 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING + 1, EIMES_GETCOMPSTRATONCE);
13588 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13589 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13590 ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
13591
13592 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0xFFFFFFFF);
13593 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13594 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13595 ok(lr == 0xFFFF, "Got unexpected lr %#Ix.\n", lr);
13596
13597 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13598 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13599 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13600 ok(lr == 0, "Got unexpected lr %#Ix.\n", lr);
13601
13602 /* Test IME messages when EIMES_GETCOMPSTRATONCE is not set */
13605
13606 himc = ImmGetContext(hwnd);
13607 ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0);
13608#ifdef __REACTOS__
13609 ok(ret || broken(GetNTVersion() < _WIN32_WINNT_VISTA), "ImmSetCompositionStringA failed.\n");
13610#else
13611 ok(ret, "ImmSetCompositionStringA failed.\n");
13612#endif
13615#ifdef __REACTOS__
13616 ok(ret || broken(GetNTVersion() < _WIN32_WINNT_VISTA), "ImmNotifyIME failed.\n");
13617#else
13618 ok(ret, "ImmNotifyIME failed.\n");
13619#endif
13620 /* Note that the following message loop is necessary to get the WM_CHAR messages because they
13621 * are posted. Same for the later message loops in this function. */
13622 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
13623 if (hkl == korean_hkl)
13625 "korean WM_IME_COMPOSITION", TRUE);
13626 else
13627#ifdef __REACTOS__
13629#endif
13630 ok_sequence(edit_wm_ime_composition_seq, "WM_IME_COMPOSITION", TRUE);
13631
13632 /* Test that WM_IME_CHAR is passed to DefWindowProc() to get WM_CHAR */
13634 SendMessageA(hwnd, WM_IME_CHAR, '0', 1);
13635 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
13636 ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", FALSE);
13637
13638 /* Test IME messages when EIMES_GETCOMPSTRATONCE is set */
13639 lr = SendMessageA(hwnd, EM_SETIMESTATUS, EMSIS_COMPOSITIONSTRING, EIMES_GETCOMPSTRATONCE);
13640 ok(lr == 1, "Got unexpected lr %#Ix.\n", lr);
13641 lr = SendMessageA(hwnd, EM_GETIMESTATUS, EMSIS_COMPOSITIONSTRING, 0);
13642 ok(lr == EIMES_GETCOMPSTRATONCE, "Got unexpected lr %#Ix.\n", lr);
13643
13644 ret = ImmSetCompositionStringA(himc, SCS_SETSTR, "Wine", 4, NULL, 0);
13645#ifdef __REACTOS__
13646 ok(ret || broken(GetNTVersion() < _WIN32_WINNT_VISTA), "ImmSetCompositionStringA failed.\n");
13647#else
13648 ok(ret, "ImmSetCompositionStringA failed.\n");
13649#endif
13652#ifdef __REACTOS__
13653 ok(ret || broken(GetNTVersion() < _WIN32_WINNT_VISTA), "ImmNotifyIME failed.\n");
13654#else
13655 ok(ret, "ImmNotifyIME failed.\n");
13656#endif
13657 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
13658 if (hkl == korean_hkl)
13660 "korean WM_IME_COMPOSITION with EIMES_GETCOMPSTRATONCE", TRUE);
13661 else
13662#ifdef __REACTOS__
13664#endif
13666 "WM_IME_COMPOSITION with EIMES_GETCOMPSTRATONCE", TRUE);
13667
13668 /* Test that WM_IME_CHAR is passed to DefWindowProc() to get WM_CHAR with EIMES_GETCOMPSTRATONCE */
13670 SendMessageA(hwnd, WM_IME_CHAR, '0', 1);
13671 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
13672 ok_sequence(edit_wm_ime_char_seq, "WM_IME_CHAR", FALSE);
13673
13674 ImmReleaseContext(hwnd, himc);
13676 return 0;
13677}
DWORD HIMC
Definition: dimm.idl:75
BOOL WINAPI ImmSetCompositionStringA(_In_ HIMC hIMC, _In_ DWORD dwIndex, _Inout_updates_bytes_opt_(dwCompLen) LPVOID lpComp, _In_ DWORD dwCompLen, _Inout_updates_bytes_opt_(dwReadLen) LPVOID lpRead, _In_ DWORD dwReadLen)
Definition: compstr.c:956
HIMC WINAPI ImmGetContext(_In_ HWND hWnd)
Definition: imm.c:1066
#define CPS_COMPLETE
Definition: imm.h:178
#define SCS_SETSTR
Definition: imm.h:308
BOOL WINAPI ImmReleaseContext(_In_ HWND hWnd, _In_ HIMC hIMC)
Definition: imm.c:1110
BOOL WINAPI ImmNotifyIME(_In_ HIMC hIMC, _In_ DWORD dwAction, _In_ DWORD dwIndex, _In_ DWORD_PTR dwValue)
Definition: ime.c:458
#define NI_COMPOSITIONSTR
Definition: immdev.h:381
static WNDPROC old_proc
Definition: clipboard.c:236
static const struct message edit_wm_ime_composition_seq[]
Definition: msg.c:13429
static const struct message edit_wm_ime_composition_korean_seq[]
Definition: msg.c:13445
static const struct message edit_wm_ime_char_seq[]
Definition: msg.c:13460
static LRESULT CALLBACK edit_ime_subclass_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:13482
static const struct message edit_eimes_getcompstratonce_korean_seq[]
Definition: msg.c:13475
static const struct message edit_eimes_getcompstratonce_seq[]
Definition: msg.c:13467
#define WC_EDITA
Definition: commctrl.h:4691
#define EM_SETIMESTATUS
Definition: winuser.h:2039
#define WM_IME_CHAR
Definition: winuser.h:1862

Referenced by test_edit_messages().

◆ test_edit_messages()

static void test_edit_messages ( void  )
static

Definition at line 13696 of file msg.c.

13697{
13698 HWND hwnd, parent;
13699 DWORD dlg_code;
13700 HANDLE thread;
13701
13702#ifdef __REACTOS__
13703 /* test_edit_messages() crashes on Windows Vista and Windows 7 */
13704 if (!is_reactos() && (GetNTVersion() >= _WIN32_WINNT_VISTA && GetNTVersion() <= _WIN32_WINNT_WIN7)) {
13705 skip("This test crashes on Windows Vista and Windows 7.\n");
13706 return;
13707 }
13708#endif
13709 subclass_edit();
13711
13712 parent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
13713 100, 100, 200, 200, 0, 0, 0, NULL);
13714 ok (parent != 0, "Failed to create parent window\n");
13715
13716 /* test single line edit */
13717 hwnd = CreateWindowExA(0, "my_edit_class", "test", WS_CHILD,
13718 0, 0, 80, 20, parent, (HMENU)ID_EDIT, 0, NULL);
13719 ok(hwnd != 0, "Failed to create edit window\n");
13720
13721 dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
13722 ok(dlg_code == (DLGC_WANTCHARS|DLGC_HASSETSEL|DLGC_WANTARROWS), "wrong dlg_code %08lx\n", dlg_code);
13723
13725 SetFocus(hwnd);
13726 ok_sequence(sl_edit_invisible, "SetFocus(hwnd) on an invisible edit", FALSE);
13727
13730 SetFocus(0);
13732
13733 SetFocus(hwnd);
13734 ok_sequence(sl_edit_setfocus, "SetFocus(hwnd) on an edit", FALSE);
13735
13736 SetFocus(0);
13737 ok_sequence(sl_edit_killfocus, "SetFocus(0) on an edit", FALSE);
13738
13739 SetFocus(0);
13742
13744 ok_sequence(sl_edit_lbutton_dblclk, "WM_LBUTTONDBLCLK on an edit", FALSE);
13745
13746 SetFocus(0);
13749
13751 ok_sequence(sl_edit_lbutton_down, "WM_LBUTTONDOWN on an edit", FALSE);
13752
13754 ok_sequence(sl_edit_lbutton_up, "WM_LBUTTONUP on an edit", FALSE);
13755
13757
13758 /* test multiline edit */
13759 hwnd = CreateWindowExA(0, "my_edit_class", "test", WS_CHILD | ES_MULTILINE,
13760 0, 0, 80, 20, parent, (HMENU)ID_EDIT, 0, NULL);
13761 ok(hwnd != 0, "Failed to create edit window\n");
13762
13763 dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
13765 "wrong dlg_code %08lx\n", dlg_code);
13766
13769 SetFocus(0);
13771
13772 SetFocus(hwnd);
13773 ok_sequence(ml_edit_setfocus, "SetFocus(hwnd) on multiline edit", FALSE);
13774
13775 SetFocus(0);
13776 ok_sequence(sl_edit_killfocus, "SetFocus(0) on multiline edit", FALSE);
13777
13778 SetFocus(0);
13781
13783 ok_sequence(sl_edit_lbutton_dblclk, "WM_LBUTTONDBLCLK on multiline edit", FALSE);
13784
13785 SetFocus(0);
13788
13790 ok_sequence(ml_edit_lbutton_down, "WM_LBUTTONDOWN on multiline edit", FALSE);
13791
13793 ok_sequence(ml_edit_lbutton_up, "WM_LBUTTONUP on multiline edit", FALSE);
13794
13797
13799
13800 /* Test IME messages in another thread because IME is disabled in the current thread */
13804}
static const struct message sl_edit_lbutton_up[]
Definition: msg.c:13386
static const struct message sl_edit_lbutton_down[]
Definition: msg.c:13344
static DWORD WINAPI test_edit_ime_messages(void *unused_arg)
Definition: msg.c:13525
static const struct message sl_edit_killfocus[]
Definition: msg.c:13326
static const struct message ml_edit_lbutton_up[]
Definition: msg.c:13395
static const struct message sl_edit_invisible[]
Definition: msg.c:13295
static const struct message sl_edit_lbutton_dblclk[]
Definition: msg.c:13338
static const struct message ml_edit_setfocus[]
Definition: msg.c:13310
static const struct message ml_edit_lbutton_down[]
Definition: msg.c:13369
#define ID_EDIT
Definition: msg.c:13277
static const struct message sl_edit_setfocus[]
Definition: msg.c:13278
#define ES_MULTILINE
Definition: pedump.c:667
#define DLGC_WANTALLKEYS
Definition: winuser.h:2654
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1806
#define DLGC_HASSETSEL
Definition: winuser.h:2656

Referenced by START_TEST().

◆ test_EndDialog()

static void test_EndDialog ( void  )
static

Definition at line 16214 of file msg.c.

16215{
16216 HWND hparent, hother, hactive, hdlg, hchild;
16217 WNDCLASSA cls;
16218
16219 hparent = CreateWindowExA(0, "TestParentClass", "Test parent",
16221 100, 100, 200, 200, 0, 0, 0, NULL);
16222 ok (hparent != 0, "Failed to create parent window\n");
16223
16224 hother = CreateWindowExA(0, "TestParentClass", "Test parent 2",
16226 200, 100, 200, 200, 0, 0, 0, NULL);
16227 ok (hother != 0, "Failed to create parent window\n");
16228
16229 ok(GetClassInfoA(0, "#32770", &cls), "GetClassInfo failed\n");
16230 cls.lpszClassName = "MyDialogClass";
16233 register_class(&cls);
16234
16236 SetForegroundWindow(hother);
16237 hactive = GetForegroundWindow();
16238 ok(hother == hactive, "Wrong window has focus (%p != %p)\n", hother, hactive);
16239
16240 /* create a dialog where the parent is disabled, this parent should be
16241 * enabled and receive focus when dialog exits */
16242 hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", hparent, test_dlg_proc, 0);
16243 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16244 SetForegroundWindow(hdlg);
16245 hactive = GetForegroundWindow();
16246 ok(hdlg == hactive, "Wrong window has focus (%p != %p)\n", hdlg, hactive);
16247 EndDialog(hdlg, 0);
16248 ok(IsWindowEnabled(hparent), "parent is not enabled\n");
16249 hactive = GetForegroundWindow();
16250 ok(hparent == hactive, "Wrong window has focus (parent != active) (active: %p, parent: %p, dlg: %p, other: %p)\n", hactive, hparent, hdlg, hother);
16251 DestroyWindow(hdlg);
16253
16254 /* create a dialog where the parent is disabled and set active window to other window before calling EndDialog */
16255 EnableWindow(hparent, FALSE);
16256 hdlg = CreateWindowExA(0, "TestDialogClass", NULL,
16258 0, 0, 100, 100, hparent, 0, 0, NULL);
16259 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16261 SetForegroundWindow(hother);
16263 hactive = GetForegroundWindow();
16264 ok(hactive == hother, "Wrong foreground (%p != %p)\n", hactive, hother);
16265 hactive = GetActiveWindow();
16266 ok(hactive == hother, "Wrong active window (%p != %p)\n", hactive, hother);
16267 EndDialog(hdlg, 0);
16268 ok(IsWindowEnabled(hparent), "parent is not enabled\n");
16269 hactive = GetForegroundWindow();
16270 ok(hother == hactive, "Wrong window has focus (other != active) (active: %p, parent: %p, dlg: %p, other: %p)\n", hactive, hparent, hdlg, hother);
16271 DestroyWindow(hdlg);
16273
16274 DestroyWindow( hparent );
16275
16276 hparent = CreateWindowExA(0, "TestParentClass", "Test parent",
16278 100, 100, 200, 200, 0, 0, 0, NULL);
16279 ok (hparent != 0, "Failed to create parent window\n");
16280
16281 hchild = CreateWindowExA(0, "TestWindowClass", "Test child",
16283 0, 0, 0, 0, 0, 0, 0, NULL);
16284 ok (hchild != 0, "Failed to create child window\n");
16285
16286 SetParent(hchild, hparent);
16287
16289 SetForegroundWindow(hother);
16290 hactive = GetForegroundWindow();
16291 ok(hother == hactive, "Wrong foreground window (%p != %p)\n", hother, hactive);
16292
16293 hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", hchild, test_dlg_proc, 0);
16294 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16295
16296 SetForegroundWindow(hdlg);
16297 test_enddialog_seq(hdlg, hchild);
16298
16299 hactive = GetForegroundWindow();
16300 ok(hactive == hchild, "Wrong foreground window (active: %p, parent: %p, dlg: %p, other: %p child: %p)\n", hactive, hparent, hdlg, hother, hchild);
16301
16302 DestroyWindow(hdlg);
16303
16304 /* Now set WS_CHILD style flag so that it's a real child and its parent will be dialog's owner. */
16306
16307 SetForegroundWindow(hother);
16308 hactive = GetForegroundWindow();
16309 ok(hother == hactive, "Wrong foreground window (%p != %p)\n", hother, hactive);
16310
16311 hdlg = CreateDialogParamA(0, "CLASS_TEST_DIALOG_2", hchild, test_dlg_proc, 0);
16312 ok(IsWindow(hdlg), "CreateDialogParam failed\n");
16313
16314 SetForegroundWindow(hdlg);
16315 test_enddialog_seq2(hdlg, hparent);
16316
16317 hactive = GetForegroundWindow();
16318 ok(hactive == hparent, "Wrong foreground window (active: %p, parent: %p, dlg: %p, other: %p child: %p)\n", hactive, hparent, hdlg, hother, hchild);
16319 DestroyWindow(hdlg);
16320 DestroyWindow(hchild);
16321 DestroyWindow(hparent);
16322 DestroyWindow(hother);
16324
16326}
static void test_enddialog_seq(HWND dialog, HWND owner)
Definition: msg.c:16162
static void test_enddialog_seq2(HWND dialog, HWND owner)
Definition: msg.c:16190
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
BOOL WINAPI IsWindowEnabled(_In_ HWND)

Referenced by START_TEST().

◆ test_enddialog_seq()

static void test_enddialog_seq ( HWND  dialog,
HWND  owner 
)
static

Definition at line 16162 of file msg.c.

16163{
16164 const struct message seq[] = {
16165 { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
16166 { WM_ENABLE, sent },
16168 { HCBT_ACTIVATE, hook|wparam, (WPARAM)owner },
16171 { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
16172 /* FIXME: Following two are optional because Wine sends WM_QUERYNEWPALETTE instead of WM_WINDOWPOSCHANGING */
16178 { HCBT_SETFOCUS, hook|wparam, (WPARAM)owner },
16179 { WM_KILLFOCUS, sent|wparam, (WPARAM)owner },
16180 { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
16182 { 0 }
16183 };
16184
16186 EndDialog(dialog, 0);
16187 ok_sequence(seq, "EndDialog", FALSE);
16188}
static HWND dialog
Definition: gui.c:33
#define OBJID_CLIENT
Definition: winable.h:19
#define WM_QUERYNEWPALETTE
Definition: winuser.h:1906
#define HCBT_ACTIVATE
Definition: winuser.h:60
#define WA_INACTIVE
Definition: winuser.h:2664
#define WM_NCACTIVATE
Definition: winuser.h:1716
#define WA_ACTIVE
Definition: winuser.h:2665

Referenced by test_EndDialog().

◆ test_enddialog_seq2()

static void test_enddialog_seq2 ( HWND  dialog,
HWND  owner 
)
static

Definition at line 16190 of file msg.c.

16191{
16192 const struct message seq[] = {
16193 { EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
16194 { WM_ENABLE, parent|sent },
16196 { HCBT_ACTIVATE, hook|wparam, (WPARAM)owner },
16199 { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 },
16202 { HCBT_SETFOCUS, hook|wparam, (WPARAM)owner },
16203 { WM_KILLFOCUS, sent|wparam, (WPARAM)owner },
16204 { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
16206 { 0 }
16207 };
16208
16210 EndDialog(dialog, 0);
16211 ok_sequence(seq, "EndDialog2", FALSE);
16212}

Referenced by test_EndDialog().

◆ test_hook_changing_window_proc()

static void test_hook_changing_window_proc ( void  )
static

Definition at line 20683 of file msg.c.

20684{
20685 HWND hwnd;
20686 HHOOK hook;
20687 LRESULT res;
20688
20689 hwnd = CreateWindowExW( 0, L"static", NULL, WS_POPUP, 0,0,0,0,GetDesktopWindow(),0,0, NULL );
20691 ok( hook != NULL, "SetWindowsHookExW failed: %lu\n", GetLastError() );
20692
20693 res = SendMessageW( hwnd, WM_USER, 1, 2 );
20694 ok( res == 3, "SendMessageW(WM_USER) returned %Iu\n", res );
20695
20698}
static LRESULT WINAPI call_window_proc_hook(INT code, WPARAM wparam, LPARAM lparam)
Definition: msg.c:20674
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WH_CALLWNDPROC
Definition: winuser.h:34

Referenced by START_TEST().

◆ test_hook_cleanup()

static void test_hook_cleanup ( void  )
static

Definition at line 20848 of file msg.c.

20849{
20851 HANDLE thread;
20852
20853 d.main_thread_id = GetCurrentThreadId();
20854 d.hwnd = CreateWindowA ("static", "window", WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0 );
20855 d.hook_installed_event = CreateEventW( NULL, FALSE, FALSE, NULL );
20856 d.done_event = CreateEventW( NULL, FALSE, FALSE, NULL );
20857
20859 WaitForSingleObject( d.hook_installed_event, INFINITE );
20860
20862 NotifyWinEvent( EVENT_MIN, d.hwnd, 1, 2 );
20868
20869 SetEvent( d.done_event );
20871
20872 /* Hook is removed when thread which created it is terminated. */
20874 NotifyWinEvent( EVENT_MIN, d.hwnd, 1, 3 );
20876
20877 DestroyWindow( d.hwnd );
20878}
#define d
Definition: ke_i.h:81
static DWORD WINAPI test_hook_cleanup_thread_proc(void *context)
Definition: msg.c:20826
static DWORD test_hook_cleanup_hook_proc_call_thread_id
Definition: msg.c:20808
static DWORD test_hook_cleanup_hook_proc_thread_id
Definition: msg.c:20808
static LONG test_hook_cleanup_hook_proc_child_id
Definition: msg.c:20807
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587

Referenced by START_TEST().

◆ test_hook_cleanup_hook_proc()

static void CALLBACK test_hook_cleanup_hook_proc ( HWINEVENTHOOK  hook,
DWORD  event_id,
HWND  hwnd,
LONG  obj_id,
LONG  child_id,
DWORD  thread_id,
DWORD  event_time 
)
static

Definition at line 20810 of file msg.c.

Referenced by test_hook_cleanup_thread_proc().

◆ test_hook_cleanup_thread_proc()

static DWORD WINAPI test_hook_cleanup_thread_proc ( void context)
static

Definition at line 20826 of file msg.c.

20827{
20830
20833 ok( !!hook, "got error %ld.\n", GetLastError() );
20834
20836 NotifyWinEvent( EVENT_MIN, d->hwnd, 1, 1 );
20838 todo_wine ok( test_hook_cleanup_hook_proc_thread_id == d->main_thread_id, "got %#lx.\n",
20842
20843 SetEvent( d->hook_installed_event );
20844 WaitForSingleObject( d->done_event, INFINITE );
20845 return 0;
20846}
static HWINEVENTHOOK(WINAPI *pSetWinEventHook)(DWORD
static void CALLBACK test_hook_cleanup_hook_proc(HWINEVENTHOOK hook, DWORD event_id, HWND hwnd, LONG obj_id, LONG child_id, DWORD thread_id, DWORD event_time)
Definition: msg.c:20810

Referenced by test_hook_cleanup().

◆ test_hotkey()

static void test_hotkey ( void  )
static

Definition at line 19278 of file msg.c.

19279{
19280 HWND test_window, taskbar_window;
19281 BOOL ret;
19282 MSG msg;
19283 DWORD queue_status;
19285
19286 SetLastError(0xdeadbeef);
19288 if (ret == TRUE)
19289 {
19290 skip("hotkeys not supported\n");
19291 return;
19292 }
19293
19294 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19296 "unexpected error %ld\n", GetLastError());
19297
19298 test_window = CreateWindowExA(0, "HotkeyWindowClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
19300 0, 0, 0, NULL);
19301
19303 flush_events();
19305
19306 SetLastError(0xdeadbeef);
19308 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19310 "unexpected error %ld\n", GetLastError());
19311
19312 /* Search for a Windows Key + letter combination that hasn't been registered */
19313 for (hotkey_letter = 'A'; hotkey_letter <= 'Z'; hotkey_letter ++)
19314 {
19315 SetLastError(0xdeadbeef);
19317
19318 if (ret == TRUE)
19319 {
19320 break;
19321 }
19322 else
19323 {
19325 "unexpected error %ld\n", GetLastError());
19326 }
19327 }
19328
19329 if (hotkey_letter > 'Z')
19330 {
19331 ok(0, "Couldn't find any free Windows Key + letter combination\n");
19332 goto end;
19333 }
19334
19336 if (!hKBD_hook) win_skip("WH_KEYBOARD_LL is not supported\n");
19337
19338 /* Same key combination, different id */
19339 SetLastError(0xdeadbeef);
19341 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19343 "unexpected error %ld\n", GetLastError());
19344
19345 /* Same key combination, different window */
19346 SetLastError(0xdeadbeef);
19348 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19350 "unexpected error %ld\n", GetLastError());
19351
19352 /* Register the same hotkey twice */
19353 SetLastError(0xdeadbeef);
19355 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19357 "unexpected error %ld\n", GetLastError());
19358
19359 /* Window on another thread */
19360 taskbar_window = FindWindowA("Shell_TrayWnd", NULL);
19361 if (!taskbar_window)
19362 {
19363 skip("no taskbar?\n");
19364 }
19365 else
19366 {
19367 SetLastError(0xdeadbeef);
19368 ret = RegisterHotKey(taskbar_window, 5, 0, hotkey_letter);
19369 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19371 "unexpected error %ld\n", GetLastError());
19372 }
19373
19374 /* Inject the appropriate key sequence */
19375 keybd_event(VK_LWIN, 0, 0, 0);
19376 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19378 ok_sequence(WmHotkeyPressLWIN, "window hotkey press LWIN", FALSE);
19379
19380 keybd_event(hotkey_letter, 0, 0, 0);
19381 queue_status = GetQueueStatus(QS_HOTKEY);
19382 ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %lx\n", queue_status);
19383 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19384 {
19385 if (msg.message == WM_HOTKEY)
19386 {
19387 ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
19388 ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %Ix\n", msg.lParam);
19389 }
19391 }
19392 ok_sequence(WmHotkeyPress, "window hotkey press", FALSE);
19393
19394 queue_status = GetQueueStatus(QS_HOTKEY);
19395 ok((queue_status & (QS_HOTKEY << 16)) == 0, "expected QS_HOTKEY << 16 cleared, got %lx\n", queue_status);
19396
19398 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19399
19401 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19403 ok_sequence(WmHotkeyRelease, "window hotkey release", TRUE);
19404
19406 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19408 ok_sequence(WmHotkeyReleaseLWIN, "window hotkey release LWIN", FALSE);
19409
19410 /* normal posted WM_HOTKEY messages set QS_HOTKEY */
19412 queue_status = GetQueueStatus(QS_HOTKEY);
19413 ok((queue_status & (QS_HOTKEY << 16)) == QS_HOTKEY << 16, "expected QS_HOTKEY << 16 set, got %lx\n", queue_status);
19414 queue_status = GetQueueStatus(QS_POSTMESSAGE);
19415 ok((queue_status & (QS_POSTMESSAGE << 16)) == QS_POSTMESSAGE << 16, "expected QS_POSTMESSAGE << 16 set, got %lx\n", queue_status);
19416 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19419
19420 /* Send and process all messages at once */
19422 keybd_event(VK_LWIN, 0, 0, 0);
19423 keybd_event(hotkey_letter, 0, 0, 0);
19426
19427 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19428 {
19429 if (msg.message == WM_HOTKEY)
19430 {
19431 ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
19432 ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %Ix\n", msg.lParam);
19433 }
19435 }
19436 ok_sequence(WmHotkeyCombined, "window hotkey combined", FALSE);
19437
19438 /* Register same hwnd/id with different key combination */
19440 ok(ret == TRUE, "expected TRUE, got %i, err=%ld\n", ret, GetLastError());
19441
19442 /* Previous key combination does not work */
19443 keybd_event(VK_LWIN, 0, 0, 0);
19444 keybd_event(hotkey_letter, 0, 0, 0);
19447
19448 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19450 ok_sequence(WmHotkeyPrevious, "window hotkey previous", FALSE);
19451
19452 /* New key combination works */
19453 keybd_event(hotkey_letter, 0, 0, 0);
19455
19456 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19457 {
19458 if (msg.message == WM_HOTKEY)
19459 {
19460 ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
19461 ok(msg.lParam == MAKELPARAM(0, hotkey_letter), "unexpected WM_HOTKEY lparam %Ix\n", msg.lParam);
19462 }
19464 }
19465 ok_sequence(WmHotkeyNew, "window hotkey new", FALSE);
19466
19467 /* Unregister hotkey properly */
19469 ok(ret == TRUE, "expected TRUE, got %i, err=%ld\n", ret, GetLastError());
19470
19471 /* Unregister hotkey again */
19472 SetLastError(0xdeadbeef);
19474 ok(ret == FALSE, "expected FALSE, got %i\n", ret);
19476 "unexpected error %ld\n", GetLastError());
19477
19478 /* Register thread hotkey */
19480 ok(ret == TRUE, "expected TRUE, got %i, err=%ld\n", ret, GetLastError());
19481
19482 /* Inject the appropriate key sequence */
19483 keybd_event(VK_LWIN, 0, 0, 0);
19484 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19485 {
19486 ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
19488 }
19489 ok_sequence(WmHotkeyPressLWIN, "thread hotkey press LWIN", FALSE);
19490
19491 keybd_event(hotkey_letter, 0, 0, 0);
19492 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19493 {
19494 if (msg.message == WM_HOTKEY)
19495 {
19496 struct recvd_message message;
19497 ok(msg.hwnd == NULL, "unexpected hwnd %p\n", msg.hwnd);
19498 ok(msg.lParam == MAKELPARAM(MOD_WIN, hotkey_letter), "unexpected WM_HOTKEY lparam %Ix\n", msg.lParam);
19499 message.message = msg.message;
19501 message.wParam = msg.wParam;
19502 message.lParam = msg.lParam;
19503 message.descr = "test_hotkey thread message";
19505 }
19506 else
19507 ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
19509 }
19510 ok_sequence(WmHotkeyPress, "thread hotkey press", FALSE);
19511
19513 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19514 {
19515 ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
19517 }
19518 ok_sequence(WmHotkeyRelease, "thread hotkey release", TRUE);
19519
19521 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19522 {
19523 ok(msg.hwnd != NULL, "unexpected thread message %x\n", msg.message);
19525 }
19526 ok_sequence(WmHotkeyReleaseLWIN, "thread hotkey release LWIN", FALSE);
19527
19528 /* Search for an ALT + letter combination that hasn't been registered */
19529 for (hotkey_letter = 'A'; hotkey_letter <= 'Z'; hotkey_letter ++)
19530 {
19531 SetLastError(0xdeadbeef);
19533
19534 if (ret == TRUE)
19535 {
19536 break;
19537 }
19538 else
19539 {
19541 "unexpected error %ld\n", GetLastError());
19542 }
19543 }
19544
19545 if (hotkey_letter > 'Z')
19546 {
19547 ok(0, "Couldn't find any free ALT + letter combination\n");
19548 goto end;
19549 }
19550
19551 keybd_event(VK_LMENU, 0, 0, 0);
19552 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19554 ok_sequence(WmHotkeyPressALT, "window hotkey press ALT", TRUE);
19555
19556 keybd_event(hotkey_letter, 0, 0, 0);
19557 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19558 {
19559 if (msg.message == WM_HOTKEY)
19560 {
19561 ok(msg.hwnd == test_window, "unexpected hwnd %p\n", msg.hwnd);
19562 ok(msg.lParam == MAKELPARAM(MOD_ALT, hotkey_letter), "unexpected WM_HOTKEY lparam %Ix\n", msg.lParam);
19563 }
19565 }
19566 ok_sequence(WmHotkeyPressWithALT, "window hotkey press with ALT", FALSE);
19567
19569 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19571 ok_sequence(WmHotkeyReleaseWithALT, "window hotkey release with ALT", TRUE);
19572
19574 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE))
19576 ok_sequence(WmHotkeyReleaseALT, "window hotkey release ALT", FALSE);
19577
19578 /* Unregister thread hotkey */
19580 ok(ret == TRUE, "expected TRUE, got %i, err=%ld\n", ret, GetLastError());
19581
19583 hKBD_hook = NULL;
19584
19585end:
19591}
key_state
Definition: listview.c:430
static void test_window(IHTMLDocument2 *doc)
Definition: dom.c:6306
#define MOD_ALT
Definition: imm.h:184
static const struct message WmHotkeyPressLWIN[]
Definition: msg.c:19161
static const struct message WmHotkeyPressALT[]
Definition: msg.c:19223
static const struct message WmHotkeyReleaseLWIN[]
Definition: msg.c:19178
static const struct message WmHotkeyReleaseWithALT[]
Definition: msg.c:19234
static const struct message WmHotkeyPress[]
Definition: msg.c:19167
static const struct message WmHotkeyPrevious[]
Definition: msg.c:19200
static const struct message WmHotkeyNew[]
Definition: msg.c:19215
static const struct message WmHotkeyPressWithALT[]
Definition: msg.c:19229
static LRESULT CALLBACK KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam)
Definition: msg.c:19249
static const struct message WmHotkeyReleaseALT[]
Definition: msg.c:19240
static const struct message WmHotkeyCombined[]
Definition: msg.c:19184
static const struct message WmHotkeyRelease[]
Definition: msg.c:19172
UINT message
Definition: SystemMenu.c:42
msg_flags_t flags
Definition: SystemMenu.c:43
#define ERROR_HOTKEY_NOT_REGISTERED
Definition: winerror.h:1245
#define ERROR_WINDOW_OF_OTHER_THREAD
Definition: winerror.h:1234
#define ERROR_HOTKEY_ALREADY_REGISTERED
Definition: winerror.h:1235
#define SM_CYSCREEN
Definition: winuser.h:971
#define MOD_WIN
Definition: winuser.h:2686
BOOL WINAPI UnregisterHotKey(_In_opt_ HWND, _In_ int)
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define WH_KEYBOARD_LL
Definition: winuser.h:43
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define SM_CXSCREEN
Definition: winuser.h:970
HWND WINAPI FindWindowA(_In_opt_ LPCSTR, _In_opt_ LPCSTR)

Referenced by START_TEST().

◆ test_hv_scroll_1()

static void test_hv_scroll_1 ( HWND  hwnd,
INT  ctl,
DWORD  clear,
DWORD  set,
INT  min,
INT  max 
)
static

Definition at line 4853 of file msg.c.

4854{
4855 DWORD style, exstyle;
4856 INT xmin, xmax;
4857 BOOL ret;
4858
4859 exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4861 /* do not be confused by WS_DLGFRAME set */
4862 if ((style & WS_CAPTION) == WS_CAPTION) style &= ~WS_CAPTION;
4863
4864 if (clear) ok(style & clear, "style %08lx should be set\n", clear);
4865 if (set) ok(!(style & set), "style %08lx should not be set\n", set);
4866
4867 ret = SetScrollRange(hwnd, ctl, min, max, FALSE);
4868 ok( ret, "SetScrollRange(%d) error %ld\n", ctl, GetLastError());
4869 if ((style & (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME)) || (exstyle & WS_EX_DLGMODALFRAME))
4870 ok_sequence(WmSetScrollRangeHV_NC_Seq, "SetScrollRange(SB_HORZ/SB_VERT) NC", FALSE);
4871 else
4872 ok_sequence(WmSetScrollRangeHVSeq, "SetScrollRange(SB_HORZ/SB_VERT)", FALSE);
4873
4875 if (set) ok(style & set, "style %08lx should be set\n", set);
4876 if (clear) ok(!(style & clear), "style %08lx should not be set\n", clear);
4877
4878 /* a subsequent call should do nothing */
4879 ret = SetScrollRange(hwnd, ctl, min, max, FALSE);
4880 ok( ret, "SetScrollRange(%d) error %ld\n", ctl, GetLastError());
4881 ok_sequence(WmEmptySeq, "SetScrollRange(SB_HORZ/SB_VERT) empty sequence", FALSE);
4882
4883 xmin = 0xdeadbeef;
4884 xmax = 0xdeadbeef;
4885 ret = GetScrollRange(hwnd, ctl, &xmin, &xmax);
4886 ok( ret, "GetScrollRange(%d) error %ld\n", ctl, GetLastError());
4887 ok_sequence(WmEmptySeq, "GetScrollRange(SB_HORZ/SB_VERT) empty sequence", FALSE);
4888 ok(xmin == min, "unexpected min scroll value %d\n", xmin);
4889 ok(xmax == max, "unexpected max scroll value %d\n", xmax);
4890}
Definition: _set.h:50
static const struct message WmSetScrollRangeHVSeq[]
Definition: msg.c:2075
static const struct message WmSetScrollRangeHV_NC_Seq[]
Definition: msg.c:2087
#define min(a, b)
Definition: monoChain.cc:55
#define WS_THICKFRAME
Definition: pedump.c:630
BOOL WINAPI GetScrollRange(_In_ HWND, _In_ int, _Out_ LPINT, _Out_ LPINT)
BOOL WINAPI SetScrollRange(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by test_scroll_messages().

◆ test_hv_scroll_2()

static void test_hv_scroll_2 ( HWND  hwnd,
INT  ctl,
DWORD  clear,
DWORD  set,
INT  min,
INT  max 
)
static

Definition at line 4892 of file msg.c.

4893{
4894 DWORD style, exstyle;
4895 SCROLLINFO si;
4896 BOOL ret;
4897
4898 exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4900 /* do not be confused by WS_DLGFRAME set */
4901 if ((style & WS_CAPTION) == WS_CAPTION) style &= ~WS_CAPTION;
4902
4903 if (clear) ok(style & clear, "style %08lx should be set\n", clear);
4904 if (set) ok(!(style & set), "style %08lx should not be set\n", set);
4905
4906 si.cbSize = sizeof(si);
4907 si.fMask = SIF_RANGE;
4908 si.nMin = min;
4909 si.nMax = max;
4910 SetScrollInfo(hwnd, ctl, &si, TRUE);
4911 if ((style & (WS_DLGFRAME | WS_BORDER | WS_THICKFRAME)) || (exstyle & WS_EX_DLGMODALFRAME))
4912 ok_sequence(WmSetScrollRangeHV_NC_Seq, "SetScrollInfo(SB_HORZ/SB_VERT) NC", FALSE);
4913 else
4914 ok_sequence(WmSetScrollRangeHVSeq, "SetScrollInfo(SB_HORZ/SB_VERT)", FALSE);
4915
4917 if (set) ok(style & set, "style %08lx should be set\n", set);
4918 if (clear) ok(!(style & clear), "style %08lx should not be set\n", clear);
4919
4920 /* a subsequent call should do nothing */
4921 SetScrollInfo(hwnd, ctl, &si, TRUE);
4922 if (style & WS_HSCROLL)
4923 ok_sequence(WmSetScrollRangeHSeq_empty, "SetScrollInfo(SB_HORZ/SB_VERT) empty sequence", FALSE);
4924 else if (style & WS_VSCROLL)
4925 ok_sequence(WmSetScrollRangeVSeq_empty, "SetScrollInfo(SB_HORZ/SB_VERT) empty sequence", FALSE);
4926 else
4927 ok_sequence(WmEmptySeq, "SetScrollInfo(SB_HORZ/SB_VERT) empty sequence", FALSE);
4928
4929 si.fMask = SIF_PAGE;
4930 si.nPage = 5;
4931 SetScrollInfo(hwnd, ctl, &si, FALSE);
4932 ok_sequence(WmEmptySeq, "SetScrollInfo(SB_HORZ/SB_VERT) empty sequence", FALSE);
4933
4934 si.fMask = SIF_POS;
4935 si.nPos = max - 1;
4936 SetScrollInfo(hwnd, ctl, &si, FALSE);
4937 ok_sequence(WmEmptySeq, "SetScrollInfo(SB_HORZ/SB_VERT) empty sequence", FALSE);
4938
4939 si.fMask = SIF_RANGE;
4940 si.nMin = 0xdeadbeef;
4941 si.nMax = 0xdeadbeef;
4942 ret = GetScrollInfo(hwnd, ctl, &si);
4943 ok( ret, "GetScrollInfo error %ld\n", GetLastError());
4944 ok_sequence(WmEmptySeq, "GetScrollRange(SB_HORZ/SB_VERT) empty sequence", FALSE);
4945 ok(si.nMin == min, "unexpected min scroll value %d\n", si.nMin);
4946 ok(si.nMax == max, "unexpected max scroll value %d\n", si.nMax);
4947}
static SYSTEM_INFO si
Definition: virtual.c:39
static const struct message WmSetScrollRangeVSeq_empty[]
Definition: msg.c:2070
static const struct message WmSetScrollRangeHSeq_empty[]
Definition: msg.c:2065
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_HSCROLL
Definition: pedump.c:628
#define SIF_RANGE
Definition: winuser.h:1246
#define SIF_PAGE
Definition: winuser.h:1244
#define SIF_POS
Definition: winuser.h:1245
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)

Referenced by test_scroll_messages().

◆ test_hvredraw()

static void test_hvredraw ( void  )
static

Definition at line 9808 of file msg.c.

9809{
9810 HWND htoplevel;
9811
9815
9816 htoplevel = CreateWindowExA( 0, "SimpleWindowClass", "Test toplevel",
9818 100, 100, 400, 400, 0, 0, 0, NULL );
9819 ok( htoplevel != 0, "Failed to create top-level window: %lu\n", GetLastError() );
9820
9824
9825 DestroyWindow( htoplevel );
9826}
static void subtest_hvredraw(HWND hparent, UINT class_style, DWORD style)
Definition: msg.c:9703

Referenced by START_TEST().

◆ test_InSendMessage()

static void test_InSendMessage ( void  )
static

Definition at line 20408 of file msg.c.

20409{
20410 WNDCLASSA cls;
20411 HWND win;
20412 MSG msg;
20413 HANDLE thread;
20414 DWORD tid;
20415
20416 memset(&cls, 0, sizeof(cls));
20419 cls.lpszClassName = "InSendMessage_test";
20420 register_class(&cls);
20421
20422 win = CreateWindowA( "InSendMessage_test", NULL, 0, 0, 0, 0, 0, NULL, 0, NULL, 0 );
20423 ok( win != NULL, "CreateWindow failed: %ld\n", GetLastError() );
20424
20426 ok( thread != NULL, "CreateThread failed: %ld\n", GetLastError() );
20427
20428 while (GetMessageA(&msg, NULL, 0, 0)) DispatchMessageA( &msg );
20429
20430 ok( WaitForSingleObject( thread, 30000 ) == WAIT_OBJECT_0, "WaitForSingleObject failed\n" );
20432
20433 DestroyWindow( win );
20434 UnregisterClassA( "InSendMessage_test", GetModuleHandleA(NULL) );
20435}
static DWORD WINAPI send_message_thread(void *arg)
Definition: msg.c:20396
static LRESULT CALLBACK insendmessage_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: msg.c:20344

Referenced by START_TEST().

◆ test_interthread_messages()

static void test_interthread_messages ( void  )
static

Definition at line 10111 of file msg.c.

10112{
10115 DWORD tid;
10116 WNDPROC proc;
10117 MSG msg;
10118 char buf[256];
10119 int len, expected_len;
10120 struct wnd_event wnd_event;
10121 BOOL ret;
10122
10125 {
10126 win_skip("skipping interthread message test under win9x\n");
10127 return;
10128 }
10129
10131 ok(hThread != NULL, "CreateThread failed, error %ld\n", GetLastError());
10132
10133 ok(WaitForSingleObject(wnd_event.start_event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
10134
10136
10137 SetLastError(0xdeadbeef);
10138 ok(!DestroyWindow(wnd_event.hwnd), "DestroyWindow succeeded\n");
10139 ok(GetLastError() == ERROR_ACCESS_DENIED || GetLastError() == 0xdeadbeef,
10140 "wrong error code %ld\n", GetLastError());
10141
10143 ok(proc != NULL, "GetWindowLongPtrA(GWLP_WNDPROC) error %ld\n", GetLastError());
10144
10145 expected_len = lstrlenA("window caption text");
10146 memset(buf, 0, sizeof(buf));
10147 SetLastError(0xdeadbeef);
10149 ok(len == expected_len, "CallWindowProcA(WM_GETTEXT) error %ld, len %d, expected len %d\n", GetLastError(), len, expected_len);
10150 ok(!lstrcmpA(buf, "window caption text"), "window text mismatch\n");
10151
10152 msg.hwnd = wnd_event.hwnd;
10153 msg.message = WM_GETTEXT;
10154 msg.wParam = sizeof(buf);
10155 msg.lParam = (LPARAM)buf;
10156 memset(buf, 0, sizeof(buf));
10157 SetLastError(0xdeadbeef);
10159 ok((!len && GetLastError() == ERROR_MESSAGE_SYNC_ONLY) || broken(len), /* nt4 */
10160 "DispatchMessageA(WM_GETTEXT) succeeded on another thread window: ret %d, error %ld\n", len, GetLastError());
10161
10162 /* the following test causes an exception in user.exe under win9x */
10163 msg.hwnd = wnd_event.hwnd;
10164 msg.message = WM_TIMER;
10165 msg.wParam = 0;
10167 SetLastError(0xdeadbeef);
10169 ok(!len && GetLastError() == 0xdeadbeef,
10170 "DispatchMessageA(WM_TIMER) failed on another thread window: ret %d, error %ld\n", len, GetLastError());
10171
10173 ok( ret, "PostMessageA(WM_QUIT) error %ld\n", GetLastError());
10174
10175 ok(WaitForSingleObject(hThread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
10177
10178 ok(!IsWindow(wnd_event.hwnd), "window should be destroyed on thread exit\n");
10179
10180 wnd_event.hwnd = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
10181 100, 100, 200, 200, 0, 0, 0, NULL);
10182 ok (wnd_event.hwnd != 0, "Failed to create parent window\n");
10183 flush_events();
10189 for (;;)
10190 {
10192 if (ret != 1) break;
10193 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
10194 }
10195 ok( !ret, "MsgWaitForMultipleObjects failed %x\n", ret );
10196 /* now wait for the thread without processing messages; this shouldn't deadlock */
10198 ret = WaitForSingleObject( hThread, 5000 );
10199 ok( !ret, "WaitForSingleObject failed %x\n", ret );
10201
10203 ok( !ret, "WaitForSingleObject failed %x\n", ret );
10205
10208 flush_events();
10209 ok_sequence(WmExitThreadSeq, "destroy child on thread exit", FALSE);
10212
10213 /* Activation context tests */
10214 create_manifest_file("testdep1.manifest", manifest_dep);
10215 create_manifest_file("main.manifest", manifest_main);
10216
10217 context = test_create("main.manifest");
10218 DeleteFileA("testdep1.manifest");
10219 DeleteFileA("main.manifest");
10220
10221 handle = (void*)0xdeadbeef;
10223 ok(ret, "GetCurrentActCtx failed: %lu\n", GetLastError());
10224 ok(handle == 0, "active context %p\n", handle);
10225
10228 ok(hThread != NULL, "CreateThread failed, error %ld\n", GetLastError());
10229 ok(WaitForSingleObject(wnd_event.start_event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
10231
10232 /* context is activated after thread creation, so it doesn't inherit it by default */
10234 ok(ret, "activation failed: %lu\n", GetLastError());
10235
10236 handle = 0;
10238 ok(ret, "GetCurrentActCtx failed: %lu\n", GetLastError());
10239 ok(handle != 0, "active context %p\n", handle);
10241
10242 /* destination window will test for active context */
10243 ret = SendMessageA(wnd_event.hwnd, WM_USER+10, 0, 0);
10244 ok(ret, "thread window returned %d\n", ret);
10245
10246 event = CreateEventW(NULL, 0, 0, NULL);
10248 ok(ret, "thread window returned %d\n", ret);
10249 ok(WaitForSingleObject(event, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
10251
10253 ok(ret, "PostMessageA(WM_QUIT) error %ld\n", GetLastError());
10254
10255 ok(WaitForSingleObject(hThread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
10257
10259 ok(ret, "DeactivateActCtx failed: %lu\n", GetLastError());
10261}
VOID WINAPI ReleaseActCtx(IN HANDLE hActCtx)
Definition: actctx.c:208
BOOL WINAPI DeactivateActCtx(IN DWORD dwFlags, IN ULONG_PTR ulCookie)
Definition: actctx.c:268
BOOL WINAPI ActivateActCtx(IN HANDLE hActCtx, OUT PULONG_PTR ulCookie)
Definition: actctx.c:237
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4104
GLenum GLsizei len
Definition: glext.h:6722
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static void test_create(void)
Definition: monthcal.c:1595
static const char manifest_dep[]
Definition: msg.c:10055
static DWORD WINAPI thread_proc(void *param)
Definition: msg.c:9985
static void create_manifest_file(const char *filename, const char *manifest)
Definition: msg.c:10071
static DWORD CALLBACK create_child_thread(void *param)
Definition: msg.c:10029
static const struct message WmExitThreadSeq[]
Definition: msg.c:1662
static const char manifest_main[]
Definition: msg.c:10061
HANDLE hThread
Definition: wizard.c:28
static HANDLE proc()
Definition: pdb.c:32
Definition: cookie.c:34
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:1005

Referenced by START_TEST().

◆ test_invalid_window()

static void test_invalid_window ( void  )
static

Definition at line 20575 of file msg.c.

20576{
20577 MSG msg;
20578 BOOL ret;
20579
20580 SetLastError(0xdeadbeef);
20581 ret = GetMessageA(&msg, (HWND)0xdeadbeef, 0, 0);
20582 ok(ret == -1, "wrong ret %d\n", ret);
20583 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %lu\n", GetLastError());
20584
20585 SetLastError(0xdeadbeef);
20586 ret = PeekMessageA(&msg, (HWND)0xdeadbeef, 0, 0, PM_REMOVE);
20587 ok(!ret, "wrong ret %d\n", ret);
20588 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error %lu\n", GetLastError());
20589}
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:1226

Referenced by START_TEST().

◆ test_keyflags()

static void test_keyflags ( void  )
static

Definition at line 19055 of file msg.c.

19056{
19059 BYTE keyboard_state[256];
19060 MSG msg;
19061
19064 0, 0, 0, NULL);
19065
19066 flush_events();
19068
19069 /* keyup without a keydown */
19070 keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
19073 ok_sequence(WmKeyReleaseOnly, "key release only", TRUE);
19074
19076 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19077
19078 key_state = GetKeyState(0x41);
19079 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19080
19081 /* keydown */
19082 keybd_event(0x41, 0, 0, 0);
19085 ok_sequence(WmKeyPressNormal, "key press only", FALSE);
19086
19088 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19089
19090 key_state = GetKeyState(0x41);
19091 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19092
19093 /* keydown repeat */
19094 keybd_event(0x41, 0, 0, 0);
19097 ok_sequence(WmKeyPressRepeat, "key press repeat", FALSE);
19098
19100 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19101
19102 key_state = GetKeyState(0x41);
19103 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19104
19105 /* keyup */
19106 keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
19109 ok_sequence(WmKeyReleaseNormal, "key release repeat", FALSE);
19110
19112 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19113
19114 key_state = GetKeyState(0x41);
19115 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19116
19117 /* set the key state in this thread */
19118 GetKeyboardState(keyboard_state);
19119 keyboard_state[0x41] = 0x80;
19120 SetKeyboardState(keyboard_state);
19121
19123 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19124
19125 /* keydown */
19126 keybd_event(0x41, 0, 0, 0);
19129 ok_sequence(WmKeyPressRepeat, "key press after setkeyboardstate", TRUE);
19130
19132 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19133
19134 key_state = GetKeyState(0x41);
19135 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19136
19137 /* clear the key state in this thread */
19138 GetKeyboardState(keyboard_state);
19139 keyboard_state[0x41] = 0;
19140 SetKeyboardState(keyboard_state);
19141
19143 ok((key_state & 0x8000) == 0x8000, "unexpected key state %x\n", key_state);
19144
19145 /* keyup */
19146 keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
19149 ok_sequence(WmKeyReleaseOnly, "key release after setkeyboardstate", TRUE);
19150
19152 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19153
19154 key_state = GetKeyState(0x41);
19155 ok((key_state & 0x8000) == 0, "unexpected key state %x\n", key_state);
19156
19159}
static const struct message WmKeyPressRepeat[]
Definition: msg.c:19044
static const struct message WmKeyPressNormal[]
Definition: msg.c:19039
static const struct message WmKeyReleaseOnly[]
Definition: msg.c:19034
static const struct message WmKeyReleaseNormal[]
Definition: msg.c:19049
BOOL WINAPI SetKeyboardState(_In_reads_(256) LPBYTE)
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)

Referenced by START_TEST().

◆ test_layered_window()

static void test_layered_window ( void  )
static

Definition at line 19868 of file msg.c.

19869{
19870 HWND hwnd;
19871 HDC hdc;
19872 HBITMAP bmp;
19873 BOOL ret;
19874 SIZE size;
19875 POINT pos, src;
19876 RECT rect, client;
19877 HANDLE thread;
19878 DWORD tid;
19880
19881 if (!pUpdateLayeredWindow)
19882 {
19883 win_skip( "UpdateLayeredWindow not supported\n" );
19884 return;
19885 }
19886
19887 hdc = CreateCompatibleDC( 0 );
19888 bmp = CreateCompatibleBitmap( hdc, 300, 300 );
19889 SelectObject( hdc, bmp );
19890
19891 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_CAPTION | WS_THICKFRAME | WS_SYSMENU,
19892 100, 100, 300, 300, 0, 0, 0, NULL);
19893 ok( hwnd != 0, "failed to create window\n" );
19895 UpdateWindow( hwnd );
19896 flush_events();
19898
19899 GetWindowRect( hwnd, &rect );
19901 ok( client.right < rect.right - rect.left, "wrong client area\n" );
19902 ok( client.bottom < rect.bottom - rect.top, "wrong client area\n" );
19903
19904 src.x = src.y = 0;
19905 pos.x = pos.y = 300;
19906 size.cx = size.cy = 250;
19907 ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
19908 ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
19909 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
19911 ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE );
19912
19913 ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
19914 ok( ret, "UpdateLayeredWindow failed err %lu\n", GetLastError() );
19915 ok_sequence( WmLayeredWinEmptySeq, "UpdateLayeredWindow", FALSE );
19916 GetWindowRect( hwnd, &rect );
19917 ok( rect.left == 300 && rect.top == 300 && rect.right == 550 && rect.bottom == 550,
19918 "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
19919 GetClientRect( hwnd, &rect );
19920 ok( rect.right == client.right - 50 && rect.bottom == client.bottom - 50,
19921 "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
19922
19923 size.cx = 150;
19924 pos.y = 200;
19925 ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
19926 ok( ret, "UpdateLayeredWindow failed err %lu\n", GetLastError() );
19927 ok_sequence( WmLayeredWinEmptySeq, "UpdateLayeredWindow", FALSE );
19928 GetWindowRect( hwnd, &rect );
19929 ok( rect.left == 300 && rect.top == 200 && rect.right == 450 && rect.bottom == 450,
19930 "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
19931 GetClientRect( hwnd, &rect );
19932 ok( rect.right == client.right - 150 && rect.bottom == client.bottom - 50,
19933 "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
19934
19937 ok_sequence( WmSetLayeredStyle2, "WmSetLayeredStyle2", FALSE );
19938
19939 size.cx = 200;
19940 pos.x = 200;
19941 ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
19942 ok( ret, "UpdateLayeredWindow failed err %lu\n", GetLastError() );
19943 ok_sequence( WmLayeredWinEmptySeq, "UpdateLayeredWindow", FALSE );
19944 GetWindowRect( hwnd, &rect );
19945 ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450,
19946 "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
19947 GetClientRect( hwnd, &rect );
19948 ok( (rect.right == 200 && rect.bottom == 250) ||
19949 broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50),
19950 "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
19951
19952 size.cx = 0;
19953 ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
19954 ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
19956 broken(GetLastError() == ERROR_GEN_FAILURE) /* win7 */, "wrong error %lu\n", GetLastError() );
19957 size.cx = 1;
19958 size.cy = -1;
19959 ret = pUpdateLayeredWindow( hwnd, 0, &pos, &size, hdc, &src, 0, NULL, ULW_OPAQUE );
19960 ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" );
19961 ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %lu\n", GetLastError() );
19962
19964 ok_sequence( WmSetLayeredStyle, "WmSetLayeredStyle", FALSE );
19965 GetWindowRect( hwnd, &rect );
19966 ok( rect.left == 200 && rect.top == 200 && rect.right == 400 && rect.bottom == 450,
19967 "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
19968 GetClientRect( hwnd, &rect );
19969 ok( (rect.right == 200 && rect.bottom == 250) ||
19970 broken(rect.right == client.right - 100 && rect.bottom == client.bottom - 50),
19971 "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
19972
19974 info.hwnd = hwnd;
19975 info.hdc = hdc;
19976 info.size.cx = 250;
19977 info.size.cy = 300;
19978 info.event = CreateEventA( NULL, TRUE, FALSE, NULL );
19979 info.ret = FALSE;
19981 ok( WaitForSingleObject( info.event, 1000 ) == 0, "wait failed\n" );
19982 ok( info.ret, "UpdateLayeredWindow failed in other thread\n" );
19983 WaitForSingleObject( thread, 1000 );
19985 GetWindowRect( hwnd, &rect );
19986 ok( rect.left == 200 && rect.top == 200 && rect.right == 450 && rect.bottom == 500,
19987 "wrong window rect %s\n", wine_dbgstr_rect( &rect ));
19988 GetClientRect( hwnd, &rect );
19989 ok( (rect.right == 250 && rect.bottom == 300) ||
19990 broken(rect.right == client.right - 50 && rect.bottom == client.bottom),
19991 "wrong client rect %s\n", wine_dbgstr_rect( &rect ));
19992
19994 DeleteDC( hdc );
19995 DeleteObject( bmp );
19996}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
GLenum src
Definition: glext.h:6340
BITMAP bmp
Definition: alphablend.c:62
static const struct message WmLayeredWinEmptySeq[]
Definition: msg.c:19842
static const struct message WmSetLayeredStyle2[]
Definition: msg.c:19829
static DWORD CALLBACK update_layered_proc(void *param)
Definition: msg.c:19856
static const struct message WmSetLayeredStyle[]
Definition: msg.c:19821
#define ERROR_GEN_FAILURE
Definition: winerror.h:256
#define ERROR_MR_MID_NOT_FOUND
Definition: winerror.h:442
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define ULW_OPAQUE
Definition: winuser.h:2890
#define WS_EX_LAYERED
Definition: winuser.h:389

Referenced by START_TEST().

◆ test_listbox_messages()

static void test_listbox_messages ( void  )
static

Definition at line 17164 of file msg.c.

17165{
17166 HWND parent, listbox;
17167 LRESULT ret;
17168
17169 parent = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
17170 100, 100, 200, 200, 0, 0, 0, NULL);
17171 /* with LBS_HASSTRINGS */
17172 listbox = CreateWindowExA(WS_EX_NOPARENTNOTIFY, "ListBox", NULL,
17174 10, 10, 80, 80, parent, (HMENU)ID_LISTBOX, 0, NULL);
17175 listbox_orig_proc = (WNDPROC)SetWindowLongPtrA(listbox, GWLP_WNDPROC, (ULONG_PTR)listbox_hook_proc);
17176
17177 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17178
17180
17182
17183 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
17184 ok(ret == 0, "expected 0, got %Id\n", ret);
17185 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
17186 ok(ret == 1, "expected 1, got %Id\n", ret);
17187 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
17188 ok(ret == 2, "expected 2, got %Id\n", ret);
17189
17191 check_lb_state(listbox, 3, LB_ERR, 0, 0);
17192
17194
17195 if (winetest_debug > 1) trace("selecting item 0\n");
17196 ret = SendMessageA(listbox, LB_SETCURSEL, 0, 0);
17197 ok(ret == 0, "expected 0, got %Id\n", ret);
17198 ok_sequence(wm_lb_setcursel_0, "LB_SETCURSEL 0", FALSE );
17199 check_lb_state(listbox, 3, 0, 0, 0);
17201
17202 if (winetest_debug > 1) trace("selecting item 1\n");
17203 ret = SendMessageA(listbox, LB_SETCURSEL, 1, 0);
17204 ok(ret == 1, "expected 1, got %Id\n", ret);
17205 ok_sequence(wm_lb_setcursel_1, "LB_SETCURSEL 1", FALSE );
17206 check_lb_state(listbox, 3, 1, 1, 0);
17207
17208 if (winetest_debug > 1) trace("selecting item 2\n");
17209 ret = SendMessageA(listbox, LB_SETCURSEL, 2, 0);
17210 ok(ret == 2, "expected 2, got %Id\n", ret);
17211 ok_sequence(wm_lb_setcursel_2, "LB_SETCURSEL 2", FALSE );
17212 check_lb_state(listbox, 3, 2, 2, 0);
17213
17214 if (winetest_debug > 1) trace("clicking on item 0\n");
17215 ret = SendMessageA(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(1, 1));
17216 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17217 ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0);
17218 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17219 ok_sequence(wm_lb_click_0, "WM_LBUTTONDOWN 0", FALSE );
17220 check_lb_state(listbox, 3, 0, 0, 0);
17222
17223 if (winetest_debug > 1) trace("deleting item 0\n");
17224 ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
17225 ok(ret == 2, "expected 2, got %Id\n", ret);
17226 ok_sequence(wm_lb_deletestring, "LB_DELETESTRING 0", FALSE );
17227 check_lb_state(listbox, 2, -1, 0, 0);
17229
17230 if (winetest_debug > 1) trace("deleting item 0\n");
17231 ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
17232 ok(ret == 1, "expected 1, got %Id\n", ret);
17233 ok_sequence(wm_lb_deletestring, "LB_DELETESTRING 0", FALSE );
17234 check_lb_state(listbox, 1, -1, 0, 0);
17236
17237 if (winetest_debug > 1) trace("deleting item 0\n");
17238 ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
17239 ok(ret == 0, "expected 0, got %Id\n", ret);
17240 ok_sequence(wm_lb_deletestring_reset, "LB_DELETESTRING 0", FALSE );
17241 check_lb_state(listbox, 0, -1, 0, 0);
17243
17244 if (winetest_debug > 1) trace("deleting item 0\n");
17245 ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
17246 ok(ret == LB_ERR, "expected LB_ERR, got %Id\n", ret);
17247 check_lb_state(listbox, 0, -1, 0, 0);
17249
17250 ret = SendMessageA(listbox, LB_DELETESTRING, 0, 0);
17251 ok(ret == LB_ERR, "expected LB_ERR, got %Id\n", ret);
17252 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17254
17255 ret = SendMessageA(listbox, LB_RESETCONTENT, 0, 0);
17256 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17257 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17259
17260 if (winetest_debug > 1) trace("clicking on item 0\n");
17261 ret = SendMessageA(listbox, WM_LBUTTONDBLCLK, 0, MAKELPARAM(1, 1));
17262 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17263 ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0);
17264 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17265 ok_sequence(wm_lb_dblclick_0, "WM_LBUTTONDBLCLK 0", FALSE );
17266 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17268
17270
17271 DestroyWindow(listbox);
17272
17273 /* with LBS_SORT and without LBS_HASSTRINGS */
17274 listbox = CreateWindowExA(WS_EX_NOPARENTNOTIFY, "ListBox", NULL,
17276 10, 10, 80, 80, parent, (HMENU)ID_LISTBOX, 0, NULL);
17277 listbox_orig_proc = (WNDPROC)SetWindowLongPtrA(listbox, GWLP_WNDPROC, (ULONG_PTR)listbox_hook_proc);
17278
17279 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17280
17282
17284
17285 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
17286 ok(ret == 0, "expected 0, got %Id\n", ret);
17287 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
17288 ok(ret == 1, "expected 1, got %Id\n", ret);
17289 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
17290 ok(ret == 2, "expected 2, got %Id\n", ret);
17291
17293 check_lb_state(listbox, 3, LB_ERR, 0, 0);
17294
17295 ret = SendMessageA(listbox, LB_RESETCONTENT, 0, 0);
17296 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17297 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17298 SetFocus(listbox); /* avoid focus messages */
17300
17301 if (winetest_debug > 1) trace("clicking on item 0\n");
17302 ret = SendMessageA(listbox, WM_LBUTTONDBLCLK, 0, MAKELPARAM(1, 1));
17303 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17304 ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0);
17305 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17306 ok_sequence(wm_lb_dblclick_0, "WM_LBUTTONDBLCLK 0", FALSE );
17307 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17309
17311
17312 DestroyWindow(listbox);
17313
17314 /* with LBS_HASSTRINGS */
17315 listbox = CreateWindowExA(WS_EX_NOPARENTNOTIFY, "ListBox", NULL,
17317 10, 10, 80, 80, parent, (HMENU)ID_LISTBOX, 0, NULL);
17318 listbox_orig_proc = (WNDPROC)SetWindowLongPtrA(listbox, GWLP_WNDPROC, (ULONG_PTR)listbox_hook_proc);
17319
17320 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17321
17323
17325
17326 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
17327 ok(ret == 0, "expected 0, got %Id\n", ret);
17328 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
17329 ok(ret == 1, "expected 1, got %Id\n", ret);
17330 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
17331 ok(ret == 2, "expected 2, got %Id\n", ret);
17332
17333 ok_sequence(wm_lb_addstring, "LB_ADDSTRING", FALSE);
17334 check_lb_state(listbox, 3, LB_ERR, 0, 0);
17335
17336 ret = SendMessageA(listbox, LB_RESETCONTENT, 0, 0);
17337 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17338 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17339 SetFocus(listbox); /* avoid focus messages */
17341
17342 if (winetest_debug > 1) trace("clicking on item 0\n");
17343 ret = SendMessageA(listbox, WM_LBUTTONDBLCLK, 0, MAKELPARAM(1, 1));
17344 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17345 ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0);
17346 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17347 ok_sequence(wm_lb_dblclick_0, "WM_LBUTTONDBLCLK 0", FALSE );
17348 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17350
17352
17353 DestroyWindow(listbox);
17354
17355 /* with LBS_HASSTRINGS and LBS_SORT */
17356 listbox = CreateWindowExA(WS_EX_NOPARENTNOTIFY, "ListBox", NULL,
17358 10, 10, 80, 80, parent, (HMENU)ID_LISTBOX, 0, NULL);
17359 listbox_orig_proc = (WNDPROC)SetWindowLongPtrA(listbox, GWLP_WNDPROC, (ULONG_PTR)listbox_hook_proc);
17360
17361 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17362
17364
17366
17367 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 2");
17368 ok(ret == 0, "expected 0, got %Id\n", ret);
17369 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 0");
17370 ok(ret == 0, "expected 0, got %Id\n", ret);
17371 ret = SendMessageA(listbox, LB_ADDSTRING, 0, (LPARAM)"item 1");
17372 ok(ret == 1, "expected 1, got %Id\n", ret);
17373
17374 ok_sequence(wm_lb_addstring, "LB_ADDSTRING", FALSE);
17375 check_lb_state(listbox, 3, LB_ERR, 0, 0);
17376
17377 ret = SendMessageA(listbox, LB_RESETCONTENT, 0, 0);
17378 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17379 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17380 SetFocus(listbox); /* avoid focus messages */
17382
17383 if (winetest_debug > 1) trace("clicking on item 0\n");
17384 ret = SendMessageA(listbox, WM_LBUTTONDBLCLK, 0, MAKELPARAM(1, 1));
17385 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17386 ret = SendMessageA(listbox, WM_LBUTTONUP, 0, 0);
17387 ok(ret == LB_OKAY, "expected LB_OKAY, got %Id\n", ret);
17388 ok_sequence(wm_lb_dblclick_0, "WM_LBUTTONDBLCLK 0", FALSE );
17389 check_lb_state(listbox, 0, LB_ERR, 0, 0);
17391
17393
17394 DestroyWindow(listbox);
17396}
static const struct message wm_lb_addstring_sort_ownerdraw[]
Definition: msg.c:17084
static const struct message wm_lb_setcursel_1[]
Definition: msg.c:16987
#define check_lb_state(a1, a2, a3, a4, a5)
Definition: msg.c:17107
static const struct message wm_lb_click_0[]
Definition: msg.c:17009
static const struct message wm_lb_dblclick_0[]
Definition: msg.c:17100
static const struct message wm_lb_addstring_ownerdraw[]
Definition: msg.c:17071
static const struct message wm_lb_deletestring[]
Definition: msg.c:17041
#define ID_LISTBOX
Definition: msg.c:16976
static LRESULT WINAPI listbox_hook_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
Definition: msg.c:17111
static const struct message wm_lb_deletestring_reset[]
Definition: msg.c:17050
static const struct message wm_lb_addstring[]
Definition: msg.c:17060
static const struct message wm_lb_setcursel_0[]
Definition: msg.c:16978
static const struct message wm_lb_setcursel_2[]
Definition: msg.c:16998
#define LBS_SORT
Definition: pedump.c:679
#define WS_EX_NOPARENTNOTIFY
Definition: pedump.c:646
#define LBS_OWNERDRAWVARIABLE
Definition: pedump.c:683
#define LBS_NOTIFY
Definition: pedump.c:678
#define LB_ERR
Definition: winuser.h:2468
#define LB_OKAY
Definition: winuser.h:2467
#define LB_RESETCONTENT
Definition: winuser.h:2091
#define LB_DELETESTRING
Definition: winuser.h:2061
#define LB_SETCURSEL
Definition: winuser.h:2099

Referenced by START_TEST().

◆ test_mdi_messages()

static void test_mdi_messages ( void  )
static

Definition at line 4177 of file msg.c.

4178{
4179 MDICREATESTRUCTA mdi_cs;
4180 CLIENTCREATESTRUCT client_cs;
4181 HWND mdi_frame, mdi_child, mdi_child2, active_child;
4182 BOOL zoomed;
4183 RECT rc;
4184 HMENU hMenu = CreateMenu();
4185 LONG val;
4186
4188
4190
4191 if (winetest_debug > 1) trace("creating MDI frame window\n");
4192 mdi_frame = CreateWindowExA(0, "MDI_frame_class", "MDI frame window",
4195 100, 100, CW_USEDEFAULT, CW_USEDEFAULT,
4196 GetDesktopWindow(), hMenu,
4198 ok(!!mdi_frame, "Failed to create window, error %lu.\n", GetLastError());
4199 ok_sequence(WmCreateMDIframeSeq, "Create MDI frame window", FALSE);
4200
4201 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4202 ok(GetFocus() == mdi_frame, "wrong focus window %p\n", GetFocus());
4203
4204 if (winetest_debug > 1) trace("creating MDI client window\n");
4205 GetClientRect(mdi_frame, &rc);
4206 client_cs.hWindowMenu = 0;
4207 client_cs.idFirstChild = MDI_FIRST_CHILD_ID;
4208 mdi_client = CreateWindowExA(0, "MDI_client_class",
4209 NULL,
4211 rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top,
4212 mdi_frame, 0, GetModuleHandleA(0), &client_cs);
4213 ok(!!mdi_client, "Failed to create window, error %lu.\n", GetLastError());
4214 SetWindowLongA(mdi_client, 0, 0xdeadbeef);
4215
4216 ok_sequence(WmCreateMDIclientSeq, "Create visible MDI client window", FALSE);
4217 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4218 ok(GetFocus() == mdi_frame, "input focus should be on MDI frame not on %p\n", GetFocus());
4219
4220 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4221 ok(!active_child, "wrong active MDI child %p\n", active_child);
4222 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4223
4224 SetFocus(0);
4226
4227 if (winetest_debug > 1) trace("creating invisible MDI child window\n");
4228 mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4229 WS_CHILD,
4232 ok(!!mdi_child, "Failed to create window, error %lu.\n", GetLastError());
4233
4235 ShowWindow(mdi_child, SW_SHOWNORMAL);
4236 ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOWNORMAL) MDI child window", FALSE);
4237
4238 ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
4239 ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
4240
4241 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4242 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4243
4244 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4245 ok(!active_child, "wrong active MDI child %p\n", active_child);
4246 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4247
4248 ShowWindow(mdi_child, SW_HIDE);
4249 ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE) MDI child window", FALSE);
4251
4252 ShowWindow(mdi_child, SW_SHOW);
4253 ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW) MDI child window", FALSE);
4254
4255 ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
4256 ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
4257
4258 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4259 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4260
4261 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4262 ok(!active_child, "wrong active MDI child %p\n", active_child);
4263 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4264
4265 DestroyWindow(mdi_child);
4267
4268 if (winetest_debug > 1) trace("creating visible MDI child window\n");
4269 mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4273 ok(!!mdi_child, "Failed to create window, error %lu.\n", GetLastError());
4274 ok_sequence(WmCreateMDIchildVisibleSeq, "Create visible MDI child window", FALSE);
4275
4276 ok(GetWindowLongA(mdi_child, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
4277 ok(IsWindowVisible(mdi_child), "MDI child should be visible\n");
4278
4279 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4280 ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
4281
4282 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4283 ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
4284 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4286
4287 DestroyWindow(mdi_child);
4288 ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible MDI child window", TRUE);
4289
4290 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4291 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4292
4293 /* Win2k: MDI client still returns a just destroyed child as active
4294 * Win9x: MDI client returns 0
4295 */
4296 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4297 ok(active_child == mdi_child || /* win2k */
4298 !active_child, /* win9x */
4299 "wrong active MDI child %p\n", active_child);
4300 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4301
4303
4304 if (winetest_debug > 1) trace("creating invisible MDI child window\n");
4305 mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4306 WS_CHILD,
4309 ok(!!mdi_child2, "Failed to create window, error %lu.\n", GetLastError());
4310 ok_sequence(WmCreateMDIchildInvisibleSeq, "Create invisible MDI child window", FALSE);
4311
4312 ok(!(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE), "MDI child should not be visible\n");
4313 ok(!IsWindowVisible(mdi_child2), "MDI child should not be visible\n");
4314
4315 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4316 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4317
4318 /* Win2k: MDI client still returns a just destroyed child as active
4319 * Win9x: MDI client returns mdi_child2
4320 */
4321 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4322 ok(active_child == mdi_child || /* win2k */
4323 active_child == mdi_child2, /* win9x */
4324 "wrong active MDI child %p\n", active_child);
4325 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4327
4328 ShowWindow(mdi_child2, SW_MAXIMIZE);
4329 ok_sequence(WmMaximizeMDIchildInvisibleSeq, "ShowWindow(SW_MAXIMIZE):invisible MDI child", FALSE);
4330
4331 ok(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
4332 ok(IsWindowVisible(mdi_child2), "MDI child should be visible\n");
4333
4334 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4335 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4336 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4338
4339 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4340 ok(GetFocus() == mdi_child2 || /* win2k */
4341 GetFocus() == 0, /* win9x */
4342 "wrong focus window %p\n", GetFocus());
4343
4344 SetFocus(0);
4346
4347 ShowWindow(mdi_child2, SW_HIDE);
4348 ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE);
4349
4350 ShowWindow(mdi_child2, SW_RESTORE);
4351 ok_sequence(WmRestoreMDIchildInvisibleSeq, "ShowWindow(SW_RESTORE):invisible MDI child", FALSE);
4353
4354 ok(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
4355 ok(IsWindowVisible(mdi_child2), "MDI child should be visible\n");
4356
4357 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4358 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4359 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4361
4362 SetFocus(0);
4364
4365 ShowWindow(mdi_child2, SW_HIDE);
4366 ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE);
4367
4368 ShowWindow(mdi_child2, SW_SHOW);
4369 ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):MDI child", FALSE);
4370
4371 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4372 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4373
4374 ShowWindow(mdi_child2, SW_MAXIMIZE);
4375 ok_sequence(WmMaximizeMDIchildVisibleSeq, "ShowWindow(SW_MAXIMIZE):MDI child", FALSE);
4376
4377 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4378 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4379
4380 ShowWindow(mdi_child2, SW_RESTORE);
4381 ok_sequence(WmRestoreMDIchildVisibleSeq, "ShowWindow(SW_RESTORE):maximized MDI child", FALSE);
4382
4383 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4384 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4385
4386 ShowWindow(mdi_child2, SW_MINIMIZE);
4387 ok_sequence(WmMinimizeMDIchildVisibleSeq, "ShowWindow(SW_MINIMIZE):MDI child", FALSE);
4388
4389 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4390 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4391
4392 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4393 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4394 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4396
4397 ShowWindow(mdi_child2, SW_RESTORE);
4398 ok_sequence(WmRestoreMDIchildVisibleSeq_2, "ShowWindow(SW_RESTORE):minimized MDI child", FALSE);
4399
4400 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4401 ok(GetFocus() == mdi_child2, "wrong focus window %p\n", GetFocus());
4402
4403 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4404 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4405 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4407
4408 SetFocus(0);
4410
4411 ShowWindow(mdi_child2, SW_HIDE);
4412 ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):MDI child", FALSE);
4413
4414 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4415 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4416
4417 DestroyWindow(mdi_child2);
4418 ok_sequence(WmDestroyMDIchildInvisibleSeq, "Destroy invisible MDI child window", FALSE);
4419
4420 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4421 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4422
4423 if (winetest_debug > 1) trace("Testing WM_CHILDACTIVATE\n");
4424
4425 mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4429
4430 mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4434
4435 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4436 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4437 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4438
4440 SendMessageW(mdi_child, WM_CHILDACTIVATE, 0, 0);
4441 ok_sequence(WmChildActivateDisabledWindowSeq, "WM_CHILDACTIVATE sent to disabled window", FALSE);
4442
4443 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4444 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4445 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4447
4448 EnableWindow(mdi_child, TRUE);
4449
4450 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4451 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4452 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4453
4455 SendMessageW(mdi_child, WM_CHILDACTIVATE, 0, 0);
4456 ok_sequence(WmChildActivateWindowSeq, "WM_CHILDACTIVATE sent to enabled window", FALSE);
4457
4458 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4459 ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
4460 ok(!zoomed, "wrong zoomed state %d\n", zoomed);
4462
4463 DestroyWindow(mdi_child);
4464 DestroyWindow(mdi_child2);
4466
4467 /* test for maximized MDI children */
4468 if (winetest_debug > 1) trace("creating maximized visible MDI child window 1\n");
4469 mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4473 ok(!!mdi_child, "Failed to create window, error %lu.\n", GetLastError());
4474 ok_sequence(WmCreateMDIchildVisibleMaxSeq1, "Create maximized visible 1st MDI child window", TRUE);
4475 ok(IsZoomed(mdi_child), "1st MDI child should be maximized\n");
4476
4477 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4478 ok(GetFocus() == mdi_child || /* win2k */
4479 GetFocus() == 0, /* win9x */
4480 "wrong focus window %p\n", GetFocus());
4481
4482 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4483 ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
4484 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4486
4487 if (winetest_debug > 1) trace("creating maximized visible MDI child window 2\n");
4488 mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4492 ok(!!mdi_child2, "Failed to create window, error %lu.\n", GetLastError());
4493 ok_sequence(WmCreateMDIchildVisibleMaxSeq2, "Create maximized visible 2nd MDI child 2 window", TRUE);
4494 ok(IsZoomed(mdi_child2), "2nd MDI child should be maximized\n");
4495 ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized\n");
4496
4497 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4498 ok(GetFocus() == mdi_child2, "wrong focus window %p\n", GetFocus());
4499
4500 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4501 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4502 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4504
4505 if (winetest_debug > 1) trace("destroying maximized visible MDI child window 2\n");
4506 DestroyWindow(mdi_child2);
4507 ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible MDI child window", TRUE);
4508
4509 ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized\n");
4510
4511 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4512 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4513
4514 /* Win2k: MDI client still returns a just destroyed child as active
4515 * Win9x: MDI client returns 0
4516 */
4517 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4518 ok(active_child == mdi_child2 || /* win2k */
4519 !active_child, /* win9x */
4520 "wrong active MDI child %p\n", active_child);
4522
4523 ShowWindow(mdi_child, SW_MAXIMIZE);
4524 ok(IsZoomed(mdi_child), "1st MDI child should be maximized\n");
4526
4527 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4528 ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
4529
4530 if (winetest_debug > 1) trace("re-creating maximized visible MDI child window 2\n");
4531 mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4535 ok(!!mdi_child2, "Failed to create window, error %lu.\n", GetLastError());
4536 ok_sequence(WmCreateMDIchildVisibleMaxSeq2, "Create maximized visible 2nd MDI child 2 window", TRUE);
4537 ok(IsZoomed(mdi_child2), "2nd MDI child should be maximized\n");
4538 ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized\n");
4539
4540 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4541 ok(GetFocus() == mdi_child2, "wrong focus window %p\n", GetFocus());
4542
4543 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4544 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4545 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4547
4548 SendMessageA(mdi_child2, WM_SYSCOMMAND, SC_CLOSE, 0);
4549 ok_sequence(WmDestroyMDIchildVisibleMaxSeq2, "WM_SYSCOMMAND/SC_CLOSE on a visible maximized MDI child window", TRUE);
4550 ok(!IsWindow(mdi_child2), "MDI child 2 should be destroyed\n");
4551
4552 ok(IsZoomed(mdi_child), "1st MDI child should be maximized\n");
4553 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4554 ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
4555
4556 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4557 ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
4558 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4560
4561 DestroyWindow(mdi_child);
4562 ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible MDI child window", TRUE);
4563
4564 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4565 ok(GetFocus() == 0, "wrong focus window %p\n", GetFocus());
4566
4567 /* Win2k: MDI client still returns a just destroyed child as active
4568 * Win9x: MDI client returns 0
4569 */
4570 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4571 ok(active_child == mdi_child || /* win2k */
4572 !active_child, /* win9x */
4573 "wrong active MDI child %p\n", active_child);
4575
4576 if (winetest_debug > 1) trace("creating maximized invisible MDI child window\n");
4577 mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4581 ok(!!mdi_child2, "Failed to create window, error %lu.\n", GetLastError());
4582#ifdef __REACTOS__
4584#endif
4585 ok_sequence(WmCreateMDIchildInvisibleMaxSeq4, "Create maximized invisible MDI child window", FALSE);
4586 ok(IsZoomed(mdi_child2), "MDI child should be maximized\n");
4587 ok(!(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE), "MDI child should be not visible\n");
4588 ok(!IsWindowVisible(mdi_child2), "MDI child should be not visible\n");
4589
4590 /* Win2k: MDI client still returns a just destroyed child as active
4591 * Win9x: MDI client returns 0
4592 */
4593 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4594 ok(active_child == mdi_child || /* win2k */
4595 !active_child || active_child == mdi_child2, /* win9x */
4596 "wrong active MDI child %p\n", active_child);
4598
4599 if (winetest_debug > 1) trace("call ShowWindow(mdi_child, SW_MAXIMIZE)\n");
4600 ShowWindow(mdi_child2, SW_MAXIMIZE);
4601 ok_sequence(WmMaximizeMDIchildInvisibleSeq2, "ShowWindow(SW_MAXIMIZE):invisible maximized MDI child", FALSE);
4602 ok(IsZoomed(mdi_child2), "MDI child should be maximized\n");
4603 ok(GetWindowLongA(mdi_child2, GWL_STYLE) & WS_VISIBLE, "MDI child should be visible\n");
4604 ok(IsWindowVisible(mdi_child2), "MDI child should be visible\n");
4605
4606 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4607 ok(active_child == mdi_child2, "wrong active MDI child %p\n", active_child);
4608 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4610
4611 SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child2, 0);
4613
4614 /* end of test for maximized MDI children */
4615 SetFocus(0);
4617 if (winetest_debug > 1) trace("creating maximized visible MDI child window 1(Switch test)\n");
4618 mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4622 ok(!!mdi_child, "Failed to create window, error %lu.\n", GetLastError());
4623 ok_sequence(WmCreateMDIchildVisibleMaxSeq1, "Create maximized visible 1st MDI child window(Switch test)", TRUE);
4624 ok(IsZoomed(mdi_child), "1st MDI child should be maximized(Switch test)\n");
4625
4626 ok(GetActiveWindow() == mdi_frame, "wrong active window %p(Switch test)\n", GetActiveWindow());
4627 ok(GetFocus() == mdi_child || /* win2k */
4628 GetFocus() == 0, /* win9x */
4629 "wrong focus window %p(Switch test)\n", GetFocus());
4630
4631 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4632 ok(active_child == mdi_child, "wrong active MDI child %p(Switch test)\n", active_child);
4633 ok(zoomed, "wrong zoomed state %d(Switch test)\n", zoomed);
4635
4636 if (winetest_debug > 1) trace("creating maximized visible MDI child window 2(Switch test)\n");
4637 mdi_child2 = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4641 ok(!!mdi_child2, "Failed to create window, error %lu.\n", GetLastError());
4642 ok_sequence(WmCreateMDIchildVisibleMaxSeq2, "Create maximized visible 2nd MDI child window (Switch test)", TRUE);
4643
4644 ok(IsZoomed(mdi_child2), "2nd MDI child should be maximized(Switch test)\n");
4645 ok(!IsZoomed(mdi_child), "1st MDI child should NOT be maximized(Switch test)\n");
4646
4647 ok(GetActiveWindow() == mdi_frame, "wrong active window %p(Switch test)\n", GetActiveWindow());
4648 ok(GetFocus() == mdi_child2, "wrong focus window %p(Switch test)\n", GetFocus());
4649
4650 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4651 ok(active_child == mdi_child2, "wrong active MDI child %p(Switch test)\n", active_child);
4652 ok(zoomed, "wrong zoomed state %d(Switch test)\n", zoomed);
4654
4655 if (winetest_debug > 1) trace("Switch child window.\n");
4657 ok_sequence(WmSwitchChild, "Child did not switch correctly", TRUE);
4658 if (winetest_debug > 1) trace("end of test for switch maximized MDI children\n");
4660
4661 /* Prepare for switching test of not maximized MDI children */
4662 ShowWindow( mdi_child, SW_NORMAL );
4663 ok(!IsZoomed(mdi_child), "wrong zoomed state for %p(Switch test)\n", mdi_child);
4664 ok(!IsZoomed(mdi_child2), "wrong zoomed state for %p(Switch test)\n", mdi_child2);
4665 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0);
4666 ok(active_child == mdi_child, "wrong active MDI child %p(Switch test)\n", active_child);
4668
4669 SendMessageA(mdi_client, WM_MDIACTIVATE, (WPARAM)mdi_child2, 0);
4670 ok_sequence(WmSwitchNotMaximizedChild, "Not maximized child did not switch correctly", FALSE);
4671 if (winetest_debug > 1) trace("end of test for switch not maximized MDI children\n");
4673
4676
4677 SendMessageA(mdi_client, WM_MDIDESTROY, (WPARAM)mdi_child2, 0);
4679
4680 SetFocus(0);
4682 /* end of tests for switch maximized/not maximized MDI children */
4683
4684 mdi_cs.szClass = "MDI_child_Class";
4685 mdi_cs.szTitle = "MDI child";
4686 mdi_cs.hOwner = GetModuleHandleA(0);
4687 mdi_cs.x = 0;
4688 mdi_cs.y = 0;
4689 mdi_cs.cx = CW_USEDEFAULT;
4690 mdi_cs.cy = CW_USEDEFAULT;
4692 mdi_cs.lParam = 0;
4693 mdi_child = (HWND)SendMessageA(mdi_client, WM_MDICREATE, 0, (LPARAM)&mdi_cs);
4694 ok(mdi_child != 0, "MDI child creation failed\n");
4695 ok_sequence(WmCreateMDIchildVisibleMaxSeq3, "WM_MDICREATE for maximized visible MDI child window", TRUE);
4696
4697 ok(GetMenuItemID(hMenu, GetMenuItemCount(hMenu) - 1) == SC_CLOSE, "SC_CLOSE menu item not found\n");
4698
4699 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4700 ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
4701
4702 ok(IsZoomed(mdi_child), "MDI child should be maximized\n");
4703 ok(GetActiveWindow() == mdi_frame, "wrong active window %p\n", GetActiveWindow());
4704 ok(GetFocus() == mdi_child, "wrong focus window %p\n", GetFocus());
4705
4706 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4707 ok(active_child == mdi_child, "wrong active MDI child %p\n", active_child);
4708 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4710
4712 ok_sequence(WmDestroyMDIchildVisibleMaxSeq1, "Destroy visible maximized MDI child window", TRUE);
4713
4714 ok(!IsWindow(mdi_child), "MDI child should be destroyed\n");
4715 active_child = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, (LPARAM)&zoomed);
4716 ok(!active_child, "wrong active MDI child %p\n", active_child);
4717
4718 SetFocus(0);
4720
4722 ok(val == 0xdeadbeef || broken(val == 0) /* >= Win Vista */, "Expected 0xdeadbeef, got 0x%lx\n", val);
4724 ok_sequence(WmDestroyMDIclientSeq, "Destroy MDI client window", FALSE);
4725
4726 /* test maximization of MDI child with invisible parent */
4727 client_cs.hWindowMenu = 0;
4728 mdi_client = CreateWindowA("MDI_client_class",
4729 NULL,
4731 0, 0, 660, 430,
4732 mdi_frame, 0, GetModuleHandleA(0), &client_cs);
4733 ok_sequence(WmCreateMDIclientSeq, "Create MDI client window", FALSE);
4734
4736 ok_sequence(WmHideMDIclientSeq, "Hide MDI client window", FALSE);
4737
4738 mdi_child = CreateWindowExA(WS_EX_MDICHILD, "MDI_child_class", "MDI child",
4740 0, 0, 650, 440,
4742 ok_sequence(WmCreateMDIchildInvisibleParentSeq, "Create MDI child window with invisible parent", FALSE);
4743
4744 SendMessageA(mdi_client, WM_MDIMAXIMIZE, (WPARAM) mdi_child, 0);
4745 ok_sequence(WmMaximizeMDIchildInvisibleParentSeq, "Maximize MDI child window with invisible parent", TRUE);
4746 zoomed = IsZoomed(mdi_child);
4747 ok(zoomed, "wrong zoomed state %d\n", zoomed);
4748
4750 ok_sequence(WmShowMDIclientSeq, "Show MDI client window", FALSE);
4751
4752 DestroyWindow(mdi_child);
4753 ok_sequence(WmDestroyMDIchildVisibleSeq, "Destroy visible maximized MDI child window", TRUE);
4754
4755 /* end of test for maximization of MDI child with invisible parent */
4756
4758 ok_sequence(WmDestroyMDIclientSeq, "Destroy MDI client window", FALSE);
4759
4760 DestroyWindow(mdi_frame);
4761 ok_sequence(WmDestroyMDIframeSeq, "Destroy MDI frame window", FALSE);
4762}
GLuint GLfloat * val
Definition: glext.h:7180
static const struct message WmCreateMDIchildInvisibleParentSeq[]
Definition: msg.c:3148
static const struct message WmCreateMDIframeSeq[]
Definition: msg.c:2976
static const struct message WmCreateMDIchildInvisibleMaxSeq4[]
Definition: msg.c:3525
static const struct message WmDestroyMDIframeSeq[]
Definition: msg.c:3016
static const struct message WmCreateMDIchildVisibleSeq[]
Definition: msg.c:3082
static const struct message WmDestroyMDIchildInvisibleSeq[]
Definition: msg.c:3269
static const struct message WmMinimizeMDIchildVisibleSeq[]
Definition: msg.c:4008
static const struct message WmCreateMDIchildVisibleMaxSeq3[]
Definition: msg.c:3423
static const struct message WmCreateMDIchildVisibleMaxSeq2[]
Definition: msg.c:3342
static const struct message WmHideChildSeq[]
Definition: msg.c:1492
static const struct message WmDestroyMDIchildVisibleMaxSeq1[]
Definition: msg.c:3654
static const struct message WmMaximizeMDIchildInvisibleSeq2[]
Definition: msg.c:3856
static const struct message WmCreateMDIclientSeq[]
Definition: msg.c:3033
static const struct message WmSwitchChild[]
Definition: msg.c:337
static const struct message WmShowChildSeq[]
Definition: msg.c:1483
static const struct message WmRestoreMDIchildInvisibleSeq[]
Definition: msg.c:4021
static const struct message WmDestroyMDIclientSeq[]
Definition: msg.c:3068
static const struct message WmMaximizeMDIchildInvisibleParentSeq[]
Definition: msg.c:3885
#define MDI_FIRST_CHILD_ID
Definition: msg.c:39
static const struct message WmMaximizeMDIchildInvisibleSeq[]
Definition: msg.c:3824
static const struct message WmRestoreMDIchildVisibleSeq_2[]
Definition: msg.c:3989
static void mdi_register_classes(void)
Definition: msg.c:4147
static const struct message WmDestroyMDIchildVisibleSeq[]
Definition: msg.c:3183
static const struct message WmCreateMDIchildInvisibleSeq[]
Definition: msg.c:3252
static const struct message WmDestroyMDIchildVisibleMaxSeq2[]
Definition: msg.c:3563
static const struct message WmHideMDIclientSeq[]
Definition: msg.c:3059
static const struct message WmShowMDIclientSeq[]
Definition: msg.c:3051
static const struct message WmCreateMDIchildVisibleMaxSeq1[]
Definition: msg.c:3284
static const struct message WmSwitchNotMaximizedChild[]
Definition: msg.c:392
static const struct message WmMaximizeMDIchildVisibleSeq[]
Definition: msg.c:3956
static const struct message WmRestoreMDIchildVisibleSeq[]
Definition: msg.c:3973
static const struct message WmChildActivateWindowSeq[]
Definition: msg.c:3128
static const struct message WmChildActivateDisabledWindowSeq[]
Definition: msg.c:3123
#define WS_MAXIMIZE
Definition: pedump.c:623
#define WM_MDICREATE
Definition: winuser.h:1840
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
#define WM_CHILDACTIVATE
Definition: winuser.h:1666
HMENU WINAPI CreateMenu(void)
Definition: menu.c:829
UINT WINAPI GetMenuItemID(_In_ HMENU, _In_ int)
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
BOOL WINAPI IsZoomed(_In_ HWND)
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define WM_MDIDESTROY
Definition: winuser.h:1841
#define WM_MDIMAXIMIZE
Definition: winuser.h:1845
#define SC_CLOSE
Definition: winuser.h:2628
#define SW_NORMAL
Definition: winuser.h:780

Referenced by START_TEST().

◆ test_menu_messages()

static void test_menu_messages ( void  )
static

Definition at line 17634 of file msg.c.

17635{
17636 MSG msg;
17637 WNDCLASSA cls;
17638 HMENU hmenu, hmenu_popup;
17639 HWND hwnd;
17640 DWORD style;
17641 BOOL us_kbd = (GetKeyboardLayout(0) == (HKL)(ULONG_PTR)0x04090409);
17642
17643 cls.style = 0;
17645 cls.cbClsExtra = 0;
17646 cls.cbWndExtra = 0;
17647 cls.hInstance = GetModuleHandleA(0);
17648 cls.hIcon = 0;
17651 cls.lpszMenuName = NULL;
17652 cls.lpszClassName = "TestMenuClass";
17654 register_class(&cls);
17655
17656 SetLastError(0xdeadbeef);
17657 hwnd = CreateWindowExA(0, "TestMenuClass", NULL, WS_OVERLAPPEDWINDOW | WS_VISIBLE,
17658 100, 100, 200, 200, 0, 0, 0, NULL);
17659 ok(hwnd != 0, "LoadMenuA error %lu\n", GetLastError());
17660
17661 SetLastError(0xdeadbeef);
17663 ok(hmenu != 0, "LoadMenuA error %lu\n", GetLastError());
17664
17665 SetMenu(hwnd, hmenu);
17667 flush_events();
17668
17671 ok(style == MNS_NOTIFYBYPOS, "expected MNS_NOTIFYBYPOS, got %lu\n", style);
17672
17673 hmenu_popup = GetSubMenu(hmenu, 0);
17674 ok(hmenu_popup != 0, "GetSubMenu returned 0 for submenu 0\n");
17675 style = get_menu_style(hmenu_popup);
17676 ok(style == 0, "expected 0, got %lu\n", style);
17677
17678 hmenu_popup = GetSubMenu(hmenu_popup, 0);
17679 ok(hmenu_popup != 0, "GetSubMenu returned 0 for submenu 0\n");
17680 style = get_menu_style(hmenu_popup);
17681 ok(style == 0, "expected 0, got %lu\n", style);
17682
17683 if (!us_kbd)
17684 {
17685 skip("skipping ascii VK events on non-us keyboard\n");
17686 goto done;
17687 }
17688
17689 /* Alt+E, Enter */
17690 if (winetest_debug > 1) trace("testing a popup menu command\n");
17692 keybd_event(VK_MENU, 0, 0, 0);
17693 keybd_event('E', 0, 0, 0);
17694 keybd_event('E', 0, KEYEVENTF_KEYUP, 0);
17696 keybd_event(VK_RETURN, 0, 0, 0);
17698 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
17699 {
17702 }
17703 if (!sequence_cnt) /* we didn't get any message */
17704 {
17705 skip( "queuing key events not supported\n" );
17706 goto done;
17707 }
17708 /* win98 queues only a WM_KEYUP and doesn't start menu tracking */
17709 if (sequence[0].message == WM_KEYUP && sequence[0].wParam == VK_MENU)
17710 {
17711 win_skip( "menu tracking through VK_MENU not supported\n" );
17712 goto done;
17713 }
17714#ifdef __REACTOS__
17716#endif
17717 ok_sequence(wm_popup_menu_1, "popup menu command", FALSE);
17718
17719 /* Alt+F, Right, Enter */
17720 if (winetest_debug > 1) trace("testing submenu of a popup menu command\n");
17722 keybd_event(VK_MENU, 0, 0, 0);
17723 keybd_event('F', 0, 0, 0);
17724 keybd_event('F', 0, KEYEVENTF_KEYUP, 0);
17726 keybd_event(VK_RIGHT, 0, 0, 0);
17728 keybd_event(VK_RETURN, 0, 0, 0);
17730 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
17731 {
17734 }
17735#ifdef __REACTOS__
17737#endif
17738 ok_sequence(wm_popup_menu_2, "submenu of a popup menu command", FALSE);
17739
17740 if (winetest_debug > 1) trace("testing single menu item command\n");
17742 keybd_event(VK_MENU, 0, 0, 0);
17743 keybd_event('Q', 0, 0, 0);
17744 keybd_event('Q', 0, KEYEVENTF_KEYUP, 0);
17746 keybd_event(VK_ESCAPE, 0, 0, 0);
17748 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
17749 {
17752 }
17753#ifdef __REACTOS__
17755#endif
17756 ok_sequence(wm_single_menu_item, "single menu item command", FALSE);
17757
17760 ok(style == 0, "expected 0, got %lu\n", style);
17761
17762 hmenu_popup = GetSubMenu(hmenu, 0);
17763 ok(hmenu_popup != 0, "GetSubMenu returned 0 for submenu 0\n");
17764 set_menu_style(hmenu_popup, MNS_NOTIFYBYPOS);
17765 style = get_menu_style(hmenu_popup);
17766 ok(style == MNS_NOTIFYBYPOS, "expected MNS_NOTIFYBYPOS, got %lu\n", style);
17767
17768 hmenu_popup = GetSubMenu(hmenu_popup, 0);
17769 ok(hmenu_popup != 0, "GetSubMenu returned 0 for submenu 0\n");
17770 style = get_menu_style(hmenu_popup);
17771 ok(style == 0, "expected 0, got %lu\n", style);
17772
17773 /* Alt+F, Right, Enter */
17774 if (winetest_debug > 1) trace("testing submenu of a popup menu command\n");
17776 keybd_event(VK_MENU, 0, 0, 0);
17777 keybd_event('F', 0, 0, 0);
17778 keybd_event('F', 0, KEYEVENTF_KEYUP, 0);
17780 keybd_event(VK_RIGHT, 0, 0, 0);
17782 keybd_event(VK_RETURN, 0, 0, 0);
17784 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
17785 {
17788 }
17789#ifdef __REACTOS__
17791#endif
17792 ok_sequence(wm_popup_menu_3, "submenu of a popup menu command", FALSE);
17793
17794done:
17797}
static DWORD get_menu_style(HMENU hmenu)
Definition: msg.c:17619
static const struct message wm_popup_menu_3[]
Definition: msg.c:17490
static LRESULT WINAPI parent_menu_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
Definition: msg.c:17573
static const struct message wm_single_menu_item[]
Definition: msg.c:17546
static const struct message wm_popup_menu_2[]
Definition: msg.c:17435
static const struct message wm_popup_menu_1[]
Definition: msg.c:17399
static void set_menu_style(HMENU hmenu, DWORD style)
Definition: msg.c:17606
BOOL WINAPI SetMenu(_In_ HWND, _In_opt_ HMENU)
#define MNS_NOTIFYBYPOS
Definition: winuser.h:770
#define VK_RETURN
Definition: winuser.h:2237
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define VK_RIGHT
Definition: winuser.h:2262
HMENU WINAPI LoadMenuA(_In_opt_ HINSTANCE, _In_ LPCSTR)

Referenced by START_TEST().

◆ test_message_conversion()

static void test_message_conversion ( void  )
static

Definition at line 11516 of file msg.c.

11517{
11518 static const WCHAR wszMsgConversionClass[] =
11519 {'M','s','g','C','o','n','v','e','r','s','i','o','n','C','l','a','s','s',0};
11520 char buffer[200];
11521 DEV_BROADCAST_DEVICEINTERFACE_A *dev_interface = (void *)buffer;
11522 WNDCLASSW cls;
11523 LRESULT lRes;
11524 HWND hwnd;
11525 WNDPROC wndproc, newproc;
11526 BOOL ret;
11527
11528 cls.style = 0;
11530 cls.cbClsExtra = 0;
11531 cls.cbWndExtra = 0;
11533 cls.hIcon = NULL;
11535 cls.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
11536 cls.lpszMenuName = NULL;
11537 cls.lpszClassName = wszMsgConversionClass;
11538 /* this call will fail on Win9x, but that doesn't matter as this test is
11539 * meaningless on those platforms */
11540 if(!RegisterClassW(&cls)) return;
11541
11542 hwnd = CreateWindowExW(0, wszMsgConversionClass, NULL, WS_OVERLAPPED,
11543 100, 100, 200, 200, 0, 0, 0, NULL);
11544 ok(hwnd != NULL, "Window creation failed\n");
11545
11546 /* {W, A} -> A */
11547
11550 ok(lRes == 0, "String should have been converted\n");
11552 ok(lRes == 1, "String shouldn't have been converted\n");
11553
11554 /* {W, A} -> W */
11555
11558 ok(lRes == 1, "String shouldn't have been converted\n");
11560 ok(lRes == 1, "String shouldn't have been converted\n");
11561
11562 /* Synchronous messages */
11563
11565 ok(lRes == 0, "String should have been converted\n");
11567 ok(lRes == 1, "String shouldn't have been converted\n");
11568
11569 /* Asynchronous messages */
11570
11571 SetLastError(0);
11574 "PostMessage on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11575 SetLastError(0);
11578 "PostMessage on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11579 SetLastError(0);
11582 "PosThreadtMessage on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11583 SetLastError(0);
11586 "PosThreadtMessage on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11587 SetLastError(0);
11590 "SendNotifyMessage on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11591 SetLastError(0);
11594 "SendNotifyMessage on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11595 SetLastError(0);
11598 "SendMessageCallback on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11599 SetLastError(0);
11602 "SendMessageCallback on sync only message returned %Id, last error %ld\n", lRes, GetLastError());
11603
11604 /* Test WM_DEVICECHANGE. */
11605
11607 dev_interface->dbcc_reserved = 0;
11608 dev_interface->dbcc_classguid = iface_guid;
11609 strcpy(dev_interface->dbcc_name, "test name");
11611 dbcc_name[strlen(dev_interface->dbcc_name)]);
11612 lRes = SendMessageA(hwnd, WM_DEVICECHANGE, DBT_DEVICEARRIVAL, (LPARAM)dev_interface);
11613 ok(lRes == 2, "Got %Id, error %lu.\n", lRes, GetLastError());
11614
11616
11617 /* Check WM_GETTEXTLENGTH A->W behaviour, whether WM_GETTEXT is also sent or not */
11618
11621 100, 100, 200, 200, 0, 0, 0, NULL);
11622 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
11624 lRes = SendMessageA (hwnd, WM_GETTEXTLENGTH, 0, 0);
11625 ok_sequence(WmGetTextLengthAfromW, "ANSI WM_GETTEXTLENGTH to Unicode window", FALSE);
11627 "got bad length %Id\n", lRes );
11628
11631 hwnd, WM_GETTEXTLENGTH, 0, 0);
11632 ok_sequence(WmGetTextLengthAfromW, "ANSI WM_GETTEXTLENGTH to Unicode window", FALSE);
11634 "got bad length %Id\n", lRes );
11635
11638 lRes = CallWindowProcA( newproc, hwnd, WM_GETTEXTLENGTH, 0, 0 );
11640 NULL, 0, NULL, NULL ) ||
11641 broken(lRes == lstrlenW(dummy_window_text) + 37),
11642 "got bad length %Id\n", lRes );
11643
11644 SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)wndproc ); /* restore old wnd proc */
11645 lRes = CallWindowProcA( newproc, hwnd, WM_GETTEXTLENGTH, 0, 0 );
11647 NULL, 0, NULL, NULL ) ||
11648 broken(lRes == lstrlenW(dummy_window_text) + 37),
11649 "got bad length %Id\n", lRes );
11650
11652 ok( ret, "DestroyWindow() error %ld\n", GetLastError());
11653}
static const struct message WmGetTextLengthAfromW[]
Definition: msg.c:11493
static LRESULT CALLBACK get_text_len_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: msg.c:11502
static LRESULT CALLBACK MsgConversionProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: msg.c:11464
BOOL WINAPI SendNotifyMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GetWindowLongPtrW
Definition: winuser.h:4983
BOOL WINAPI SendMessageCallbackW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ SENDASYNCPROC, _In_ ULONG_PTR)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4470
#define COLOR_BTNFACE
Definition: winuser.h:939

Referenced by START_TEST().

◆ test_messages()

static void test_messages ( void  )
static

Definition at line 5556 of file msg.c.

5557{
5558 DWORD tid;
5559 HANDLE hthread;
5560 HWND hwnd, hparent, hchild;
5561 HWND hchild2, hbutton;
5562 HMENU hmenu;
5563 MSG msg;
5564 LRESULT res;
5565 POINT pos;
5566 BOOL ret;
5567
5569
5570 hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
5571 100, 100, 200, 200, 0, 0, 0, NULL);
5572 ok (hwnd != 0, "Failed to create overlapped window\n");
5573 ok_sequence(WmCreateOverlappedSeq, "CreateWindow:overlapped", FALSE);
5574
5575 /* test ShowWindow(SW_HIDE) on a newly created invisible window */
5576 ok( ShowWindow(hwnd, SW_HIDE) == FALSE, "ShowWindow: window was visible\n" );
5577 ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped, invisible", FALSE);
5578
5579 /* test WM_SETREDRAW on a not visible top level window */
5581
5583 flush_events();
5584 ok_sequence(WmSWP_ShowOverlappedSeq, "SetWindowPos:SWP_SHOWWINDOW:overlapped", FALSE);
5585 ok(IsWindowVisible(hwnd), "window should be visible at this point\n");
5586
5587 ok(GetActiveWindow() == hwnd, "window should be active\n");
5588 ok(GetFocus() == hwnd, "window should have input focus\n");
5590 flush_events();
5591 ok_sequence(WmHideOverlappedSeq, "ShowWindow(SW_HIDE):overlapped", FALSE);
5592
5593 /* test ShowWindow(SW_HIDE) on a hidden window - single threaded */
5594 ok(ShowWindow(hwnd, SW_HIDE) == FALSE, "ShowWindow(SW_HIDE) expected FALSE\n");
5595 flush_events();
5596 ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped", FALSE);
5597
5598 /* test ShowWindow(SW_HIDE) on a hidden window - multi-threaded */
5599 hthread = CreateThread( NULL, 0, hide_window_thread, hwnd, 0, &tid );
5600 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
5601 ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
5602 CloseHandle(hthread);
5603 flush_events();
5604 ok_sequence(WmEmptySeq, "ShowWindow(SW_HIDE):overlapped", FALSE);
5605
5607 flush_events();
5608 ok_sequence(WmShowOverlappedSeq, "ShowWindow(SW_SHOW):overlapped", TRUE);
5609
5610 /* test ShowWindow(SW_SHOW) on a visible window - multi-threaded */
5611 hthread = CreateThread( NULL, 0, show_window_thread, hwnd, 0, &tid );
5612 ok( hthread != NULL, "CreateThread failed, error %ld\n", GetLastError() );
5613 ok( WaitForSingleObject( hthread, INFINITE ) == WAIT_OBJECT_0, "WaitForSingleObject failed\n" );
5614 CloseHandle( hthread );
5615 flush_events();
5616 ok_sequence( WmEmptySeq, "ShowWindow(SW_SHOW):overlapped", FALSE );
5617
5619 flush_events();
5620 ok_sequence(WmHideOverlappedSeq, "ShowWindow(SW_HIDE):overlapped", FALSE);
5621
5623 flush_events();
5624 ok_sequence(WmShowMaxOverlappedSeq, "ShowWindow(SW_SHOWMAXIMIZED):overlapped", TRUE);
5626
5628 {
5630 flush_events();
5631 ok_sequence(WmShowRestoreMaxOverlappedSeq, "ShowWindow(SW_RESTORE):overlapped", TRUE);
5633 }
5634
5636 flush_events();
5637 ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", FALSE);
5639
5641 {
5643 flush_events();
5644 ok_sequence(WmShowRestoreMinOverlappedSeq, "ShowWindow(SW_RESTORE):overlapped", FALSE);
5646 }
5647
5649 flush_events();
5650 ok_sequence(WmOptionalPaint, "ShowWindow(SW_SHOW):overlapped already visible", FALSE);
5651
5653 ok_sequence(WmSWP_HideOverlappedSeq, "SetWindowPos:SWP_HIDEWINDOW:overlapped", FALSE);
5654 ok(!IsWindowVisible(hwnd), "window should not be visible at this point\n");
5655 ok(GetActiveWindow() == hwnd, "window should still be active\n");
5656
5657 /* test WM_SETREDRAW on a visible top level window */
5659 flush_events();
5661
5662 if (winetest_debug > 1) trace("testing scroll APIs on a visible top level window %p\n", hwnd);
5664
5665 /* test resizing and moving */
5666 SetWindowPos( hwnd, 0, 0, 0, 300, 300, SWP_NOMOVE|SWP_NOACTIVATE );
5667 ok_sequence(WmSWP_ResizeSeq, "SetWindowPos:Resize", FALSE );
5668 flush_events();
5670 SetWindowPos( hwnd, 0, 200, 200, 0, 0, SWP_NOSIZE|SWP_NOACTIVATE );
5671 ok_sequence(WmSWP_MoveSeq, "SetWindowPos:Move", FALSE );
5672 flush_events();
5674 SetWindowPos( hwnd, 0, 200, 200, 250, 250, SWP_NOZORDER|SWP_NOACTIVATE );
5675 ok_sequence(WmSWP_ResizeNoZOrder, "SetWindowPos:WmSWP_ResizeNoZOrder", FALSE );
5676 flush_events();
5678
5679 /* popups don't get WM_GETMINMAXINFO */
5683 SetWindowPos( hwnd, 0, 0, 0, 200, 200, SWP_NOMOVE|SWP_NOACTIVATE );
5684 ok_sequence(WmSWP_ResizePopupSeq, "SetWindowPos:ResizePopup", FALSE );
5685
5687 ok_sequence(WmDestroyOverlappedSeq, "DestroyWindow:overlapped", FALSE);
5688
5689 /* Test if windows are correctly drawn when first shown */
5690
5691 /* Visible, redraw */
5692 flush_events();
5694 hwnd = CreateWindowExA(0, "TestWindowClass", "Test Popup", WS_POPUP | WS_VISIBLE,
5695 10, 10, 100, 100, NULL, 0, 0, NULL );
5696 ok (hwnd != 0, "Failed to create popup window\n");
5698 ok_sequence(WmShowPopupFirstDrawSeq_1, "RedrawWindow:show_popup_first_draw_visible", FALSE);
5700
5701 /* Invisible, show, message */
5702 flush_events();
5704 hwnd = CreateWindowExA(0, "TestWindowClass", "Test Popup", WS_POPUP,
5705 10, 10, 100, 100, NULL, 0, 0, NULL );
5706 ok (hwnd != 0, "Failed to create popup window\n");
5708 SendMessageW(hwnd, WM_PAINT, 0, 0);
5709 ok_sequence(WmShowPopupFirstDrawSeq_1, "RedrawWindow:show_popup_first_draw_show", FALSE);
5711
5712 /* Invisible, show maximized, redraw */
5713 flush_events();
5715 hwnd = CreateWindowExA(0, "TestWindowClass", "Test Popup", WS_POPUP,
5716 10, 10, 100, 100, NULL, 0, 0, NULL );
5717 ok (hwnd != 0, "Failed to create popup window\n");
5720 ok_sequence(WmShowPopupFirstDrawSeq_2, "RedrawWindow:show_popup_first_draw_show_maximized", FALSE);
5722
5723 /* Test SetWindowPos */
5728
5734
5741
5748
5755
5756 /* Test SetWindowPos with child windows */
5757 flush_events();
5758 hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
5759 100, 100, 200, 200, 0, 0, 0, NULL);
5760 ok (hparent != 0, "Failed to create parent window\n");
5761
5762 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
5763 0, 0, 10, 10, hparent, 0, 0, NULL);
5764 ok (hchild != 0, "Failed to create child window\n");
5766 SetWindowPos(hparent, NULL, 0, 0, 100, 100, SWP_SHOWWINDOW);
5767 ok_sequence(WmFirstDrawChildSeq1, /* Expect no messages for the child */
5768 "SetWindowPos:show_popup_first_show_window_child1", FALSE);
5769 DestroyWindow(hchild);
5770 DestroyWindow(hparent);
5771
5772 flush_events();
5773 hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN,
5774 100, 100, 200, 200, 0, 0, 0, NULL);
5775 ok (hparent != 0, "Failed to create parent window\n");
5776
5777 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
5778 0, 0, 10, 10, hparent, 0, 0, NULL);
5779 ok (hchild != 0, "Failed to create child window\n");
5781 SetWindowPos(hparent, NULL, 0, 0, 100, 100, SWP_SHOWWINDOW);
5782 ok_sequence(WmFirstDrawChildSeq2, /* Expect child to be redrawn */
5783 "SetWindowPos:show_popup_first_show_window_child2", FALSE);
5784 DestroyWindow(hchild);
5785 DestroyWindow(hparent);
5786
5787 /* Test message sequence for extreme position and size */
5788
5790 hwnd = CreateWindowExA(0, "TestWindowClass", "Test Popup", WS_POPUP | WS_VISIBLE,
5791 -10, -10, 10000, 10000, NULL, 0, 0, NULL );
5792 ok (hwnd != 0, "Failed to create popup window\n");
5793 ok_sequence(WmShowPopupExtremeLocationSeq, "RedrawWindow:show_popup_extreme_location", FALSE);
5795
5796
5797 /* Test child windows */
5798
5799 hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
5800 100, 100, 200, 200, 0, 0, 0, NULL);
5801 ok (hparent != 0, "Failed to create parent window\n");
5803
5804 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_MAXIMIZE,
5805 0, 0, 10, 10, hparent, 0, 0, NULL);
5806 ok (hchild != 0, "Failed to create child window\n");
5807 ok_sequence(WmCreateMaximizedChildSeq, "CreateWindow:maximized child", FALSE);
5808 DestroyWindow(hchild);
5810
5811 /* visible child window with a caption */
5812 hchild = CreateWindowExA(0, "TestWindowClass", "Test child",
5814 0, 0, 10, 10, hparent, 0, 0, NULL);
5815 ok (hchild != 0, "Failed to create child window\n");
5816#ifdef __REACTOS__
5818#endif
5819 ok_sequence(WmCreateVisibleChildSeq, "CreateWindow:visible child", FALSE);
5820
5821 if (winetest_debug > 1) trace("testing scroll APIs on a visible child window %p\n", hchild);
5822 test_scroll_messages(hchild);
5823
5825 ok_sequence(WmShowChildSeq_4, "SetWindowPos(SWP_SHOWWINDOW):child with a caption", FALSE);
5826
5827 DestroyWindow(hchild);
5829
5830 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
5831 0, 0, 10, 10, hparent, 0, 0, NULL);
5832 ok (hchild != 0, "Failed to create child window\n");
5833 ok_sequence(WmCreateChildSeq, "CreateWindow:child", FALSE);
5834
5835 hchild2 = CreateWindowExA(0, "SimpleWindowClass", "Test child2", WS_CHILD,
5836 100, 100, 50, 50, hparent, 0, 0, NULL);
5837 ok (hchild2 != 0, "Failed to create child2 window\n");
5839
5840 hbutton = CreateWindowExA(0, "TestWindowClass", "Test button", WS_CHILD,
5841 0, 100, 50, 50, hchild, 0, 0, NULL);
5842 ok (hbutton != 0, "Failed to create button window\n");
5843
5844 /* test WM_SETREDRAW on a not visible child window */
5845 test_WM_SETREDRAW(hchild);
5846
5847 ShowWindow(hchild, SW_SHOW);
5848 ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):child", FALSE);
5849
5850 /* check parent messages too */
5852 ShowWindow(hchild, SW_HIDE);
5853 ok_sequence(WmHideChildSeq2, "ShowWindow(SW_HIDE):child", FALSE);
5855
5856 ShowWindow(hchild, SW_SHOW);
5857 ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):child", FALSE);
5858
5859 ShowWindow(hchild, SW_HIDE);
5860 ok_sequence(WmHideChildSeq, "ShowWindow(SW_HIDE):child", FALSE);
5861
5862 ShowWindow(hchild, SW_SHOW);
5863 ok_sequence(WmShowChildSeq, "ShowWindow(SW_SHOW):child", FALSE);
5864
5865 /* test WM_SETREDRAW on a visible child window */
5866 test_WM_SETREDRAW(hchild);
5867
5869 MoveWindow(hchild, 10, 10, 20, 20, TRUE);
5872
5873 ShowWindow(hchild, SW_HIDE);
5876 ok_sequence(WmShowChildSeq_2, "SetWindowPos:show_child_2", FALSE);
5877
5878 ShowWindow(hchild, SW_HIDE);
5881 ok_sequence(WmShowChildSeq_3, "SetWindowPos:show_child_3", FALSE);
5882
5883 /* DestroyWindow sequence below expects that a child has focus */
5884 SetFocus(hchild);
5886
5887 DestroyWindow(hchild);
5888 ok_sequence(WmDestroyChildSeq, "DestroyWindow:child", FALSE);
5889 DestroyWindow(hchild2);
5890 DestroyWindow(hbutton);
5891
5893 hchild = CreateWindowExA(0, "TestWindowClass", "Test Child Popup", WS_CHILD | WS_POPUP,
5894 0, 0, 100, 100, hparent, 0, 0, NULL);
5895 ok (hchild != 0, "Failed to create child popup window\n");
5896 ok_sequence(WmCreateChildPopupSeq, "CreateWindow:child_popup", FALSE);
5897 DestroyWindow(hchild);
5898
5899 /* test what happens to a window which sets WS_VISIBLE in WM_CREATE */
5901 hchild = CreateWindowExA(0, "TestPopupClass", "Test Popup", WS_POPUP,
5902 0, 0, 100, 100, hparent, 0, 0, NULL);
5903 ok (hchild != 0, "Failed to create popup window\n");
5904 ok_sequence(WmCreateInvisiblePopupSeq, "CreateWindow:invisible_popup", FALSE);
5905 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
5906 ok(IsWindowVisible(hchild), "IsWindowVisible() should return TRUE\n");
5908 ShowWindow(hchild, SW_SHOW);
5909 ok_sequence(WmEmptySeq, "ShowWindow:show_visible_popup", FALSE);
5912 ok_sequence(WmShowVisiblePopupSeq_2, "SetWindowPos:show_visible_popup_2", FALSE);
5915 ok_sequence(WmShowVisiblePopupSeq_3, "SetWindowPos:show_visible_popup_3", FALSE);
5916 DestroyWindow(hchild);
5917
5918 /* this time add WS_VISIBLE for CreateWindowEx, but this fact actually
5919 * changes nothing in message sequences.
5920 */
5922 hchild = CreateWindowExA(0, "TestPopupClass", "Test Popup", WS_POPUP | WS_VISIBLE,
5923 0, 0, 100, 100, hparent, 0, 0, NULL);
5924 ok (hchild != 0, "Failed to create popup window\n");
5925 ok_sequence(WmCreateInvisiblePopupSeq, "CreateWindow:invisible_popup", FALSE);
5926 ok(GetWindowLongA(hchild, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
5927 ok(IsWindowVisible(hchild), "IsWindowVisible() should return TRUE\n");
5929 ShowWindow(hchild, SW_SHOW);
5930 ok_sequence(WmEmptySeq, "ShowWindow:show_visible_popup", FALSE);
5933 ok_sequence(WmShowVisiblePopupSeq_2, "SetWindowPos:show_visible_popup_2", FALSE);
5934 DestroyWindow(hchild);
5935
5938 0, 0, 100, 100, hparent, 0, 0, NULL);
5939 ok(hwnd != 0, "Failed to create custom dialog window\n");
5940 ok_sequence(WmCreateCustomDialogSeq, "CreateCustomDialog", TRUE);
5941
5942 if(0) {
5943 if (winetest_debug > 1) trace("testing scroll APIs on a visible dialog %p\n", hwnd);
5945 }
5946
5948
5949 test_def_id = TRUE;
5950 SendMessageA(hwnd, WM_NULL, 0, 0);
5951
5954 EndDialog( hwnd, 0 );
5955 ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE);
5956
5960
5961 ok(GetCursorPos(&pos), "GetCursorPos failed\n");
5962 ok(SetCursorPos(109, 109), "SetCursorPos failed\n");
5963
5964 hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP|WS_CHILD,
5965 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL);
5966 ok(hwnd != 0, "Failed to create custom dialog window\n");
5968 if (winetest_debug > 1) trace("call ShowWindow(%p, SW_SHOW)\n", hwnd);
5970 ok_sequence(WmShowCustomDialogSeq, "ShowCustomDialog", TRUE);
5971
5972 flush_events();
5974 ret = DrawMenuBar(hwnd);
5975 ok(ret, "DrawMenuBar failed: %ld\n", GetLastError());
5976 flush_events();
5977 ok_sequence(WmDrawMenuBarSeq, "DrawMenuBar", FALSE);
5978 ok(SetCursorPos(pos.x, pos.y), "SetCursorPos failed\n");
5979
5981
5982 hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_CHILD|WS_VISIBLE,
5983 0, 0, 100, 100, hparent, 0, GetModuleHandleA(0), NULL);
5984 ok(hwnd != 0, "Failed to create custom dialog window\n");
5985 flush_events();
5987 ret = DrawMenuBar(hwnd);
5988 ok(ret, "DrawMenuBar failed: %ld\n", GetLastError());
5989 flush_events();
5990 ok_sequence(WmEmptySeq, "DrawMenuBar for a child window", FALSE);
5991
5993
5995 DialogBoxA( 0, "TEST_DIALOG", hparent, TestModalDlgProcA );
5996 ok_sequence(WmModalDialogSeq, "ModalDialog", TRUE);
5997
5998 DestroyWindow(hparent);
6000
6001 /* Message sequence for SetMenu */
6002 ok(!DrawMenuBar(hwnd), "DrawMenuBar should return FALSE for a destroyed window\n");
6003 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "last error is %ld\n", GetLastError());
6004 ok_sequence(WmEmptySeq, "DrawMenuBar for a window without a menu", FALSE);
6005
6006 hmenu = CreateMenu();
6007 ok (hmenu != 0, "Failed to create menu\n");
6008 ok (InsertMenuA(hmenu, -1, MF_BYPOSITION, 0x1000, "foo"), "InsertMenu failed\n");
6009 hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
6010 100, 100, 200, 200, 0, hmenu, 0, NULL);
6011 ok_sequence(WmCreateOverlappedSeq, "CreateWindow:overlapped", FALSE);
6012 ok (SetMenu(hwnd, 0), "SetMenu\n");
6013 ok_sequence(WmSetMenuNonVisibleSizeChangeSeq, "SetMenu:NonVisibleSizeChange", FALSE);
6014 ok (SetMenu(hwnd, 0), "SetMenu\n");
6015 ok_sequence(WmSetMenuNonVisibleNoSizeChangeSeq, "SetMenu:NonVisibleNoSizeChange", FALSE);
6017 UpdateWindow( hwnd );
6018 flush_events();
6020 ok (SetMenu(hwnd, 0), "SetMenu\n");
6021 ok_sequence(WmSetMenuVisibleNoSizeChangeSeq, "SetMenu:VisibleNoSizeChange", FALSE);
6022 ok (SetMenu(hwnd, hmenu), "SetMenu\n");
6023 ok_sequence(WmSetMenuVisibleSizeChangeSeq, "SetMenu:VisibleSizeChange", FALSE);
6024
6025 UpdateWindow( hwnd );
6026 flush_events();
6028 ok(DrawMenuBar(hwnd), "DrawMenuBar\n");
6029 flush_events();
6030 ok_sequence(WmDrawMenuBarSeq, "DrawMenuBar", FALSE);
6031
6034
6035 /* Message sequence for EnableWindow */
6036 hparent = CreateWindowExA(0, "TestWindowClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
6037 100, 100, 200, 200, 0, 0, 0, NULL);
6038 ok (hparent != 0, "Failed to create parent window\n");
6039 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
6040 0, 0, 10, 10, hparent, 0, 0, NULL);
6041 ok (hchild != 0, "Failed to create child window\n");
6042
6043 SetFocus(hchild);
6044 flush_events();
6046
6047 EnableWindow(hparent, FALSE);
6048 ok_sequence(WmEnableWindowSeq_1, "EnableWindow(FALSE)", FALSE);
6049
6050 EnableWindow(hparent, FALSE);
6051 ok_sequence(WmEnableWindowSeq_2, "EnableWindow(FALSE)", FALSE);
6052
6053 EnableWindow(hparent, TRUE);
6054 ok_sequence(WmEnableWindowSeq_3, "EnableWindow(TRUE)", FALSE);
6055
6056 EnableWindow(hparent, TRUE);
6057 ok_sequence(WmEnableWindowSeq_4, "EnableWindow(TRUE)", FALSE);
6058
6059 flush_events();
6061
6063 test_WM_DEVICECHANGE(hparent);
6064
6065 /* the following test causes an exception in user.exe under win9x */
6066 if (!PostMessageW( hparent, WM_USER, 0, 0 ))
6067 {
6068 DestroyWindow(hparent);
6070 return;
6071 }
6072 PostMessageW( hparent, WM_USER+1, 0, 0 );
6073 /* PeekMessage(NULL) fails, but still removes the message */
6074 SetLastError(0xdeadbeef);
6075 ok( !PeekMessageW( NULL, 0, 0, 0, PM_REMOVE ), "PeekMessage(NULL) should fail\n" );
6076 ok( GetLastError() == ERROR_NOACCESS || /* Win2k */
6077 GetLastError() == 0xdeadbeef, /* NT4 */
6078 "last error is %ld\n", GetLastError() );
6079 ok( PeekMessageW( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n" );
6080 ok( msg.message == WM_USER+1, "got %x instead of WM_USER+1\n", msg.message );
6081
6082 DestroyWindow(hchild);
6083 DestroyWindow(hparent);
6085
6086 /* Message sequences for WM_SETICON */
6087 if (winetest_debug > 1) trace("testing WM_SETICON\n");
6088 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
6089 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
6090 NULL, NULL, 0);
6093 flush_events();
6096 ok_sequence(WmSetIcon_1, "WM_SETICON for shown window with caption", FALSE);
6097
6099 flush_events();
6102 ok_sequence(WmSetIcon_2, "WM_SETICON for hidden window with caption", FALSE);
6105
6106 hwnd = CreateWindowExA(0, "TestPopupClass", NULL, WS_POPUP,
6107 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
6108 NULL, NULL, 0);
6111 flush_events();
6114 ok_sequence(WmSetIcon_2, "WM_SETICON for shown window without caption", FALSE);
6115
6117 flush_events();
6120 ok_sequence(WmSetIcon_2, "WM_SETICON for hidden window without caption", FALSE);
6121
6123 res = SendMessageA(hwnd, 0x3B, 0x8000000b, 0);
6124 if (!res)
6125 {
6126 todo_wine win_skip( "Message 0x3b not supported\n" );
6127 goto done;
6128 }
6129 ok_sequence(WmInitEndSession, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x8000000b", TRUE);
6130 ok(res == 1, "SendMessage(hwnd, 0x3B, 0x8000000b, 0) should have returned 1 instead of %Id\n", res);
6131 res = SendMessageA(hwnd, 0x3B, 0x0000000b, 0);
6132 ok_sequence(WmInitEndSession_2, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x0000000b", TRUE);
6133 ok(res == 1, "SendMessage(hwnd, 0x3B, 0x0000000b, 0) should have returned 1 instead of %Id\n", res);
6134 res = SendMessageA(hwnd, 0x3B, 0x0000000f, 0);
6135 ok_sequence(WmInitEndSession_2, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x0000000f", TRUE);
6136 ok(res == 1, "SendMessage(hwnd, 0x3B, 0x0000000f, 0) should have returned 1 instead of %Id\n", res);
6137
6139 res = SendMessageA(hwnd, 0x3B, 0x80000008, 0);
6140 ok_sequence(WmInitEndSession_3, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000008", TRUE);
6141 ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000008, 0) should have returned 2 instead of %Id\n", res);
6142 res = SendMessageA(hwnd, 0x3B, 0x00000008, 0);
6143 ok_sequence(WmInitEndSession_4, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x00000008", TRUE);
6144 ok(res == 2, "SendMessage(hwnd, 0x3B, 0x00000008, 0) should have returned 2 instead of %Id\n", res);
6145
6146 res = SendMessageA(hwnd, 0x3B, 0x80000004, 0);
6147 ok_sequence(WmInitEndSession_3, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000004", TRUE);
6148 ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000004, 0) should have returned 2 instead of %Id\n", res);
6149
6150 res = SendMessageA(hwnd, 0x3B, 0x80000001, 0);
6151 ok_sequence(WmInitEndSession_5, "Handling of undocumented 0x3B message by DefWindowProc wparam=0x80000001", TRUE);
6152 ok(res == 2, "SendMessage(hwnd, 0x3B, 0x80000001, 0) should have returned 2 instead of %Id\n", res);
6153
6154done:
6157}
static const struct message WmDestroyOverlappedSeq[]
Definition: msg.c:722
static const struct message WmSetMenuNonVisibleNoSizeChangeSeq[]
Definition: msg.c:1936
static const struct message WmSWP_MoveSeq[]
Definition: msg.c:302
static const struct message WmFirstDrawSetWindowPosSeq4[]
Definition: msg.c:1338
static const struct message WmFirstDrawChildSeq2[]
Definition: msg.c:1419
static const struct message WmShowVisiblePopupSeq_2[]
Definition: msg.c:1110
static const struct message WmCreateChildPopupSeq[]
Definition: msg.c:1082
static const struct message WmInitEndSession_4[]
Definition: msg.c:5350
static const struct message WmInitEndSession[]
Definition: msg.c:5329
static const struct message WmDrawMenuBarSeq[]
Definition: msg.c:1986
static void test_WM_SETREDRAW(HWND hwnd)
Definition: msg.c:4765
static const struct message WmShowRestoreMaxOverlappedSeq[]
Definition: msg.c:563
static const struct message WmSetMenuNonVisibleSizeChangeSeq[]
Definition: msg.c:1921
static void test_MsgWaitForMultipleObjects(HWND hwnd)
Definition: msg.c:5403
static const struct message WmShowChildSeq_2[]
Definition: msg.c:1512
static const struct message WmSWP_ResizePopupSeq[]
Definition: msg.c:282
static INT_PTR CALLBACK TestModalDlgProcA(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:4792
static DWORD CALLBACK show_window_thread(LPVOID arg)
Definition: msg.c:5528
static BOOL test_def_id
Definition: msg.c:2336
static const struct message WmShowRestoreMinOverlappedSeq[]
Definition: msg.c:588
static const struct message WmShowChildSeq_4[]
Definition: msg.c:1531
#define test_msg_setpos(expected_list, flags, todo)
Definition: msg.c:5539
static const struct message WmSWP_ShowOverlappedSeq[]
Definition: msg.c:203
static const struct message WmEnableWindowSeq_3[]
Definition: msg.c:2033
static const struct message WmInitEndSession_2[]
Definition: msg.c:5336
static const struct message WmInitEndSession_3[]
Definition: msg.c:5343
static const struct message WmSetIcon_2[]
Definition: msg.c:5323
static const struct message WmSWP_ResizeNoZOrder[]
Definition: msg.c:316
static const struct message WmCreateInvisiblePopupSeq[]
Definition: msg.c:1095
static const struct message WmFirstDrawChildSeq1[]
Definition: msg.c:1414
static const struct message WmFirstDrawSetWindowPosSeq1[]
Definition: msg.c:1257
static const struct message WmFirstDrawSetWindowPosSeq3[]
Definition: msg.c:1317
static const struct message WmShowChildSeq_3[]
Definition: msg.c:1522
static void test_scroll_messages(HWND hwnd)
Definition: msg.c:4950
static const struct message WmFirstDrawSetWindowPosSeq5[]
Definition: msg.c:1367
static const struct message WmShowMaxOverlappedSeq[]
Definition: msg.c:521
static const struct message WmCreateMaximizedChildSeq[]
Definition: msg.c:1443
static void test_WM_DEVICECHANGE(HWND hwnd)
Definition: msg.c:5477
static const struct message WmResizingChildWithMoveWindowSeq[]
Definition: msg.c:1680
static const struct message WmShowCustomDialogSeq[]
Definition: msg.c:1776
static const struct message WmFirstDrawSetWindowPosSeq6[]
Definition: msg.c:1394
static const struct message WmOptionalPaint[]
Definition: msg.c:5363
static const struct message WmShowPopupExtremeLocationSeq[]
Definition: msg.c:1138
static BOOL after_end_dialog
Definition: msg.c:2336
static const struct message WmEnableWindowSeq_1[]
Definition: msg.c:2016
static const struct message WmCreateCustomDialogSeq[]
Definition: msg.c:1692
static const struct message WmShowPopupFirstDrawSeq_2[]
Definition: msg.c:1215
static const struct message WmShowMinOverlappedSeq[]
Definition: msg.c:645
static const struct message WmSetIcon_1[]
Definition: msg.c:5314
static const struct message WmModalDialogSeq[]
Definition: msg.c:1805
static const struct message WmHideOverlappedSeq[]
Definition: msg.c:704
static const struct message WmFirstDrawSetWindowPosSeq2[]
Definition: msg.c:1288
static const struct message WmSetMenuVisibleSizeChangeSeq[]
Definition: msg.c:1944
static const struct message WmInitEndSession_5[]
Definition: msg.c:5357
static const struct message WmShowVisiblePopupSeq_3[]
Definition: msg.c:1117
static const struct message WmEnableWindowSeq_4[]
Definition: msg.c:2040
static const struct message WmEndCustomDialogSeq[]
Definition: msg.c:1751
static DWORD CALLBACK hide_window_thread(LPVOID arg)
Definition: msg.c:5518
static const struct message WmCreateOverlappedSeq[]
Definition: msg.c:188
static const struct message WmShowOverlappedSeq[]
Definition: msg.c:476
static const struct message WmDestroyChildSeq[]
Definition: msg.c:1639
static const struct message WmEnableWindowSeq_2[]
Definition: msg.c:2026
static const struct message WmSetMenuVisibleNoSizeChangeSeq[]
Definition: msg.c:1974
static const struct message WmCreateVisibleChildSeq[]
Definition: msg.c:1462
static const struct message WmShowPopupFirstDrawSeq_1[]
Definition: msg.c:1179
static const struct message WmSWP_HideOverlappedSeq[]
Definition: msg.c:246
static const struct message WmSWP_ResizeSeq[]
Definition: msg.c:261
static const struct message WmHideChildSeq2[]
Definition: msg.c:1501
#define WS_MINIMIZE
Definition: pedump.c:622
#define ICON_SMALL
Definition: tnclass.cpp:48
#define ERROR_NOACCESS
Definition: winerror.h:902
#define RDW_UPDATENOW
Definition: winuser.h:1231
BOOL WINAPI InsertMenuA(_In_ HMENU, _In_ UINT, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
#define IDI_APPLICATION
Definition: winuser.h:712
BOOL WINAPI DrawMenuBar(_In_ HWND)
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE hInstance, _In_ LPCSTR lpIconName)
Definition: cursoricon.c:2429
#define MF_BYPOSITION
Definition: winuser.h:203
#define WM_NULL
Definition: winuser.h:1635
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by START_TEST().

◆ test_msg_setpos_()

static void test_msg_setpos_ ( const struct message expected_list,
UINT  flags,
BOOL  todo,
const char file,
int  line 
)
static

Definition at line 5541 of file msg.c.

5542{
5543 HWND hwnd;
5544
5545 flush_events();
5547 hwnd = CreateWindowExA(0, "TestWindowClass", "Test Popup", WS_POPUP,
5548 10, 10, 100, 100, NULL, 0, 0, NULL );
5549 ok (hwnd != 0, "Failed to create popup window\n");
5550 SetWindowPos(hwnd, NULL, 0, 0, 100, 100, flags);
5551 ok_sequence_(expected_list, "SetWindowPos:show_popup_first_show_window", todo, file, line);
5553}
static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo, const char *file, int line)
Definition: msg.c:2802

◆ test_MsgWaitForMultipleObjects()

static void test_MsgWaitForMultipleObjects ( HWND  hwnd)
static

Definition at line 5403 of file msg.c.

5404{
5405 DWORD ret;
5406 MSG msg;
5407
5409 ok(ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %lx\n", ret);
5410
5411 PostMessageA(hwnd, WM_USER, 0, 0);
5412
5414 ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjects returned %lx\n", ret);
5415
5416 ok(PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
5417 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5418
5420 ok(ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %lx\n", ret);
5421
5422 PostMessageA(hwnd, WM_USER, 0, 0);
5423
5425 ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjects returned %lx\n", ret);
5426
5427 ok(PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ), "PeekMessage should succeed\n");
5428 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5429
5430 /* shows QS_POSTMESSAGE flag is cleared in the PeekMessage call */
5432 ok(ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjects returned %lx\n", ret);
5433
5434 PostMessageA(hwnd, WM_USER, 0, 0);
5435
5436 /* new incoming message causes it to become signaled again */
5438 ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjects returned %lx\n", ret);
5439
5440 ok(PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
5441 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5442 ok(PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
5443 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5444
5445 /* MWMO_INPUTAVAILABLE should succeed even if the message was already seen */
5446 PostMessageA( hwnd, WM_USER, 0, 0 );
5447 ok(PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ), "PeekMessage should succeed\n");
5448 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5449
5451 ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjectsEx returned %lx\n", ret);
5452
5453 ok(PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
5454 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5455
5456 /* without MWMO_ALERTABLE the result is never WAIT_IO_COMPLETION */
5458 ok(ret, "QueueUserAPC failed %lu\n", GetLastError());
5459
5461 ok(ret == WAIT_TIMEOUT, "MsgWaitForMultipleObjectsEx returned %lx\n", ret);
5462
5463 /* but even with MWMO_ALERTABLE window events are preferred */
5464 PostMessageA( hwnd, WM_USER, 0, 0 );
5465
5467 ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjectsEx returned %lx\n", ret);
5468
5469 ok(PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ), "PeekMessage should succeed\n");
5470 ok(msg.message == WM_USER, "got %04x instead of WM_USER\n", msg.message);
5471
5472 /* the APC call is still queued */
5474 ok(ret == WAIT_IO_COMPLETION, "MsgWaitForMultipleObjectsEx returned %lx\n", ret);
5475}
DWORD WINAPI QueueUserAPC(IN PAPCFUNC pfnAPC, IN HANDLE hThread, IN ULONG_PTR dwData)
Definition: thread.c:959
static void CALLBACK apc_test_proc(ULONG_PTR param)
Definition: msg.c:5398
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1146
#define WAIT_IO_COMPLETION
Definition: winbase.h:388
#define MWMO_ALERTABLE
Definition: winuser.h:920
#define MWMO_INPUTAVAILABLE
Definition: winuser.h:921
DWORD WINAPI MsgWaitForMultipleObjectsEx(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask, _In_ DWORD dwFlags)

Referenced by test_messages().

◆ test_notify_message()

static void test_notify_message ( void  )
static

Definition at line 14762 of file msg.c.

14763{
14764 HWND hwnd;
14765 BOOL ret;
14766 MSG msg;
14767
14768 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
14769 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0, NULL, NULL, 0);
14770 ok(hwnd != 0, "Failed to create window\n");
14771 flush_events();
14773
14774 ret = SendNotifyMessageA(hwnd, WM_NOTIFY, 0x1234, 0xdeadbeef);
14775 ok(ret == TRUE, "SendNotifyMessageA failed with error %lu\n", GetLastError());
14776 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14777
14778 ret = SendNotifyMessageW(hwnd, WM_NOTIFY, 0x1234, 0xdeadbeef);
14779 ok(ret == TRUE, "SendNotifyMessageW failed with error %lu\n", GetLastError());
14780 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14781
14782 ret = SendMessageCallbackA(hwnd, WM_NOTIFY, 0x1234, 0xdeadbeef, NULL, 0);
14783 ok(ret == TRUE, "SendMessageCallbackA failed with error %lu\n", GetLastError());
14784 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14785
14786 ret = SendMessageCallbackW(hwnd, WM_NOTIFY, 0x1234, 0xdeadbeef, NULL, 0);
14787 ok(ret == TRUE, "SendMessageCallbackW failed with error %lu\n", GetLastError());
14788 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14789
14790 ret = PostMessageA(hwnd, WM_NOTIFY, 0x1234, 0xdeadbeef);
14791 ok(ret == TRUE, "PostMessageA failed with error %lu\n", GetLastError());
14792 flush_events();
14793 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14794
14795 ret = PostMessageW(hwnd, WM_NOTIFY, 0x1234, 0xdeadbeef);
14796 ok(ret == TRUE, "PostMessageW failed with error %lu\n", GetLastError());
14797 flush_events();
14798 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14799
14800 ret = PostThreadMessageA(GetCurrentThreadId(), WM_NOTIFY, 0x1234, 0xdeadbeef);
14801 ok(ret == TRUE, "PostThreadMessageA failed with error %lu\n", GetLastError());
14802 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
14803 {
14804 msg.hwnd = hwnd;
14806 }
14807 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14808
14809 ret = PostThreadMessageW(GetCurrentThreadId(), WM_NOTIFY, 0x1234, 0xdeadbeef);
14810 ok(ret == TRUE, "PostThreadMessageW failed with error %lu\n", GetLastError());
14811 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
14812 {
14813 msg.hwnd = hwnd;
14815 }
14816 ok_sequence(WmNotifySeq, "WmNotifySeq", FALSE);
14817
14819}
static const struct message WmNotifySeq[]
Definition: msg.c:14757
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by START_TEST().

◆ test_nullCallback()

static void test_nullCallback ( void  )
static

Definition at line 16328 of file msg.c.

16329{
16330 HWND hwnd;
16331
16332 hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
16333 100, 100, 200, 200, 0, 0, 0, NULL);
16334 ok (hwnd != 0, "Failed to create overlapped window\n");
16335
16337 flush_events();
16339}

Referenced by START_TEST().

◆ test_paint_messages()

static void test_paint_messages ( void  )
static

Definition at line 8487 of file msg.c.

8488{
8489 BOOL ret;
8490 RECT rect, rect2;
8491 DWORD style;
8492 POINT pt;
8493 MSG msg;
8494 HWND hparent, hchild;
8495 HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
8496 HRGN hrgn2 = CreateRectRgn( 0, 0, 0, 0 );
8497 HWND hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
8498 100, 100, 200, 200, 0, 0, 0, NULL);
8499 ok (hwnd != 0, "Failed to create overlapped window\n");
8500
8502 UpdateWindow( hwnd );
8503 flush_events();
8505
8506 check_update_rgn( hwnd, 0 );
8507 SetRectRgn( hrgn, 10, 10, 20, 20 );
8509 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8511 SetRectRgn( hrgn2, 20, 20, 30, 30 );
8513 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8516 /* validate everything */
8518 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8519 check_update_rgn( hwnd, 0 );
8520
8521 /* test empty region */
8522 SetRectRgn( hrgn, 10, 10, 10, 15 );
8524 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8525 check_update_rgn( hwnd, 0 );
8526 /* test empty rect */
8527 SetRect( &rect, 10, 10, 10, 15 );
8529 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8530 check_update_rgn( hwnd, 0 );
8531
8532 /* test a zeroed rectangle */
8534 SetRect( &rect, 0, 0, 0, 0 );
8536 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8537 check_update_rgn( hwnd, 0 );
8538
8539 /* a well ordered rectangle */
8541 SetRect( &rect, 10, 5, 17, 21 );
8543 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8544 SetRectRgn( hrgn, 10, 5, 17, 21 );
8546
8547 /* empty rectangle, top and bottom are swapped but left and right have
8548 the same value */
8550 SetRect( &rect, 5, 30, 5, 10 );
8552 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8553 check_update_rgn( hwnd, 0 );
8554
8555 /* empty rectangle, left and right are swapped but top and bottom have
8556 the same value */
8558 SetRect( &rect, 17, 10, 5, 10 );
8560 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8561 check_update_rgn( hwnd, 0 );
8562
8563 /* Left and right are swapped */
8565 SetRect( &rect, 21, 12, 7, 30 );
8567 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8568 SetRectRgn( hrgn, 7, 12, 21, 30 );
8570
8571 /* Top and bottom are swapped */
8573 SetRect( &rect, 7, 30, 21, 12 );
8575 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8576 SetRectRgn( hrgn, 7, 12, 21, 30 );
8578
8579 /* both reference points are swapped */
8581 SetRect( &rect, 21, 30, 7, 12 );
8583 ok(ret, "RedrawWindow returned %d instead of TRUE\n", ret);
8584 SetRectRgn( hrgn, 7, 12, 21, 30 );
8586
8587 /* flush pending messages */
8588 flush_events();
8590
8591 GetClientRect( hwnd, &rect );
8592 SetRectRgn( hrgn, 0, 0, rect.right - rect.left, rect.bottom - rect.top );
8593 /* MSDN: if hwnd parameter is NULL, InvalidateRect invalidates and redraws
8594 * all windows and sends WM_ERASEBKGND and WM_NCPAINT.
8595 */
8596 SetRectEmpty( &rect );
8597 ok(InvalidateRect(0, &rect, FALSE), "InvalidateRect(0, &rc, FALSE) failed\n");
8599 ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8600 flush_events();
8601 ok_sequence( WmPaint, "Paint", FALSE );
8603 check_update_rgn( hwnd, 0 );
8604
8605 SetRectEmpty( &rect );
8607 "RedrawWindow failed\n");
8608 check_update_rgn( hwnd, 0 );
8609
8610 SetRectEmpty( &rect );
8612 "RedrawWindow failed\n");
8613 check_update_rgn( hwnd, 0 );
8614
8615 GetWindowRect( hwnd, &rect );
8617 "RedrawWindow failed\n");
8618 check_update_rgn( hwnd, 0 );
8619
8620 flush_events();
8622 "RedrawWindow failed\n");
8624 ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8625 flush_events();
8626 ok_sequence( WmPaint, "Paint", FALSE );
8628 check_update_rgn( hwnd, 0 );
8629
8632 "RedrawWindow failed\n");
8634 ok( ret == NULLREGION || broken(ret == SIMPLEREGION), /* <= win7 */
8635 "region should be null (%d)\n", ret );
8636 if (ret == SIMPLEREGION) ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8638 flush_events();
8639
8642 "RedrawWindow failed\n");
8644 ok( ret == NULLREGION || broken(ret == SIMPLEREGION), /* <= win7 */
8645 "region should be null (%d)\n", ret );
8646 if (ret == SIMPLEREGION) ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8648 flush_events();
8649
8650 SetRectRgn( hrgn2, rect.left, rect.top, rect.right, rect.bottom );
8652 "RedrawWindow failed\n");
8654 ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8655 flush_events();
8656 ok_sequence( WmPaint, "Paint", FALSE );
8658 check_update_rgn( hwnd, 0 );
8659
8661 "RedrawWindow failed\n");
8662 check_update_rgn( hwnd, 0 );
8663
8665 "RedrawWindow failed\n");
8667 ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8668 flush_events();
8669 ok_sequence( WmPaint, "Paint", FALSE );
8671 check_update_rgn( hwnd, 0 );
8672
8673 /* MSDN: if hwnd parameter is NULL, ValidateRect invalidates and redraws
8674 * all windows and sends WM_ERASEBKGND and WM_NCPAINT.
8675 */
8676 SetRectEmpty( &rect );
8677 if (ValidateRect(0, &rect) && /* not supported on Win9x */
8678 GetUpdateRect(hwnd, NULL, FALSE)) /* or >= Win 8 */
8679 {
8681 ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8682 flush_events();
8683 ok_sequence( WmPaint, "Paint", FALSE );
8685 check_update_rgn( hwnd, 0 );
8686 }
8687
8688 SetLastError(0xdeadbeef);
8689 ok(!InvalidateRgn(0, NULL, FALSE), "InvalidateRgn(0, NULL, FALSE) should fail\n");
8691 "wrong error code %ld\n", GetLastError());
8692 check_update_rgn( hwnd, 0 );
8693 flush_events();
8694 ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
8695
8696 SetLastError(0xdeadbeef);
8697 ok(!ValidateRgn(0, NULL), "ValidateRgn(0, NULL) should fail\n");
8699 broken( GetLastError() == 0xdeadbeef ) /* win9x */,
8700 "wrong error code %ld\n", GetLastError());
8701 check_update_rgn( hwnd, 0 );
8702 flush_events();
8703 ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
8704
8705 SetLastError(0xdeadbeef);
8706 ok(!UpdateWindow(NULL), "UpdateWindow(NULL) should fail\n");
8708 broken( GetLastError() == 0xdeadbeef ) /* win9x */,
8709 "wrong error code %ld\n", GetLastError());
8710 check_update_rgn( hwnd, 0 );
8711 flush_events();
8712 ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
8713
8714 /* now with frame */
8715 SetRectRgn( hrgn, -5, -5, 20, 20 );
8716
8717 /* flush pending messages */
8718 flush_events();
8721 ok_sequence( WmEmptySeq, "EmptySeq", FALSE );
8722
8723 SetRectRgn( hrgn, 0, 0, 20, 20 ); /* GetUpdateRgn clips to client area */
8725
8728 ok_sequence( WmInvalidateRgn, "InvalidateRgn", FALSE );
8729
8732 ok_sequence( WmInvalidateFull, "InvalidateFull", FALSE );
8733
8734 GetClientRect( hwnd, &rect );
8735 SetRectRgn( hrgn, rect.left, rect.top, rect.right, rect.bottom );
8737
8740 ok_sequence( WmInvalidateErase, "InvalidateErase", FALSE );
8741
8744 ok_sequence( WmInvalidatePaint, "InvalidatePaint", FALSE );
8745 check_update_rgn( hwnd, 0 );
8746
8749 ok_sequence( WmInvalidateErasePaint, "InvalidateErasePaint", FALSE );
8750 check_update_rgn( hwnd, 0 );
8751
8753 SetRectRgn( hrgn, 0, 0, 100, 100 );
8755 SetRectRgn( hrgn, 0, 0, 50, 100 );
8757 SetRectRgn( hrgn, 50, 0, 100, 100 );
8760 ok_sequence( WmEmptySeq, "EmptySeq", FALSE ); /* must not generate messages, everything is valid */
8761 check_update_rgn( hwnd, 0 );
8762
8764 SetRectRgn( hrgn, 0, 0, 100, 100 );
8766 SetRectRgn( hrgn, 0, 0, 100, 50 );
8768 ok_sequence( WmErase, "Erase", FALSE );
8769 SetRectRgn( hrgn, 0, 50, 100, 100 );
8771
8773 SetRectRgn( hrgn, 0, 0, 100, 100 );
8775 SetRectRgn( hrgn, 0, 0, 50, 50 );
8777 ok_sequence( WmPaint, "Paint", FALSE );
8778
8780 SetRectRgn( hrgn, -4, -4, -2, -2 );
8782 SetRectRgn( hrgn, -200, -200, -198, -198 );
8784 ok_sequence( WmEmptySeq, "EmptySeq", FALSE );
8785
8787 SetRectRgn( hrgn, -4, -4, -2, -2 );
8789 SetRectRgn( hrgn, -4, -4, -3, -3 );
8791 SetRectRgn( hrgn, 0, 0, 1, 1 );
8793 ok_sequence( WmPaint, "Paint", FALSE );
8794
8796 SetRectRgn( hrgn, -4, -4, -1, -1 );
8799 /* make sure no WM_PAINT was generated */
8800 flush_events();
8801 ok_sequence( WmInvalidateRgn, "InvalidateRgn", FALSE );
8802
8804 SetRectRgn( hrgn, -4, -4, -1, -1 );
8806 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
8807 {
8808 if (msg.hwnd == hwnd && msg.message == WM_PAINT)
8809 {
8810 /* GetUpdateRgn must return empty region since only nonclient area is invalidated */
8812 ok( ret == NULLREGION, "Invalid GetUpdateRgn result %d\n", ret );
8814 ok( ret, "Invalid GetUpdateRect result %d\n", ret );
8815 /* this will send WM_NCPAINT and validate the non client area */
8816 ret = GetUpdateRect( hwnd, &rect, TRUE );
8817 ok( !ret, "Invalid GetUpdateRect result %d\n", ret );
8818 }
8820 }
8821 ok_sequence( WmGetUpdateRect, "GetUpdateRect", FALSE );
8822
8824
8825 /* now test with a child window */
8826
8827 hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW,
8828 100, 100, 200, 200, 0, 0, 0, NULL);
8829 ok (hparent != 0, "Failed to create parent window\n");
8830
8831 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE | WS_BORDER,
8832 10, 10, 100, 100, hparent, 0, 0, NULL);
8833 ok (hchild != 0, "Failed to create child window\n");
8834
8835 ShowWindow( hparent, SW_SHOW );
8836 UpdateWindow( hparent );
8837 UpdateWindow( hchild );
8838 flush_events();
8841
8842 SetRect( &rect, 0, 0, 50, 50 );
8843 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8845 ok_sequence( WmInvalidateParentChild, "InvalidateParentChild", FALSE );
8846
8847 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8848 pt.x = pt.y = 0;
8849 MapWindowPoints( hchild, hparent, &pt, 1 );
8850 SetRectRgn( hrgn, 0, 0, 50 - pt.x, 50 - pt.y );
8851 check_update_rgn( hchild, hrgn );
8852 SetRectRgn( hrgn, 0, 0, 50, 50 );
8853 check_update_rgn( hparent, hrgn );
8854 RedrawWindow( hparent, NULL, 0, RDW_ERASENOW );
8855 ok_sequence( WmInvalidateParent, "InvalidateParent", FALSE );
8856 RedrawWindow( hchild, NULL, 0, RDW_ERASENOW );
8857 ok_sequence( WmEmptySeq, "EraseNow child", FALSE );
8858
8859 flush_events();
8860 ok_sequence( WmParentPaintNc, "WmParentPaintNc", FALSE );
8861
8863 RedrawWindow( hparent, NULL, 0, RDW_ERASENOW );
8864 ok_sequence( WmInvalidateParent, "InvalidateParent2", FALSE );
8865 RedrawWindow( hchild, NULL, 0, RDW_ERASENOW );
8866 ok_sequence( WmEmptySeq, "EraseNow child", FALSE );
8867
8868 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE );
8870 ok_sequence( WmInvalidateParentChild2, "InvalidateParentChild2", FALSE );
8871
8875 RedrawWindow( hparent, NULL, 0, RDW_ERASENOW );
8876 ok_sequence( WmInvalidateParentChild, "InvalidateParentChild3", FALSE );
8877
8878 /* flush all paint messages */
8879 flush_events();
8881
8882 /* RDW_UPDATENOW on child with WS_CLIPCHILDREN doesn't change corresponding parent area */
8884 SetRectRgn( hrgn, 0, 0, 50, 50 );
8885 check_update_rgn( hparent, hrgn );
8886 RedrawWindow( hchild, NULL, 0, RDW_UPDATENOW );
8887 ok_sequence( WmInvalidateErasePaint2, "WmInvalidateErasePaint2", FALSE );
8888 SetRectRgn( hrgn, 0, 0, 50, 50 );
8889 check_update_rgn( hparent, hrgn );
8890
8891 /* flush all paint messages */
8892 flush_events();
8895
8896 /* RDW_UPDATENOW on child without WS_CLIPCHILDREN will validate corresponding parent area */
8897 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8898 SetRectRgn( hrgn, 0, 0, 50, 50 );
8899 check_update_rgn( hparent, hrgn );
8900 RedrawWindow( hchild, NULL, 0, RDW_UPDATENOW );
8901 ok_sequence( WmInvalidateErasePaint2, "WmInvalidateErasePaint2", FALSE );
8902 SetRectRgn( hrgn2, 10, 10, 50, 50 );
8904 check_update_rgn( hparent, hrgn );
8905 /* flush all paint messages */
8906 flush_events();
8908
8909 /* same as above but parent gets completely validated */
8910 SetRect( &rect, 20, 20, 30, 30 );
8911 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8912 SetRectRgn( hrgn, 20, 20, 30, 30 );
8913 check_update_rgn( hparent, hrgn );
8914 RedrawWindow( hchild, NULL, 0, RDW_UPDATENOW );
8915 ok_sequence( WmInvalidateErasePaint2, "WmInvalidateErasePaint2", FALSE );
8916 check_update_rgn( hparent, 0 ); /* no update region */
8917 flush_events();
8918 ok_sequence( WmEmptySeq, "WmEmpty", FALSE ); /* and no paint messages */
8919
8920 /* make sure RDW_VALIDATE on child doesn't have the same effect */
8922 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8923 SetRectRgn( hrgn, 20, 20, 30, 30 );
8924 check_update_rgn( hparent, hrgn );
8925 RedrawWindow( hchild, NULL, 0, RDW_VALIDATE | RDW_NOERASE );
8926 SetRectRgn( hrgn, 20, 20, 30, 30 );
8927 check_update_rgn( hparent, hrgn );
8928
8929 /* same as above but normal WM_PAINT doesn't validate parent */
8931 SetRect( &rect, 20, 20, 30, 30 );
8932 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8933 SetRectRgn( hrgn, 20, 20, 30, 30 );
8934 check_update_rgn( hparent, hrgn );
8935 /* no WM_PAINT in child while parent still pending */
8936 while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8937 ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE );
8938 while (PeekMessageA( &msg, hparent, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8939 ok_sequence( WmParentErasePaint, "WmParentErasePaint", FALSE );
8940
8942 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME );
8943 /* no WM_PAINT in child while parent still pending */
8944 while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8945 ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE );
8947 /* now that parent is valid child should get WM_PAINT */
8948 while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8949 ok_sequence( WmInvalidateErasePaint2, "WmInvalidateErasePaint2", FALSE );
8950 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8951 ok_sequence( WmEmptySeq, "No other message", FALSE );
8952
8953 /* same thing with WS_CLIPCHILDREN in parent */
8956 ok_sequence( WmSetParentStyle, "WmSetParentStyle", FALSE );
8957 /* changing style invalidates non client area, but we need to invalidate something else to see it */
8958 RedrawWindow( hparent, &rect, 0, RDW_UPDATENOW );
8959 ok_sequence( WmEmptySeq, "No message", FALSE );
8960 RedrawWindow( hparent, &rect, 0, RDW_INVALIDATE | RDW_UPDATENOW );
8961 ok_sequence( WmParentOnlyNcPaint, "WmParentOnlyNcPaint", FALSE );
8962
8965 SetRectRgn( hrgn, 20, 20, 30, 30 );
8966 check_update_rgn( hparent, hrgn );
8967 /* no WM_PAINT in child while parent still pending */
8968 while (PeekMessageA( &msg, hchild, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8969 ok_sequence( WmEmptySeq, "No WM_PAINT", FALSE );
8970 /* WM_PAINT in parent first */
8971 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
8972 ok_sequence( WmParentPaintNc, "WmParentPaintNc2", FALSE );
8973
8974 /* no RDW_ERASE in parent still causes RDW_ERASE and RDW_FRAME in child */
8976 SetRect( &rect, 0, 0, 30, 30 );
8978 SetRectRgn( hrgn, 0, 0, 30, 30 );
8979 check_update_rgn( hparent, hrgn );
8980 flush_events();
8981 ok_sequence( WmParentPaintNc, "WmParentPaintNc3", FALSE );
8982
8983 /* validate doesn't cause RDW_NOERASE or RDW_NOFRAME in child */
8985 SetRect( &rect, -10, 0, 30, 30 );
8987 SetRect( &rect, 0, 0, 20, 20 );
8988 RedrawWindow( hparent, &rect, 0, RDW_VALIDATE | RDW_ALLCHILDREN );
8989 RedrawWindow( hparent, NULL, 0, RDW_UPDATENOW );
8990 ok_sequence( WmChildPaintNc, "WmChildPaintNc", FALSE );
8991
8992 /* validate doesn't cause RDW_NOERASE or RDW_NOFRAME in child */
8994 SetRect( &rect, -10, 0, 30, 30 );
8996 SetRect( &rect, 0, 0, 100, 100 );
8997 RedrawWindow( hparent, &rect, 0, RDW_VALIDATE | RDW_ALLCHILDREN );
8998 RedrawWindow( hparent, NULL, 0, RDW_UPDATENOW );
8999 ok_sequence( WmEmptySeq, "WmChildPaintNc2", FALSE );
9000 RedrawWindow( hparent, NULL, 0, RDW_ERASENOW );
9001 ok_sequence( WmEmptySeq, "WmChildPaintNc3", FALSE );
9002
9003 /* WS_CLIPCHILDREN doesn't exclude children from update region */
9006 GetClientRect( hparent, &rect );
9007 SetRectRgn( hrgn, rect.left, rect.top, rect.right, rect.bottom );
9008 check_update_rgn( hparent, hrgn );
9009 flush_events();
9010
9012 GetClientRect( hparent, &rect );
9013 SetRectRgn( hrgn, rect.left, rect.top, rect.right, rect.bottom );
9014 check_update_rgn( hparent, hrgn );
9015 flush_events();
9016
9017 /* test RDW_INTERNALPAINT behavior */
9018
9021 flush_events();
9022 ok_sequence( WmParentOnlyPaint, "WmParentOnlyPaint", FALSE );
9023
9025 flush_events();
9026 ok_sequence( WmParentPaint, "WmParentPaint", FALSE );
9027
9028 RedrawWindow( hparent, NULL, 0, RDW_INTERNALPAINT );
9029 flush_events();
9030 ok_sequence( WmParentOnlyPaint, "WmParentOnlyPaint", FALSE );
9031
9032 style = GetWindowLongA(hparent, GWL_STYLE);
9033 ok(style & WS_CLIPCHILDREN, "Got unexpected style %#lx.\n", style);
9034 UpdateWindow( hparent );
9035 flush_events();
9037 if (winetest_debug > 1) trace("testing SWP_FRAMECHANGED on parent with WS_CLIPCHILDREN\n");
9039 SetWindowPos( hparent, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
9041 flush_events();
9042 ok_sequence(WmSWP_FrameChanged_clip, "SetWindowPos:FrameChanged_clip", FALSE );
9043
9044 UpdateWindow( hparent );
9045 flush_events();
9047 if (winetest_debug > 1) trace("testing SWP_FRAMECHANGED|SWP_DEFERERASE on parent with WS_CLIPCHILDREN\n");
9049 SetWindowPos( hparent, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_DEFERERASE |
9051 flush_events();
9052 ok_sequence(WmSWP_FrameChangedDeferErase, "SetWindowPos:FrameChangedDeferErase", FALSE );
9053
9055 ok_sequence( WmSetParentStyle, "WmSetParentStyle", FALSE );
9056 RedrawWindow( hparent, NULL, 0, RDW_INTERNALPAINT );
9057 flush_events();
9058 ok_sequence( WmParentPaint, "WmParentPaint", FALSE );
9059
9060 style = GetWindowLongA(hparent, GWL_STYLE);
9061 ok(!(style & WS_CLIPCHILDREN), "Got unexpected style %#lx.\n", style);
9062 UpdateWindow( hparent );
9063 flush_events();
9065 if (winetest_debug > 1) trace("testing SWP_FRAMECHANGED on parent without WS_CLIPCHILDREN\n");
9067 SetWindowPos( hparent, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
9069 flush_events();
9070 ok_sequence(WmSWP_FrameChanged_noclip, "SetWindowPos:FrameChanged_noclip", FALSE );
9071
9072 UpdateWindow( hparent );
9073 flush_events();
9075 if (winetest_debug > 1) trace("testing SWP_FRAMECHANGED|SWP_DEFERERASE on parent without WS_CLIPCHILDREN\n");
9077 SetWindowPos( hparent, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_DEFERERASE |
9079 flush_events();
9080 ok_sequence(WmSWP_FrameChangedDeferErase, "SetWindowPos:FrameChangedDeferErase", FALSE );
9081
9082 ok(GetWindowLongA( hparent, GWL_STYLE ) & WS_VISIBLE, "parent should be visible\n");
9083 ok(GetWindowLongA( hchild, GWL_STYLE ) & WS_VISIBLE, "child should be visible\n");
9084
9085 UpdateWindow( hparent );
9086 flush_events();
9088 if (winetest_debug > 1) trace("testing SetWindowPos(-10000, -10000) on child\n");
9089 SetWindowPos( hchild, 0, -10000, -10000, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER );
9090 check_update_rgn( hchild, 0 );
9091 flush_events();
9092
9093#if 0 /* this one doesn't pass under Wine yet */
9094 UpdateWindow( hparent );
9095 flush_events();
9097 if (winetest_debug > 1) trace("testing ShowWindow(SW_MINIMIZE) on child\n");
9098 ShowWindow( hchild, SW_MINIMIZE );
9099 check_update_rgn( hchild, 0 );
9100 flush_events();
9101#endif
9102
9103 UpdateWindow( hparent );
9104 flush_events();
9106 if (winetest_debug > 1) trace("testing SetWindowPos(-10000, -10000) on parent\n");
9107 SetWindowPos( hparent, 0, -10000, -10000, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER );
9108 check_update_rgn( hparent, 0 );
9109 flush_events();
9110
9112 DestroyWindow( hparent );
9113 ok(!IsWindow(hchild), "child must be destroyed with its parent\n");
9114
9115 /* tests for moving windows off-screen (needs simple WS_POPUP windows) */
9116
9117 hparent = CreateWindowExA(0, "TestParentClass", "Test parent", WS_POPUP | WS_VISIBLE,
9118 100, 100, 200, 200, 0, 0, 0, NULL);
9119 ok (hparent != 0, "Failed to create parent window\n");
9120
9121 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD | WS_VISIBLE,
9122 10, 10, 100, 100, hparent, 0, 0, NULL);
9123 ok (hchild != 0, "Failed to create child window\n");
9124
9125 ShowWindow( hparent, SW_SHOW );
9126 UpdateWindow( hparent );
9127 UpdateWindow( hchild );
9128 flush_events();
9130
9131 /* moving child outside of parent boundaries changes update region */
9132 SetRect( &rect, 0, 0, 40, 40 );
9133 RedrawWindow( hchild, &rect, 0, RDW_INVALIDATE | RDW_ERASE );
9134 SetRectRgn( hrgn, 0, 0, 40, 40 );
9135 check_update_rgn( hchild, hrgn );
9136 MoveWindow( hchild, -10, 10, 100, 100, FALSE );
9137 SetRectRgn( hrgn, 10, 0, 40, 40 );
9138 check_update_rgn( hchild, hrgn );
9139 MoveWindow( hchild, -10, -10, 100, 100, FALSE );
9140 SetRectRgn( hrgn, 10, 10, 40, 40 );
9141 check_update_rgn( hchild, hrgn );
9142
9143 /* moving parent off-screen does too */
9144 SetRect( &rect, 0, 0, 100, 100 );
9146 SetRectRgn( hrgn, 0, 0, 100, 100 );
9147 check_update_rgn( hparent, hrgn );
9148 SetRectRgn( hrgn, 10, 10, 40, 40 );
9149 check_update_rgn( hchild, hrgn );
9150 MoveWindow( hparent, -20, -20, 200, 200, FALSE );
9151 GetUpdateRect( hparent, &rect2, FALSE );
9152 if (!EqualRect( &rect2, &rect )) /* Win 8 and later don't crop update to screen */
9153 {
9154 rect.left += 20;
9155 rect.top += 20;
9156 }
9157 SetRectRgn( hrgn, rect.left, rect.top, rect.right, rect.bottom );
9158 check_update_rgn( hparent, hrgn );
9159 SetRectRgn( hrgn, rect.left + 10, rect.top + 10, 40, 40 );
9160 check_update_rgn( hchild, hrgn );
9161
9162 /* invalidated region is cropped by the parent rects */
9163 SetRect( &rect, 0, 0, 50, 50 );
9164 RedrawWindow( hchild, &rect, 0, RDW_INVALIDATE | RDW_ERASE );
9165 SetRectRgn( hrgn, rect2.left + 10, rect2.top + 10, 50, 50 );
9166 check_update_rgn( hchild, hrgn );
9167
9168 DestroyWindow( hparent );
9169 ok(!IsWindow(hchild), "child must be destroyed with its parent\n");
9171
9172 DeleteObject( hrgn );
9174}
static HRGN hrgn2
RECT rect2
Definition: edittest.c:51
static const struct message WmChildPaintNc[]
Definition: msg.c:8454
static const struct message WmInvalidateParentChild[]
Definition: msg.c:8420
static const struct message WmParentOnlyNcPaint[]
Definition: msg.c:8474
static const struct message WmInvalidateErasePaint[]
Definition: msg.c:8382
static const struct message WmSetParentStyle[]
Definition: msg.c:8481
static const struct message WmInvalidateRgn[]
Definition: msg.c:8349
static const struct message WmInvalidateParentChild2[]
Definition: msg.c:8430
static const struct message WmInvalidatePaint[]
Definition: msg.c:8375
static const struct message WmParentErasePaint[]
Definition: msg.c:8462
static const struct message WmPaint[]
Definition: msg.c:8403
static const struct message WmErase[]
Definition: msg.c:8398
static const struct message WmSWP_FrameChanged_clip[]
Definition: msg.c:426
static const struct message WmParentPaint[]
Definition: msg.c:8438
static const struct message WmParentOnlyPaint[]
Definition: msg.c:8408
static const struct message WmInvalidateErasePaint2[]
Definition: msg.c:8390
static const struct message WmInvalidateFull[]
Definition: msg.c:8362
static const struct message WmGetUpdateRect[]
Definition: msg.c:8355
static const struct message WmSWP_FrameChangedDeferErase[]
Definition: msg.c:443
static const struct message WmParentPaintNc[]
Definition: msg.c:8444
static const struct message WmSWP_FrameChanged_noclip[]
Definition: msg.c:461
#define check_update_rgn(hwnd, hrgn)
Definition: msg.c:8312
static const struct message WmInvalidateParent[]
Definition: msg.c:8413
static const struct message WmInvalidateErase[]
Definition: msg.c:8368
#define SIMPLEREGION
Definition: wingdi.h:362
#define RDW_NOCHILDREN
Definition: winuser.h:1233
#define RDW_ALLCHILDREN
Definition: winuser.h:1232
#define RDW_ERASENOW
Definition: winuser.h:1230
BOOL WINAPI ValidateRgn(_In_ HWND, _In_opt_ HRGN)
BOOL WINAPI InvalidateRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
#define RDW_NOFRAME
Definition: winuser.h:1227
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define RDW_NOERASE
Definition: winuser.h:1226
#define RDW_VALIDATE
Definition: winuser.h:1229

Referenced by START_TEST().

◆ test_paintingloop()

static void test_paintingloop ( void  )
static

Definition at line 17800 of file msg.c.

17801{
17802 HWND hwnd;
17803
17804#ifdef __REACTOS__
17805 if (!is_reactos() && GetNTVersion() == _WIN32_WINNT_WS03) {
17806 skip("I think this test crashes on our WS03 test bot!\n");
17807 return;
17808 }
17809#endif
17811 hwnd = CreateWindowExA(0x0,"PaintLoopWindowClass",
17812 "PaintLoopWindowClass",WS_OVERLAPPEDWINDOW,
17813 100, 100, 100, 100, 0, 0, 0, NULL );
17814 ok(hwnd != 0, "PaintLoop window error %lu\n", GetLastError());
17816 SetFocus(hwnd);
17817
17818 while (!paint_loop_done)
17819 {
17820 MSG msg;
17821 if (PeekMessageA(&msg, 0, 0, 0, 1))
17822 {
17825 }
17826 }
17828}

Referenced by START_TEST().

◆ test_PeekMessage()

static void test_PeekMessage ( void  )
static

Definition at line 13873 of file msg.c.

13874{
13875 MSG msg;
13876 HANDLE hthread;
13877 DWORD tid, qstatus;
13878 UINT qs_all_input = QS_ALLINPUT;
13879 UINT qs_input = QS_INPUT;
13880 BOOL ret, broken_flags = FALSE;
13881 struct peekmsg_info info;
13882
13883 info.hwnd = CreateWindowA("TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
13884 100, 100, 200, 200, 0, 0, 0, NULL);
13885 ok(!!info.hwnd, "Failed to create window, error %lu.\n", GetLastError());
13886 ShowWindow(info.hwnd, SW_SHOW);
13887 UpdateWindow(info.hwnd);
13888 SetFocus(info.hwnd);
13889
13890 info.hevent[EV_STOP] = CreateEventA(NULL, 0, 0, NULL);
13891 info.hevent[EV_SENDMSG] = CreateEventA(NULL, 0, 0, NULL);
13892 info.hevent[EV_ACK] = CreateEventA(NULL, 0, 0, NULL);
13893
13894 hthread = CreateThread(NULL, 0, send_msg_thread_2, &info, 0, &tid);
13895 WaitForSingleObject(info.hevent[EV_ACK], 10000);
13896
13897 flush_events();
13899
13900 SetLastError(0xdeadbeef);
13901 qstatus = GetQueueStatus(qs_all_input);
13903 {
13904 trace("QS_RAWINPUT not supported on this platform\n");
13905 qs_all_input &= ~QS_RAWINPUT;
13906 qs_input &= ~QS_RAWINPUT;
13907
13908 SetLastError(0xdeadbeef);
13909 qstatus = GetQueueStatus(qs_all_input);
13911 broken_flags = TRUE;
13912 ok(GetLastError() == 0xdeadbeef || broken(GetLastError() == ERROR_INVALID_FLAGS) /* win7 */,
13913 "wrong error %ld\n", GetLastError());
13914 }
13915 if (qstatus & QS_POSTMESSAGE)
13916 {
13917 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) /* nothing */ ;
13918 qstatus = GetQueueStatus(qs_all_input);
13919 }
13920 ok(qstatus == 0, "wrong qstatus %08lx\n", qstatus);
13921
13922 if (winetest_debug > 1) trace("signalling to send message\n");
13923 SetEvent(info.hevent[EV_SENDMSG]);
13925
13926 /* pass invalid QS_xxxx flags */
13927 SetLastError(0xdeadbeef);
13928 qstatus = GetQueueStatus(0xffffffff);
13929 ok(qstatus == 0 || broken(qstatus) /* win9x */, "GetQueueStatus should fail: %08lx\n", qstatus);
13930 if (!qstatus)
13931 {
13932 ok(GetLastError() == ERROR_INVALID_FLAGS, "wrong error %ld\n", GetLastError());
13933 SetLastError(0xdeadbeef);
13934 qstatus = GetQueueStatus(qs_all_input);
13935 ok(GetLastError() == 0xdeadbeef || broken(broken_flags && GetLastError() == ERROR_INVALID_FLAGS),
13936 "wrong error %ld\n", GetLastError());
13937 }
13938 qstatus &= ~MAKELONG( 0x4000, 0x4000 ); /* sometimes set on Win95 */
13940 broken(broken_flags && qstatus == 0),
13941 "wrong qstatus %08lx\n", qstatus);
13942
13943 msg.message = 0;
13944 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
13945 ok(!ret,
13946 "PeekMessageA should have returned FALSE instead of msg %04x\n",
13947 msg.message);
13948 ok_sequence(WmUser, "WmUser", FALSE);
13949
13950 qstatus = GetQueueStatus(qs_all_input);
13951 ok(qstatus == 0, "wrong qstatus %08lx\n", qstatus);
13952
13953 keybd_event('N', 0, 0, 0);
13954 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
13955 qstatus = GetQueueStatus(qs_all_input);
13956 if (!(qstatus & MAKELONG(QS_KEY, QS_KEY)))
13957 {
13958 skip( "queuing key events not supported\n" );
13959 goto done;
13960 }
13961 ok(qstatus == MAKELONG(QS_KEY, QS_KEY) ||
13962 /* keybd_event seems to trigger a sent message on NT4 */
13964 "wrong qstatus %08lx\n", qstatus);
13965
13966 PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
13967 qstatus = GetQueueStatus(qs_all_input);
13970 "wrong qstatus %08lx\n", qstatus);
13971
13972 InvalidateRect(info.hwnd, NULL, FALSE);
13973 qstatus = GetQueueStatus(qs_all_input);
13976 "wrong qstatus %08lx\n", qstatus);
13977
13978 if (winetest_debug > 1) trace("signalling to send message\n");
13979 SetEvent(info.hevent[EV_SENDMSG]);
13981
13982 qstatus = GetQueueStatus(qs_all_input);
13984 "wrong qstatus %08lx\n", qstatus);
13985
13986 msg.message = 0;
13987 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | (qs_input << 16));
13988 if (ret && msg.message == WM_CHAR)
13989 {
13990 win_skip( "PM_QS_* flags not supported in PeekMessage\n" );
13991 goto done;
13992 }
13993 ok(!ret,
13994 "PeekMessageA should have returned FALSE instead of msg %04x\n",
13995 msg.message);
13996 if (!sequence_cnt) /* nt4 doesn't fetch anything with PM_QS_* flags */
13997 {
13998 win_skip( "PM_QS_* flags not supported in PeekMessage\n" );
13999 goto done;
14000 }
14001 ok_sequence(WmUser, "WmUser", FALSE);
14002
14003 qstatus = GetQueueStatus(qs_all_input);
14004 ok(qstatus == MAKELONG(0, QS_PAINT|QS_POSTMESSAGE|QS_KEY),
14005 "wrong qstatus %08lx\n", qstatus);
14006
14007 if (winetest_debug > 1) trace("signalling to send message\n");
14008 SetEvent(info.hevent[EV_SENDMSG]);
14010
14011 qstatus = GetQueueStatus(qs_all_input);
14013 "wrong qstatus %08lx\n", qstatus);
14014
14015 msg.message = 0;
14016 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_POSTMESSAGE );
14017 ok(!ret,
14018 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14019 msg.message);
14020 ok_sequence(WmUser, "WmUser", FALSE);
14021
14022 qstatus = GetQueueStatus(qs_all_input);
14023 ok(qstatus == MAKELONG(0, QS_PAINT|QS_POSTMESSAGE|QS_KEY),
14024 "wrong qstatus %08lx\n", qstatus);
14025
14026 msg.message = 0;
14027 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_POSTMESSAGE);
14028 ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
14029 "got %d and %04x wParam %08Ix instead of TRUE and WM_CHAR wParam 'z'\n",
14030 ret, msg.message, msg.wParam);
14031 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14032
14033 qstatus = GetQueueStatus(qs_all_input);
14034 ok(qstatus == MAKELONG(0, QS_PAINT|QS_KEY),
14035 "wrong qstatus %08lx\n", qstatus);
14036
14037 msg.message = 0;
14038 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_POSTMESSAGE);
14039 ok(!ret,
14040 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14041 msg.message);
14042 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14043
14044 qstatus = GetQueueStatus(qs_all_input);
14045 ok(qstatus == MAKELONG(0, QS_PAINT|QS_KEY),
14046 "wrong qstatus %08lx\n", qstatus);
14047
14048 msg.message = 0;
14049 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_PAINT);
14050 ok(ret && msg.message == WM_PAINT,
14051 "got %d and %04x instead of TRUE and WM_PAINT\n", ret, msg.message);
14053 ok_sequence(WmPaint, "WmPaint", FALSE);
14054
14055 qstatus = GetQueueStatus(qs_all_input);
14056 ok(qstatus == MAKELONG(0, QS_KEY),
14057 "wrong qstatus %08lx\n", qstatus);
14058
14059 msg.message = 0;
14060 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_PAINT);
14061 ok(!ret,
14062 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14063 msg.message);
14064 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14065
14066 qstatus = GetQueueStatus(qs_all_input);
14067 ok(qstatus == MAKELONG(0, QS_KEY),
14068 "wrong qstatus %08lx\n", qstatus);
14069
14070 if (winetest_debug > 1) trace("signalling to send message\n");
14071 SetEvent(info.hevent[EV_SENDMSG]);
14073
14074 qstatus = GetQueueStatus(qs_all_input);
14076 "wrong qstatus %08lx\n", qstatus);
14077
14078 PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
14079
14080 qstatus = GetQueueStatus(qs_all_input);
14082 "wrong qstatus %08lx\n", qstatus);
14083
14084 msg.message = 0;
14086 ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
14087 "got %d and %04x wParam %08Ix instead of TRUE and WM_CHAR wParam 'z'\n",
14088 ret, msg.message, msg.wParam);
14089 ok_sequence(WmUser, "WmUser", FALSE);
14090
14091 qstatus = GetQueueStatus(qs_all_input);
14092 ok(qstatus == MAKELONG(0, QS_KEY),
14093 "wrong qstatus %08lx\n", qstatus);
14094
14095 msg.message = 0;
14097 ok(!ret,
14098 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14099 msg.message);
14100 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14101
14102 qstatus = GetQueueStatus(qs_all_input);
14103 ok(qstatus == MAKELONG(0, QS_KEY),
14104 "wrong qstatus %08lx\n", qstatus);
14105
14106 PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
14107
14108 qstatus = GetQueueStatus(qs_all_input);
14110 "wrong qstatus %08lx\n", qstatus);
14111
14112 if (winetest_debug > 1) trace("signalling to send message\n");
14113 SetEvent(info.hevent[EV_SENDMSG]);
14115
14116 qstatus = GetQueueStatus(qs_all_input);
14118 "wrong qstatus %08lx\n", qstatus);
14119
14120 msg.message = 0;
14121 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | (QS_KEY << 16));
14122 ok(!ret,
14123 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14124 msg.message);
14125 ok_sequence(WmUser, "WmUser", FALSE);
14126
14127 qstatus = GetQueueStatus(qs_all_input);
14128 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE|QS_KEY),
14129 "wrong qstatus %08lx\n", qstatus);
14130
14131 msg.message = 0;
14132 if (qs_all_input & QS_RAWINPUT) /* use QS_RAWINPUT only if supported */
14133 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | (QS_RAWINPUT << 16));
14134 else /* workaround for a missing QS_RAWINPUT support */
14136 ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
14137 "got %d and %04x wParam %08Ix instead of TRUE and WM_KEYDOWN wParam 'N'\n",
14138 ret, msg.message, msg.wParam);
14139 ok_sequence(WmKeyDownSkippedSeq, "WmKeyDownSkippedSeq", FALSE);
14140
14141 qstatus = GetQueueStatus(qs_all_input);
14142 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE|QS_KEY),
14143 "wrong qstatus %08lx\n", qstatus);
14144
14145 msg.message = 0;
14146 if (qs_all_input & QS_RAWINPUT) /* use QS_RAWINPUT only if supported */
14147 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | (QS_RAWINPUT << 16));
14148 else /* workaround for a missing QS_RAWINPUT support */
14150 ok(ret && msg.message == WM_KEYUP && msg.wParam == 'N',
14151 "got %d and %04x wParam %08Ix instead of TRUE and WM_KEYUP wParam 'N'\n",
14152 ret, msg.message, msg.wParam);
14153 ok_sequence(WmKeyUpSkippedSeq, "WmKeyUpSkippedSeq", FALSE);
14154
14155 qstatus = GetQueueStatus(qs_all_input);
14156 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE),
14157 "wrong qstatus %08lx\n", qstatus);
14158
14159 msg.message = 0;
14160 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE);
14161 ok(!ret,
14162 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14163 msg.message);
14164 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14165
14166 qstatus = GetQueueStatus(qs_all_input);
14167 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE),
14168 "wrong qstatus %08lx\n", qstatus);
14169
14170 msg.message = 0;
14171 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
14172 ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
14173 "got %d and %04x wParam %08Ix instead of TRUE and WM_CHAR wParam 'z'\n",
14174 ret, msg.message, msg.wParam);
14175 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14176
14177 qstatus = GetQueueStatus(qs_all_input);
14178 ok(qstatus == 0,
14179 "wrong qstatus %08lx\n", qstatus);
14180
14181 msg.message = 0;
14182 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
14183 ok(!ret,
14184 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14185 msg.message);
14186 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14187
14188 qstatus = GetQueueStatus(qs_all_input);
14189 ok(qstatus == 0,
14190 "wrong qstatus %08lx\n", qstatus);
14191
14192 /* test whether presence of the quit flag in the queue affects
14193 * the queue state
14194 */
14195 PostQuitMessage(0x1234abcd);
14196
14197 qstatus = GetQueueStatus(qs_all_input);
14199 "wrong qstatus %08lx\n", qstatus);
14200
14201 PostMessageA(info.hwnd, WM_USER, 0, 0);
14202
14203 qstatus = GetQueueStatus(qs_all_input);
14205 "wrong qstatus %08lx\n", qstatus);
14206
14207 msg.message = 0;
14208 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
14209 ok(ret && msg.message == WM_USER,
14210 "got %d and %04x instead of TRUE and WM_USER\n", ret, msg.message);
14211 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14212
14213 qstatus = GetQueueStatus(qs_all_input);
14214 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE),
14215 "wrong qstatus %08lx\n", qstatus);
14216
14217 msg.message = 0;
14218 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
14219 ok(ret && msg.message == WM_QUIT,
14220 "got %d and %04x instead of TRUE and WM_QUIT\n", ret, msg.message);
14221 ok(msg.wParam == 0x1234abcd, "got wParam %08Ix instead of 0x1234abcd\n", msg.wParam);
14222 ok(msg.lParam == 0, "got lParam %08Ix instead of 0\n", msg.lParam);
14223 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14224
14225 qstatus = GetQueueStatus(qs_all_input);
14226todo_wine {
14227 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE),
14228 "wrong qstatus %08lx\n", qstatus);
14229}
14230
14231 msg.message = 0;
14232 ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE);
14233 ok(!ret,
14234 "PeekMessageA should have returned FALSE instead of msg %04x\n",
14235 msg.message);
14236 ok_sequence(WmEmptySeq, "WmEmptySeq", FALSE);
14237
14238 qstatus = GetQueueStatus(qs_all_input);
14239 ok(qstatus == 0,
14240 "wrong qstatus %08lx\n", qstatus);
14241
14242 /* some GetMessage tests */
14243
14244 keybd_event('N', 0, 0, 0);
14245 qstatus = GetQueueStatus(qs_all_input);
14246 ok(qstatus == MAKELONG(QS_KEY, QS_KEY), "wrong qstatus %08lx\n", qstatus);
14247
14248 PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
14249 qstatus = GetQueueStatus(qs_all_input);
14250 ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08lx\n", qstatus);
14251
14252 if (qstatus)
14253 {
14254 ret = GetMessageA( &msg, 0, 0, 0 );
14255 ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
14256 "got %d and %04x wParam %08Ix instead of TRUE and WM_CHAR wParam 'z'\n",
14257 ret, msg.message, msg.wParam);
14258 qstatus = GetQueueStatus(qs_all_input);
14259 ok(qstatus == MAKELONG(0, QS_KEY), "wrong qstatus %08lx\n", qstatus);
14260 }
14261
14262 if (qstatus)
14263 {
14264 ret = GetMessageA( &msg, 0, 0, 0 );
14265 ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
14266 "got %d and %04x wParam %08Ix instead of TRUE and WM_KEYDOWN wParam 'N'\n",
14267 ret, msg.message, msg.wParam);
14268 ok_sequence(WmKeyDownSkippedSeq, "WmKeyDownSkippedSeq", FALSE);
14269 qstatus = GetQueueStatus(qs_all_input);
14270 ok(qstatus == 0, "wrong qstatus %08lx\n", qstatus);
14271 }
14272
14273 keybd_event('N', 0, 0, 0);
14274 qstatus = GetQueueStatus(qs_all_input);
14275 ok(qstatus == MAKELONG(QS_KEY, QS_KEY), "wrong qstatus %08lx\n", qstatus);
14276
14277 PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
14278 qstatus = GetQueueStatus(qs_all_input);
14279 ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08lx\n", qstatus);
14280
14281 if (qstatus & (QS_KEY << 16))
14282 {
14284 ok(ret && msg.message == WM_KEYDOWN && msg.wParam == 'N',
14285 "got %d and %04x wParam %08Ix instead of TRUE and WM_KEYDOWN wParam 'N'\n",
14286 ret, msg.message, msg.wParam);
14287 ok_sequence(WmKeyDownWasDownSkippedSeq, "WmKeyDownWasDownSkippedSeq", FALSE);
14288 qstatus = GetQueueStatus(qs_all_input);
14289 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08lx\n", qstatus);
14290 }
14291
14292 if (qstatus)
14293 {
14294 ret = GetMessageA( &msg, 0, WM_CHAR, WM_CHAR );
14295 ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
14296 "got %d and %04x wParam %08Ix instead of TRUE and WM_CHAR wParam 'z'\n",
14297 ret, msg.message, msg.wParam);
14298 qstatus = GetQueueStatus(qs_all_input);
14299 ok(qstatus == 0, "wrong qstatus %08lx\n", qstatus);
14300 }
14301
14302 keybd_event('N', 0, KEYEVENTF_KEYUP, 0);
14303 qstatus = GetQueueStatus(qs_all_input);
14304 ok(qstatus == MAKELONG(QS_KEY, QS_KEY), "wrong qstatus %08lx\n", qstatus);
14305
14306 PostMessageA(info.hwnd, WM_CHAR, 'z', 0);
14307 qstatus = GetQueueStatus(qs_all_input);
14308 ok(qstatus == MAKELONG(QS_POSTMESSAGE, QS_POSTMESSAGE|QS_KEY), "wrong qstatus %08lx\n", qstatus);
14309
14310 if (winetest_debug > 1) trace("signalling to send message\n");
14311 SetEvent(info.hevent[EV_SENDMSG]);
14313 qstatus = GetQueueStatus(qs_all_input);
14315 "wrong qstatus %08lx\n", qstatus);
14316
14317 if (qstatus & (QS_KEY << 16))
14318 {
14320 ok(ret && msg.message == WM_KEYUP && msg.wParam == 'N',
14321 "got %d and %04x wParam %08Ix instead of TRUE and WM_KEYDOWN wParam 'N'\n",
14322 ret, msg.message, msg.wParam);
14323 ok_sequence(WmUserKeyUpSkippedSeq, "WmUserKeyUpSkippedSeq", FALSE);
14324 qstatus = GetQueueStatus(qs_all_input);
14325 ok(qstatus == MAKELONG(0, QS_POSTMESSAGE), "wrong qstatus %08lx\n", qstatus);
14326 }
14327
14328 if (qstatus)
14329 {
14330 ret = GetMessageA( &msg, 0, WM_CHAR, WM_CHAR );
14331 ok(ret && msg.message == WM_CHAR && msg.wParam == 'z',
14332 "got %d and %04x wParam %08Ix instead of TRUE and WM_CHAR wParam 'z'\n",
14333 ret, msg.message, msg.wParam);
14334 qstatus = GetQueueStatus(qs_all_input);
14335 ok(qstatus == 0, "wrong qstatus %08lx\n", qstatus);
14336 }
14337
14339 ret = PeekMessageA(&msg, (HWND)-1, 0, 0, PM_NOREMOVE);
14340 ok(ret == TRUE, "wrong ret %d\n", ret);
14341 ok(msg.message == WM_USER, "wrong message %u\n", msg.message);
14342 ret = GetMessageA(&msg, (HWND)-1, 0, 0);
14343 ok(ret == TRUE, "wrong ret %d\n", ret);
14344 ok(msg.message == WM_USER, "wrong message %u\n", msg.message);
14345
14347 ret = PeekMessageA(&msg, (HWND)1, 0, 0, PM_NOREMOVE);
14348 ok(ret == TRUE, "wrong ret %d\n", ret);
14349 ok(msg.message == WM_USER, "wrong message %u\n", msg.message);
14350 ret = GetMessageA(&msg, (HWND)1, 0, 0);
14351 ok(ret == TRUE, "wrong ret %d\n", ret);
14352 ok(msg.message == WM_USER, "wrong message %u\n", msg.message);
14353
14355 ret = PeekMessageA(&msg, (HWND)0xffff, 0, 0, PM_NOREMOVE);
14356 ok(ret == TRUE, "wrong ret %d\n", ret);
14357 ok(msg.message == WM_USER, "wrong message %u\n", msg.message);
14358 ret = GetMessageA(&msg, (HWND)0xffff, 0, 0);
14359 ok(ret == TRUE, "wrong ret %d\n", ret);
14360 ok(msg.message == WM_USER, "wrong message %u\n", msg.message);
14361
14362done:
14363 if (winetest_debug > 1) trace("signalling to exit\n");
14364 SetEvent(info.hevent[EV_STOP]);
14365
14366 WaitForSingleObject(hthread, INFINITE);
14367
14368 CloseHandle(hthread);
14369 CloseHandle(info.hevent[0]);
14370 CloseHandle(info.hevent[1]);
14371 CloseHandle(info.hevent[2]);
14372
14373 DestroyWindow(info.hwnd);
14374}
static DWORD CALLBACK send_msg_thread_2(void *param)
Definition: msg.c:13840
static const struct message WmKeyDownSkippedSeq[]
Definition: msg.c:13808
static const struct message WmUserKeyUpSkippedSeq[]
Definition: msg.c:13823
static const struct message WmKeyDownWasDownSkippedSeq[]
Definition: msg.c:13813
static const struct message WmKeyUpSkippedSeq[]
Definition: msg.c:13818
static const struct message WmUser[]
Definition: msg.c:13140
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define ERROR_INVALID_FLAGS
Definition: winerror.h:907
#define QS_KEY
Definition: winuser.h:885
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define QS_INPUT
Definition: winuser.h:910
#define QS_PAINT
Definition: winuser.h:890

Referenced by START_TEST().

◆ test_PeekMessage2()

static void test_PeekMessage2 ( void  )
static

Definition at line 14393 of file msg.c.

14394{
14395 HWND hwnd;
14396 BOOL ret;
14397 MSG msg;
14398 UINT message;
14399 DWORD time1, time2, time3;
14400 int x1, y1, x2, y2, x3, y3;
14401 POINT pos;
14402
14403 time1 = time2 = time3 = 0;
14404 x1 = y1 = x2 = y2 = x3 = y3 = 0;
14405
14406 /* Initialise window and make sure it is ready for events */
14407 hwnd = CreateWindowA("TestWindowClass", "PeekMessage2", WS_OVERLAPPEDWINDOW,
14408 10, 10, 800, 800, NULL, NULL, NULL, NULL);
14409 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
14410 if (winetest_debug > 1) trace("Window for test_PeekMessage2 %p\n", hwnd);
14413 SetFocus(hwnd);
14414 GetCursorPos(&pos);
14415 SetCursorPos(100, 100);
14417 flush_events();
14418
14419 /* Do initial mousemove, wait until we can see it
14420 and then do our test peek with PM_NOREMOVE. */
14422 wait_move_event(hwnd, 100-STEP, 100-STEP);
14423
14425 if (!ret)
14426 {
14427 skip( "queuing mouse events not supported\n" );
14428 goto done;
14429 }
14430 else
14431 {
14432 if (winetest_debug > 1) trace("1st move event: %04x %lx %ld %ld\n", msg.message, msg.time, msg.pt.x, msg.pt.y);
14433 message = msg.message;
14434 time1 = msg.time;
14435 x1 = msg.pt.x;
14436 y1 = msg.pt.y;
14437 ok(message == WM_MOUSEMOVE, "message not WM_MOUSEMOVE, %04x instead\n", message);
14438 }
14439
14440 /* Allow time to advance a bit, and then simulate the user moving their
14441 * mouse around. After that we peek again with PM_NOREMOVE.
14442 * Although the previous mousemove message was never removed, the
14443 * mousemove we now peek should reflect the recent mouse movements
14444 * because the input queue will merge the move events. */
14445 Sleep(100);
14448
14450 ok(ret, "no message available\n");
14451 if (ret) {
14452 if (winetest_debug > 1) trace("2nd move event: %04x %lx %ld %ld\n", msg.message, msg.time, msg.pt.x, msg.pt.y);
14453 message = msg.message;
14454 time2 = msg.time;
14455 x2 = msg.pt.x;
14456 y2 = msg.pt.y;
14457 ok(message == WM_MOUSEMOVE, "message not WM_MOUSEMOVE, %04x instead\n", message);
14458 ok(time2 > time1, "message time not advanced: %lx %lx\n", time1, time2);
14459 ok(x2 != x1 && y2 != y1, "coords not changed: (%d %d) (%d %d)\n", x1, y1, x2, y2);
14460 }
14461
14462 /* Have another go, to drive the point home */
14463 Sleep(100);
14466
14468 ok(ret, "no message available\n");
14469 if (ret) {
14470 if (winetest_debug > 1) trace("3rd move event: %04x %lx %ld %ld\n", msg.message, msg.time, msg.pt.x, msg.pt.y);
14471 message = msg.message;
14472 time3 = msg.time;
14473 x3 = msg.pt.x;
14474 y3 = msg.pt.y;
14475 ok(message == WM_MOUSEMOVE, "message not WM_MOUSEMOVE, %04x instead\n", message);
14476 ok(time3 > time2, "message time not advanced: %lx %lx\n", time2, time3);
14477 ok(x3 != x2 && y3 != y2, "coords not changed: (%d %d) (%d %d)\n", x2, y2, x3, y3);
14478 }
14479
14480done:
14482 SetCursorPos(pos.x, pos.y);
14483 flush_events();
14484}
static float int float int float int x3
Definition: server.c:79
static float int float int float int float y3
Definition: server.c:79
#define STEP
Definition: msg.c:14392
static void wait_move_event(HWND hwnd, int x, int y)
Definition: msg.c:14376
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710

Referenced by START_TEST().

◆ test_PeekMessage3()

static void test_PeekMessage3 ( void  )
static

Definition at line 14486 of file msg.c.

14487{
14488 HWND parent_hwnd, hwnd;
14489 BOOL ret;
14490 MSG msg;
14491
14492 parent_hwnd = CreateWindowA("SimpleWindowClass", "PeekMessage3", WS_OVERLAPPEDWINDOW,
14493 10, 10, 800, 800, NULL, NULL, NULL, NULL);
14494 ok(parent_hwnd != NULL, "expected parent_hwnd != NULL\n");
14495
14496 hwnd = CreateWindowA("TestWindowClass", "PeekMessage3", WS_CHILD, 0, 0, 1, 1,
14497 parent_hwnd, NULL, NULL, NULL);
14498 ok(hwnd != NULL, "expected hwnd != NULL\n");
14499
14500 flush_events();
14501
14502 /* GetMessage() and PeekMessage(..., PM_REMOVE) should prefer messages which
14503 * were already seen. */
14504
14505 SetTimer(hwnd, 1, 100, NULL);
14506 while (!PeekMessageA(&msg, hwnd, 0, 0, PM_NOREMOVE));
14507 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14508 PostMessageA(hwnd, WM_USER, 0, 0);
14509 ret = PeekMessageA(&msg, hwnd, 0, 0, PM_NOREMOVE);
14510 todo_wine
14511 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14512 ret = GetMessageA(&msg, hwnd, 0, 0);
14513 todo_wine
14514 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14515 ret = GetMessageA(&msg, hwnd, 0, 0);
14516 todo_wine
14517 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14518 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14519 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14520
14521 SetTimer(hwnd, 1, 100, NULL);
14522 while (!PeekMessageA(&msg, hwnd, 0, 0, PM_NOREMOVE));
14523 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14524 PostMessageA(hwnd, WM_USER, 0, 0);
14525 ret = PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE);
14526 todo_wine
14527 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14528 ret = PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE);
14529 todo_wine
14530 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14531 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14532 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14533
14534 /* It doesn't matter if a message range is specified or not. */
14535
14536 SetTimer(hwnd, 1, 100, NULL);
14538 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14539 PostMessageA(hwnd, WM_USER, 0, 0);
14540 ret = GetMessageA(&msg, hwnd, 0, 0);
14541 todo_wine
14542 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14543 ret = GetMessageA(&msg, hwnd, 0, 0);
14544 todo_wine
14545 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14546 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14547 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14548
14549 /* But not if the post messages were added before the PeekMessage() call. */
14550
14551 PostMessageA(hwnd, WM_USER, 0, 0);
14552 SetTimer(hwnd, 1, 100, NULL);
14554 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14555 ret = GetMessageA(&msg, hwnd, 0, 0);
14556 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14557 ret = GetMessageA(&msg, hwnd, 0, 0);
14558 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14559 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14560 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14561
14562 /* More complicated test with multiple messages. */
14563
14564 PostMessageA(hwnd, WM_USER, 0, 0);
14565 SetTimer(hwnd, 1, 100, NULL);
14567 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14568 PostMessageA(hwnd, WM_USER + 1, 0, 0);
14569 ret = GetMessageA(&msg, hwnd, 0, 0);
14570 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14571 ret = GetMessageA(&msg, hwnd, 0, 0);
14572 todo_wine
14573 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14574 ret = GetMessageA(&msg, hwnd, 0, 0);
14575 todo_wine
14576 ok(ret && msg.message == WM_USER + 1, "msg.message = %u instead of WM_USER + 1\n", msg.message);
14577 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14578 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14579
14580 /* Also works for posted messages, but the situation is a bit different,
14581 * because both messages are in the same queue. */
14582
14583 PostMessageA(hwnd, WM_TIMER, 0, 0);
14585 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14586 PostMessageA(hwnd, WM_USER, 0, 0);
14587 ret = GetMessageA(&msg, hwnd, 0, 0);
14588 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14589 ret = GetMessageA(&msg, hwnd, 0, 0);
14590 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14591 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14592 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14593
14594 PostMessageA(hwnd, WM_USER, 0, 0);
14595 PostMessageA(hwnd, WM_TIMER, 0, 0);
14597 ok(msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14598 ret = GetMessageA(&msg, hwnd, 0, 0);
14599 ok(ret && msg.message == WM_USER, "msg.message = %u instead of WM_USER\n", msg.message);
14600 ret = GetMessageA(&msg, hwnd, 0, 0);
14601 ok(ret && msg.message == WM_TIMER, "msg.message = %u instead of WM_TIMER\n", msg.message);
14602 ret = PeekMessageA(&msg, hwnd, 0, 0, 0);
14603 ok(!ret, "expected PeekMessage to return FALSE, got %u\n", ret);
14604
14605 DestroyWindow(parent_hwnd);
14606 flush_events();
14607}

Referenced by START_TEST().

◆ test_PostMessage()

static void test_PostMessage ( void  )
static

Definition at line 18393 of file msg.c.

18394{
18395 static const struct
18396 {
18397 HWND hwnd;
18398 BOOL ret;
18399 } data[] =
18400 {
18401 { HWND_TOP /* 0 */, TRUE },
18402 { HWND_BROADCAST, TRUE },
18403 { HWND_BOTTOM, TRUE },
18404 { HWND_TOPMOST, TRUE },
18405 { HWND_NOTOPMOST, FALSE },
18406 { HWND_MESSAGE, FALSE },
18407 { (HWND)0xdeadbeef, FALSE }
18408 };
18409 int i;
18410 HWND hwnd;
18411 BOOL ret;
18412 MSG msg;
18413 static const WCHAR staticW[] = {'s','t','a','t','i','c',0};
18414
18415 SetLastError(0xdeadbeef);
18416 hwnd = CreateWindowExW(0, staticW, NULL, WS_POPUP, 0,0,0,0,0,0,0, NULL);
18418 {
18419 win_skip("Skipping some PostMessage tests on Win9x/WinMe\n");
18420 return;
18421 }
18422 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
18423
18424 flush_events();
18425
18426 PostMessageA(hwnd, WM_USER+1, 0x1234, 0x5678);
18427 PostMessageA(0, WM_USER+2, 0x5678, 0x1234);
18428
18429 for (i = 0; i < ARRAY_SIZE(data); i++)
18430 {
18431 memset(&msg, 0xab, sizeof(msg));
18432 ret = PeekMessageA(&msg, data[i].hwnd, 0, 0, PM_NOREMOVE);
18433 ok(ret == data[i].ret, "%d: hwnd %p expected %d, got %d\n", i, data[i].hwnd, data[i].ret, ret);
18434 if (data[i].ret)
18435 {
18436 if (data[i].hwnd)
18437 ok(ret && msg.hwnd == 0 && msg.message == WM_USER+2 &&
18438 msg.wParam == 0x5678 && msg.lParam == 0x1234,
18439 "%d: got ret %d hwnd %p msg %04x wParam %08Ix lParam %08Ix instead of TRUE/0/WM_USER+2/0x5678/0x1234\n",
18440 i, ret, msg.hwnd, msg.message, msg.wParam, msg.lParam);
18441 else
18442 ok(ret && msg.hwnd == hwnd && msg.message == WM_USER+1 &&
18443 msg.wParam == 0x1234 && msg.lParam == 0x5678,
18444 "%d: got ret %d hwnd %p msg %04x wParam %08Ix lParam %08Ix instead of TRUE/%p/WM_USER+1/0x1234/0x5678\n",
18445 i, ret, msg.hwnd, msg.message, msg.wParam, msg.lParam, msg.hwnd);
18446 }
18447 }
18448
18450 flush_events();
18451}
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
static const WCHAR staticW[]
Definition: static.c:80

Referenced by START_TEST().

◆ test_quit_message()

static void test_quit_message ( void  )
static

Definition at line 14663 of file msg.c.

14664{
14665 MSG msg;
14666 BOOL ret;
14667
14668 /* test using PostQuitMessage */
14669 flush_events();
14670 PostQuitMessage(0xbeef);
14671
14672 msg.message = 0;
14673 ret = PeekMessageA(&msg, 0, 0, 0, PM_QS_SENDMESSAGE);
14674 ok(!ret, "got %x message\n", msg.message);
14675
14676 ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE);
14677 ok(ret, "PeekMessage failed with error %ld\n", GetLastError());
14678 ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
14679 ok(msg.wParam == 0xbeef, "wParam was 0x%Ix instead of 0xbeef\n", msg.wParam);
14680
14682 ok(ret, "PostMessage failed with error %ld\n", GetLastError());
14683
14684 ret = GetMessageA(&msg, NULL, 0, 0);
14685 ok(ret > 0, "GetMessage failed with error %ld\n", GetLastError());
14686 ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message);
14687
14688 /* note: WM_QUIT message received after WM_USER message */
14689 ret = GetMessageA(&msg, NULL, 0, 0);
14690 ok(!ret, "GetMessage return %d with error %ld instead of FALSE\n", ret, GetLastError());
14691 ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
14692 ok(msg.wParam == 0xbeef, "wParam was 0x%Ix instead of 0xbeef\n", msg.wParam);
14693
14694 ret = PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE);
14695 ok( !ret || msg.message != WM_QUIT, "Received WM_QUIT again\n" );
14696
14697 /* now test with PostThreadMessage - different behaviour! */
14699
14700 ret = PeekMessageA(&msg, NULL, 0, 0, PM_NOREMOVE);
14701 ok(ret, "PeekMessage failed with error %ld\n", GetLastError());
14702 ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
14703 ok(msg.wParam == 0xdead, "wParam was 0x%Ix instead of 0xdead\n", msg.wParam);
14704
14706 ok(ret, "PostMessage failed with error %ld\n", GetLastError());
14707
14708 /* note: we receive the WM_QUIT message first this time */
14709 ret = GetMessageA(&msg, NULL, 0, 0);
14710 ok(!ret, "GetMessage return %d with error %ld instead of FALSE\n", ret, GetLastError());
14711 ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
14712 ok(msg.wParam == 0xdead, "wParam was 0x%Ix instead of 0xdead\n", msg.wParam);
14713
14714 ret = GetMessageA(&msg, NULL, 0, 0);
14715 ok(ret > 0, "GetMessage failed with error %ld\n", GetLastError());
14716 ok(msg.message == WM_USER, "Received message 0x%04x instead of WM_USER\n", msg.message);
14717
14718 flush_events();
14720 ret = DialogBoxParamA(GetModuleHandleA(NULL), "TEST_EMPTY_DIALOG", 0, wm_quit_dlg_proc, 0);
14721 ok(ret == 1, "expected 1, got %d\n", ret);
14722#ifdef __REACTOS__
14724#endif
14725 ok_sequence(WmQuitDialogSeq, "WmQuitDialogSeq", FALSE);
14726 memset(&msg, 0xab, sizeof(msg));
14727 ret = PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE);
14728 ok(ret, "PeekMessage failed\n");
14729 ok(msg.message == WM_QUIT, "Received message 0x%04x instead of WM_QUIT\n", msg.message);
14730 ok(msg.wParam == 0x1234, "wParam was 0x%Ix instead of 0x1234\n", msg.wParam);
14731 ok(msg.lParam == 0, "lParam was 0x%Ix instead of 0\n", msg.lParam);
14732
14733 /* Check what happens to a WM_QUIT message posted to a window that gets
14734 * destroyed.
14735 */
14736 CreateWindowExA(0, "StopQuitClass", "Stop Quit Test", WS_OVERLAPPEDWINDOW,
14737 0, 0, 100, 100, NULL, NULL, NULL, NULL);
14739 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE))
14740 {
14741 struct recvd_message rmsg;
14742 rmsg.hwnd = msg.hwnd;
14743 rmsg.message = msg.message;
14744 rmsg.flags = posted|wparam|lparam;
14745 rmsg.wParam = msg.wParam;
14746 rmsg.lParam = msg.lParam;
14747 rmsg.descr = "stop/quit";
14748 if (msg.message == WM_QUIT)
14749 /* The hwnd can only be checked here */
14750 ok(!msg.hwnd, "The WM_QUIT hwnd was %p instead of NULL\n", msg.hwnd);
14751 add_message(&rmsg);
14753 }
14754 ok_sequence(WmStopQuitSeq, "WmStopQuitSeq", FALSE);
14755}
static INT_PTR CALLBACK wm_quit_dlg_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
Definition: msg.c:14609
static const struct message WmQuitDialogSeq[]
Definition: msg.c:14641
static const struct message WmStopQuitSeq[]
Definition: msg.c:14656
INT_PTR WINAPI DialogBoxParamA(_In_opt_ HINSTANCE, _In_ LPCSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by START_TEST().

◆ test_radio_dbg()

static void test_radio_dbg ( HWND  radio1,
int  state1,
HWND  radio2,
int  state2,
HWND  radio3,
int  state3,
int  line 
)
static

Definition at line 7567 of file msg.c.

7568{
7569 DWORD ret;
7570
7571 ret = SendMessageA(radio1, BM_GETCHECK, 0, 0);
7572 ok_(__FILE__,line)(ret == state1 ? BST_CHECKED : BST_UNCHECKED, "got %08lx\n", ret);
7573 ret = SendMessageA(radio2, BM_GETCHECK, 0, 0);
7574 ok_(__FILE__,line)(ret == state2 ? BST_CHECKED : BST_UNCHECKED, "got %08lx\n", ret);
7575 ret = SendMessageA(radio3, BM_GETCHECK, 0, 0);
7576 ok_(__FILE__,line)(ret == state3 ? BST_CHECKED : BST_UNCHECKED, "got %08lx\n", ret);
7577}

◆ test_radiobutton_focus()

static void test_radiobutton_focus ( void  )
static

Definition at line 20700 of file msg.c.

20701{
20702 HWND hwnd, button;
20703 DWORD style;
20704 int i;
20706
20707 static const struct message set_focus_default_seq[] =
20708 {
20711 { 0 }
20712 };
20713
20714 static const struct message set_focus_checked_seq[] =
20715 {
20717 { 0 }
20718 };
20719
20720 static const struct message WM_LBUTTONDOWN_seq[] =
20721 {
20725 { WM_COMMAND, sent|parent },
20726 { 0 }
20727 };
20728
20729 static const struct message set_focus_without_notify_seq[] =
20730 {
20732 { 0 }
20733 };
20734
20735 hwnd = CreateWindowExA(0, "TestParentClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
20736 100, 100, 200, 200, 0, 0, 0, NULL);
20737 ok(hwnd != 0, "Failed to create parent window\n");
20738
20739 for (i = 0; i < ARRAY_SIZE(types); i++)
20740 {
20741 /* Test default button */
20743 button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
20744 ok(button != NULL, "failed to create a button, 0x%08lx, %p\n", style, hwnd);
20745 flush_events();
20748 flush_events();
20749 ok_sequence(set_focus_default_seq, "WM_SETFOCUS on default radiobutton", FALSE);
20751
20752 /* Test already checked button */
20753 button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
20755 flush_events();
20758 flush_events();
20759 ok_sequence(set_focus_checked_seq, "WM_SETFOCUS on checked radiobutton", FALSE);
20761
20762 /* Test already focused button */
20763 button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
20766 flush_events();
20769 flush_events();
20770 ok_sequence(set_focus_default_seq, "WM_SETFOCUS on focused radiobutton", FALSE);
20772
20773 /* Test WM_LBUTTONDOWN */
20774 button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
20775 flush_events();
20778 flush_events();
20779 ok_sequence(WM_LBUTTONDOWN_seq, "WM_LBUTTONDOWN on radiobutton", FALSE);
20781
20782 /* Test without BS_NOTIFY */
20784 button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
20785 flush_events();
20788 flush_events();
20789 ok_sequence(set_focus_without_notify_seq, "WM_SETFOCUS on radiobutton without BS_NOTIFY", FALSE);
20791
20792 /* Test disabled button */
20794 button = CreateWindowExA(0, WC_BUTTONA, "test", style, 0, 0, 50, 14, hwnd, (HMENU)ID_BUTTON, 0, NULL);
20796 flush_events();
20799 flush_events();
20800 ok_sequence(set_focus_default_seq, "WM_SETFOCUS on disabled radiobutton", FALSE);
20802 }
20803
20805}
Definition: cmds.c:130
#define BN_SETFOCUS
Definition: winuser.h:1962
#define BN_CLICKED
Definition: winuser.h:1954

Referenced by START_TEST().

◆ test_recursive_hook()

static void test_recursive_hook ( void  )
static

Definition at line 12680 of file msg.c.

12681{
12682 HHOOK hook, cbt_hook;
12683 INPUT input = {0};
12684 MSG msg;
12685 BOOL b;
12686
12687#ifdef __REACTOS__
12688 if (is_reactos()) {
12689 ok(FALSE, "FIXME: Recursive msg tests crash on ReactOS!\n");
12690 return;
12691 }
12692#endif
12693 hook_hwnd = CreateWindowExA(WS_EX_TOPMOST, "Static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 200, 60,
12694 NULL, NULL, NULL, NULL);
12695 ok(hook_hwnd != NULL, "CreateWindow failed\n");
12696
12698 ok(recursive_hook != NULL, "SetWindowsHookEx failed\n");
12699
12701 PostMessageW(hook_hwnd, WM_USER+1, 0, 0);
12702
12703 hook_depth = 0;
12704 GetMessageW(&msg, hook_hwnd, 0, 0);
12705 ok(15 <= max_hook_depth && max_hook_depth < 45, "max_hook_depth = %d\n", max_hook_depth);
12706 if (winetest_debug > 1) trace("max_hook_depth = %d\n", max_hook_depth);
12707
12709 ok(b, "UnhokWindowsHookEx failed\n");
12710
12711 /* Test possible recursive hook conditions */
12713 ok(b, "SetForegroundWindow failed, error %ld.\n", GetLastError());
12714
12715 /* Test a possible recursive WH_KEYBOARD hook condition */
12716 max_hook_depth = 0;
12718 ok(!!hook, "SetWindowsHookExA failed, error %ld.\n", GetLastError());
12719
12720 flush_events();
12721 input.type = INPUT_KEYBOARD;
12722 input.ki.wVk = VK_F3;
12723 SendInput(1, &input, sizeof(INPUT));
12724 flush_events();
12725
12726 /* Expect the WH_KEYBOARD hook not gets called recursively */
12727 ok(max_hook_depth == 1, "Got expected %d.\n", max_hook_depth);
12728
12729 /* Test a possible recursive WH_CBT HCBT_KEYSKIPPED hook condition */
12730 max_hook_depth = 0;
12733 ok(!!cbt_hook, "SetWindowsHookExA failed, error %ld.\n", GetLastError());
12734
12735 flush_events();
12736 input.type = INPUT_KEYBOARD;
12737 input.ki.wVk = VK_F3;
12738 SendInput(1, &input, sizeof(INPUT));
12740
12741 /* Expect the WH_CBT HCBT_KEYSKIPPED hook not gets called recursively */
12742 ok(max_hook_depth == 1, "Got expected %d.\n", max_hook_depth);
12743
12744 UnhookWindowsHookEx(cbt_hook);
12746
12747 /* Test a recursive WH_MOUSE hook condition */
12749
12750 max_hook_depth = 0;
12752 ok(!!hook, "SetWindowsHookExA failed, error %ld.\n", GetLastError());
12753
12754 flush_events();
12755 simulate_click(FALSE, 50, 50);
12756 flush_events();
12757
12758 /* Expect the WH_MOUSE hook gets called recursively */
12759 ok(max_hook_depth > 10, "Got expected %d.\n", max_hook_depth);
12760
12761 /* Test a possible recursive WH_CBT HCBT_CLICKSKIPPED hook condition */
12762 max_hook_depth = 0;
12765 ok(!!cbt_hook, "SetWindowsHookExA failed, error %ld.\n", GetLastError());
12766
12767 flush_events();
12768 simulate_click(FALSE, 50, 50);
12769 flush_events();
12770
12771 /* Expect the WH_CBT HCBT_CLICKSKIPPED hook not gets called recursively */
12772 ok(max_hook_depth <= 10, "Got expected %d.\n", max_hook_depth);
12773
12774 UnhookWindowsHookEx(cbt_hook);
12778}
static LRESULT CALLBACK keyboard_recursive_cbt_hook_proc(int code, WPARAM wp, LPARAM lp)
Definition: msg.c:12644
static LRESULT CALLBACK keyboard_recursive_hook_proc(int code, WPARAM wp, LPARAM lp)
Definition: msg.c:12610
static LRESULT CALLBACK mouse_recursive_cbt_hook_proc(int code, WPARAM wp, LPARAM lp)
Definition: msg.c:12662
static LRESULT CALLBACK mouse_recursive_hook_proc(int code, WPARAM wp, LPARAM lp)
Definition: msg.c:12627
static LRESULT WINAPI rec_get_message_hook(int code, WPARAM w, LPARAM l)
Definition: msg.c:12591
static void simulate_click(BOOL left, int x, int y)
Definition: msg.c:12569
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define INPUT_KEYBOARD
Definition: winable.h:10
#define WH_KEYBOARD
Definition: winuser.h:32
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define WH_MOUSE
Definition: winuser.h:37
#define VK_F3
Definition: winuser.h:2293
#define WH_GETMESSAGE
Definition: winuser.h:33

Referenced by START_TEST().

◆ test_recursive_messages()

static void test_recursive_messages ( void  )
static

Definition at line 12797 of file msg.c.

12798{
12799 WNDCLASSA cls = {0};
12800 HWND hwnd;
12801
12802#ifdef __REACTOS__
12803 if (is_reactos()) {
12804 ok(FALSE, "FIXME: Recursive msg tests crash on ReactOS!\n");
12805 return;
12806 }
12807#endif
12809 cls.hInstance = GetModuleHandleA(0);
12812 cls.lpszClassName = "TestRecursiveMsgClass";
12813 register_class(&cls);
12814
12815 hwnd = CreateWindowExA(WS_EX_TOPMOST, "TestRecursiveMsgClass", NULL, WS_POPUP | WS_DISABLED | WS_VISIBLE, 0, 0,
12816 100, 100, NULL, NULL, NULL, NULL);
12817 ok(hwnd != NULL, "CreateWindowExA failed, error %ld.\n", GetLastError());
12819 flush_events();
12820
12821 max_msg_depth = 0;
12822 simulate_click(FALSE, 50, 50);
12823 flush_events();
12824
12825 /* Expect recursive_messages_proc() gets called recursively for WM_SETCURSOR */
12826#ifdef __REACTOS__
12827 ok(max_msg_depth == 15 || broken(max_msg_depth == 14) /* 64-bit */, "Got expected %d.\n", max_msg_depth);
12828#else
12829 ok(max_msg_depth == 15, "Got expected %d.\n", max_msg_depth);
12830#endif
12831
12834}
static LRESULT WINAPI recursive_messages_proc(HWND hwnd, UINT message, WPARAM wp, LPARAM lp)
Definition: msg.c:12782

Referenced by START_TEST().

◆ test_restore_messages()

static void test_restore_messages ( void  )
static

Definition at line 20522 of file msg.c.

20523{
20524 INPUT ip = {0};
20525 HWND hwnd;
20526 INT i;
20527
20528#ifdef __REACTOS__
20529 if (GetNTVersion() == _WIN32_WINNT_WIN7 && !is_reactos()) {
20530 skip("The Alt+Tab tests here can cause Windows 7 to lock up\n");
20531 return;
20532 }
20533#endif
20534 hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 100,
20535 100, 200, 200, 0, 0, 0, NULL);
20536 ok (hwnd != 0, "Failed to create overlapped window\n");
20539 flush_events();
20541
20542 for (i = 0; i < 5; i++)
20543 {
20544 /* Send Alt+Tab to restore test window from minimized state */
20545 ip.type = INPUT_KEYBOARD;
20546 ip.ki.wVk = VK_MENU;
20547 SendInput(1, &ip, sizeof(INPUT));
20548 ip.ki.wVk = VK_TAB;
20549 SendInput(1, &ip, sizeof(INPUT));
20550 ip.ki.wVk = VK_MENU;
20551 ip.ki.dwFlags = KEYEVENTF_KEYUP;
20552 SendInput(1, &ip, sizeof(INPUT));
20553 ip.ki.wVk = VK_TAB;
20554 ip.ki.dwFlags = KEYEVENTF_KEYUP;
20555 SendInput(1, &ip, sizeof(INPUT));
20556 flush_events();
20557 if (!IsIconic(hwnd))
20558 break;
20559 }
20560
20561 if (IsIconic(hwnd))
20562 {
20563 skip("Alt+Tab failed to bring up test window.\n");
20564 goto done;
20565 }
20566#ifdef __REACTOS__
20568#endif
20569 ok_sequence(WmRestoreMinimizedSeq, "Restore minimized window", TRUE);
20570
20571done:
20573}
static const struct message WmRestoreMinimizedSeq[]
Definition: msg.c:20467
Definition: dhcpd.h:62
#define VK_TAB
Definition: winuser.h:2235
BOOL WINAPI IsIconic(_In_ HWND)

Referenced by START_TEST().

◆ test_scroll_messages()

static void test_scroll_messages ( HWND  hwnd)
static

Definition at line 4950 of file msg.c.

4951{
4952 SCROLLINFO si;
4953 INT min, max;
4954 BOOL ret;
4955
4956 flush_events();
4958
4959 min = 0xdeadbeef;
4960 max = 0xdeadbeef;
4962 ok( ret, "GetScrollRange error %ld\n", GetLastError());
4963 if (sequence->message != WmGetScrollRangeSeq[0].message)
4964 trace("GetScrollRange(SB_CTL) generated unknown message %04x\n", sequence->message);
4965 /* values of min and max are undefined */
4967
4968 ret = SetScrollRange(hwnd, SB_CTL, 10, 150, FALSE);
4969 ok( ret, "SetScrollRange error %ld\n", GetLastError());
4970 if (sequence->message != WmSetScrollRangeSeq[0].message)
4971 trace("SetScrollRange(SB_CTL) generated unknown message %04x\n", sequence->message);
4973
4974 min = 0xdeadbeef;
4975 max = 0xdeadbeef;
4977 ok( ret, "GetScrollRange error %ld\n", GetLastError());
4978 if (sequence->message != WmGetScrollRangeSeq[0].message)
4979 trace("GetScrollRange(SB_CTL) generated unknown message %04x\n", sequence->message);
4980 /* values of min and max are undefined */
4982
4983 si.cbSize = sizeof(si);
4984 si.fMask = SIF_RANGE;
4985 si.nMin = 20;
4986 si.nMax = 160;
4988 if (sequence->message != WmSetScrollRangeSeq[0].message)
4989 trace("SetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
4991
4992 si.fMask = SIF_PAGE;
4993 si.nPage = 10;
4995 if (sequence->message != WmSetScrollRangeSeq[0].message)
4996 trace("SetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
4998
4999 si.fMask = SIF_POS;
5000 si.nPos = 20;
5002 if (sequence->message != WmSetScrollRangeSeq[0].message)
5003 trace("SetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
5005
5006 si.fMask = SIF_RANGE;
5007 si.nMin = 0xdeadbeef;
5008 si.nMax = 0xdeadbeef;
5010 ok( ret, "GetScrollInfo error %ld\n", GetLastError());
5011 if (sequence->message != WmGetScrollInfoSeq[0].message)
5012 trace("GetScrollInfo(SB_CTL) generated unknown message %04x\n", sequence->message);
5013 /* values of min and max are undefined */
5015
5016 /* set WS_HSCROLL */
5017 test_hv_scroll_1(hwnd, SB_HORZ, 0, WS_HSCROLL, 10, 150);
5018 /* clear WS_HSCROLL */
5020
5021 /* set WS_HSCROLL */
5022 test_hv_scroll_2(hwnd, SB_HORZ, 0, WS_HSCROLL, 10, 150);
5023 /* clear WS_HSCROLL */
5025
5026 /* set WS_VSCROLL */
5027 test_hv_scroll_1(hwnd, SB_VERT, 0, WS_VSCROLL, 10, 150);
5028 /* clear WS_VSCROLL */
5030
5031 /* set WS_VSCROLL */
5032 test_hv_scroll_2(hwnd, SB_VERT, 0, WS_VSCROLL, 10, 150);
5033 /* clear WS_VSCROLL */
5035}
static const struct message WmSetScrollRangeSeq[]
Definition: msg.c:2056
static void test_hv_scroll_1(HWND hwnd, INT ctl, DWORD clear, DWORD set, INT min, INT max)
Definition: msg.c:4853
static const struct message WmGetScrollRangeSeq[]
Definition: msg.c:2046
static const struct message WmGetScrollInfoSeq[]
Definition: msg.c:2051
static void test_hv_scroll_2(HWND hwnd, INT ctl, DWORD clear, DWORD set, INT min, INT max)
Definition: msg.c:4892
#define SB_VERT
Definition: winuser.h:553
#define SB_CTL
Definition: winuser.h:554
#define SB_HORZ
Definition: winuser.h:552

Referenced by test_messages().

◆ test_scrollwindowex()

static void test_scrollwindowex ( void  )
static

Definition at line 12855 of file msg.c.

12856{
12857 HWND hwnd, hchild;
12858 RECT rect={0,0,130,130};
12859
12860 hwnd = CreateWindowExA(0, "TestWindowClass", "Test Scroll",
12862 100, 100, 200, 200, 0, 0, 0, NULL);
12863 ok (hwnd != 0, "Failed to create overlapped window\n");
12864 hchild = CreateWindowExA(0, "TestWindowClass", "Test child",
12866 10, 10, 150, 150, hwnd, 0, 0, NULL);
12867 ok (hchild != 0, "Failed to create child\n");
12869 flush_events();
12871
12872 /* scroll without the child window */
12873 if (winetest_debug > 1) trace("start scroll\n");
12874 ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL,
12876 ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE);
12877 if (winetest_debug > 1) trace("end scroll\n");
12879 flush_events();
12880 ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE);
12881 flush_events();
12883
12884 /* Now without the SW_ERASE flag */
12885 if (winetest_debug > 1) trace("start scroll\n");
12887 ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE);
12888 if (winetest_debug > 1) trace("end scroll\n");
12890 flush_events();
12891 ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", FALSE);
12892 flush_events();
12894
12895 /* now scroll the child window as well */
12896 if (winetest_debug > 1) trace("start scroll\n");
12897 ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL,
12899 /* wine sends WM_POSCHANGING, WM_POSCHANGED messages */
12900 /* windows sometimes a WM_MOVE */
12901 ok_sequence(WmEmptySeq, "ScrollWindowEx", TRUE);
12902 if (winetest_debug > 1) trace("end scroll\n");
12904 flush_events();
12905 ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE);
12906 flush_events();
12908
12909 /* now scroll with ScrollWindow() */
12910 if (winetest_debug > 1) trace("start scroll with ScrollWindow\n");
12911 ScrollWindow( hwnd, 5, 5, NULL, NULL);
12912 if (winetest_debug > 1) trace("end scroll\n");
12914 flush_events();
12915 ok_sequence(ScrollWindowPaint1, "ScrollWindow", FALSE);
12916
12917 ok(DestroyWindow(hchild), "failed to destroy window\n");
12918 ok(DestroyWindow(hwnd), "failed to destroy window\n");
12920}
static const struct message ScrollWindowPaint1[]
Definition: msg.c:12836
static const struct message ScrollWindowPaint2[]
Definition: msg.c:12850
#define SW_SCROLLCHILDREN
Definition: winuser.h:2614
#define SW_INVALIDATE
Definition: winuser.h:2615
#define SW_ERASE
Definition: winuser.h:2616
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
BOOL WINAPI ScrollWindow(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT)

Referenced by START_TEST().

◆ test_SendMessage_other_thread()

static void test_SendMessage_other_thread ( void  )
static

Definition at line 20206 of file msg.c.

20207{
20208 DWORD qs_all_input = QS_ALLINPUT & ~QS_RAWINPUT;
20209 HANDLE hthread;
20210 struct wnd_event wnd_event;
20211 DWORD tid, ret;
20212 MSG msg;
20213
20217
20218 wnd_event.hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
20219 100, 100, 200, 200, 0, 0, 0, NULL);
20220 ok(wnd_event.hwnd != 0, "CreateWindowEx failed\n");
20221
20222 hthread = CreateThread(NULL, 0, SendMessage_thread_1, &wnd_event, 0, &tid);
20223 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
20224 CloseHandle(hthread);
20225
20226 flush_events();
20228
20230 ok(ret == 0, "wrong status %08lx\n", ret);
20231
20233
20234 /* wait for other thread's SendMessage */
20235 for (;;)
20236 {
20238 if (ret == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE)) break;
20239 Sleep(50);
20240 }
20241
20243 ok(ret == MAKELONG(QS_POSTMESSAGE, QS_SENDMESSAGE|QS_POSTMESSAGE), "wrong status %08lx\n", ret);
20244
20245 if (winetest_debug > 1) trace("main: call GetMessage\n");
20246 GetMessageA(&msg, 0, 0, 0);
20247 ok(msg.message == WM_USER, "expected WM_USER, got %04x\n", msg.message);
20249 ok_sequence(send_message_1, "SendMessage from other thread 1", FALSE);
20250
20252
20254 ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed, ret:%lx\n", ret);
20255
20256 /* intentionally yield */
20257 MsgWaitForMultipleObjects(0, NULL, FALSE, 100, qs_all_input);
20258
20259 if (winetest_debug > 1) trace("main: call SendMessage\n");
20261 ok_sequence(send_message_2, "SendMessage from other thread 2", FALSE);
20262
20264 ok(ret == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE|QS_POSTMESSAGE), "wrong status %08lx\n", ret);
20265
20266 if (winetest_debug > 1) trace("main: call PeekMessage\n");
20267 ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "PeekMessage should not fail\n");
20268 ok(msg.message == WM_USER+1, "expected WM_USER+1, got %04x\n", msg.message);
20270 ok_sequence(send_message_3, "SendMessage from other thread 3", FALSE);
20271
20272 /* intentionally yield */
20273 MsgWaitForMultipleObjects(0, NULL, FALSE, 100, qs_all_input);
20274
20275 if (winetest_debug > 1) trace("main: call PeekMessage\n");
20276 while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) {
20277 ok(ignore_message(msg.message), "got unexpected message %04x from PeekMessageA\n", msg.message);
20278 }
20279 ok_sequence(send_message_5, "SendMessage from other thread 5", FALSE);
20280
20282 ok(ret == 0, "wrong status %08lx\n", ret);
20283
20284 if (winetest_debug > 1) trace("main: call DestroyWindow\n");
20285 DestroyWindow(msg.hwnd);
20286
20287 flush_events();
20289
20293}
static const struct message send_message_2[]
Definition: msg.c:20163
static const struct message send_message_3[]
Definition: msg.c:20167
static const struct message send_message_5[]
Definition: msg.c:20172
static const struct message send_message_1[]
Definition: msg.c:20158
static DWORD WINAPI SendMessage_thread_1(void *param)
Definition: msg.c:20180

Referenced by START_TEST().

◆ test_SendMessageTimeout()

static void test_SendMessageTimeout ( void  )
static

Definition at line 13180 of file msg.c.

13181{
13182 HANDLE thread;
13183 struct sendmsg_info info;
13184 DWORD tid;
13185 BOOL is_win9x;
13186
13187 info.ready = CreateEventA( NULL, 0, 0, NULL );
13188 info.hwnd = CreateWindowA( "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
13189 100, 100, 200, 200, 0, 0, 0, NULL);
13190 flush_events();
13192
13193 info.timeout = 1000;
13194 info.ret = 0xdeadbeef;
13195 ResetEvent( info.ready );
13200 ok( info.ret == 1, "SendMessageTimeout failed\n" );
13201 ok_sequence( WmUser, "WmUser", FALSE );
13202
13203 info.timeout = 1;
13204 info.ret = 0xdeadbeef;
13205 ResetEvent( info.ready );
13208 Sleep(100); /* SendMessageTimeout should time out here */
13211 ok( info.ret == 0, "SendMessageTimeout succeeded\n" );
13212 ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
13213
13214 /* 0 means infinite timeout (but not on win9x) */
13215 info.timeout = 0;
13216 info.ret = 0xdeadbeef;
13217 ResetEvent( info.ready );
13220 Sleep(100);
13223 is_win9x = !info.ret;
13224 if (is_win9x) ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
13225 else ok_sequence( WmUser, "WmUser", FALSE );
13226
13227 /* timeout is treated as signed despite the prototype (but not on win9x) */
13228 info.timeout = 0x7fffffff;
13229 info.ret = 0xdeadbeef;
13230 ResetEvent( info.ready );
13233 Sleep(100);
13236 ok( info.ret == 1, "SendMessageTimeout failed\n" );
13237 ok_sequence( WmUser, "WmUser", FALSE );
13238
13239 info.timeout = 0x80000000;
13240 info.ret = 0xdeadbeef;
13241 ResetEvent( info.ready );
13244 Sleep(100);
13247 if (is_win9x)
13248 {
13249 ok( info.ret == 1, "SendMessageTimeout failed\n" );
13250 ok_sequence( WmUser, "WmUser", FALSE );
13251 }
13252 else
13253 {
13254 ok( info.ret == 0, "SendMessageTimeout succeeded\n" );
13255 ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE );
13256 }
13257
13258 /* now check for timeout during message processing */
13260 info.timeout = 100;
13261 info.ret = 0xdeadbeef;
13262 ResetEvent( info.ready );
13267 /* we should time out but still get the message */
13268 ok( info.ret == 0, "SendMessageTimeout failed\n" );
13269 ok_sequence( WmUser, "WmUser", FALSE );
13270
13271 DestroyWindow( info.hwnd );
13272 CloseHandle( info.ready );
13273}
static BOOL is_win9x
Definition: diskspace.c:33
static LRESULT WINAPI send_msg_delay_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:13174
static void wait_for_thread(HANDLE thread)
Definition: msg.c:13165
static DWORD CALLBACK send_msg_thread(LPVOID arg)
Definition: msg.c:13153
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:650

Referenced by START_TEST().

◆ test_set_hook()

static void test_set_hook ( void  )
static

Definition at line 12406 of file msg.c.

12407{
12408 LRESULT (CALLBACK *p_dummy_hook_proc)(int code, WPARAM wp, LPARAM lp);
12409 HMODULE test_dll_module;
12410 char *test_dll_path;
12411 DWORD error;
12412 BOOL ret;
12413 HHOOK hhook;
12414 HWINEVENTHOOK hwinevent_hook;
12415 int i;
12416
12418 ok(hhook != 0, "local hook does not require hModule set to 0\n");
12420
12421 SetLastError(0xdeadbeef);
12423 ok(!hhook, "global hook requires hModule != 0\n");
12424 ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD, "unexpected error %ld\n", GetLastError());
12425
12426 SetLastError(0xdeadbeef);
12428#ifdef __REACTOS__
12429 ok(!hhook || broken(GetNTVersion() == _WIN32_WINNT_VISTA || GetNTVersion() == _WIN32_WINNT_WIN7), "global hook requires hModule != 0\n");
12431 || broken(GetLastError() == ERROR_HOOK_NEEDS_HMOD) /* WS03 */
12432 || broken(GetLastError() == 0xdeadbeef) /* Vista */,
12433 "unexpected error %ld\n", GetLastError());
12434#else
12435 ok(!hhook, "global hook requires hModule != 0\n");
12436 ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected error %ld\n", GetLastError());
12437#endif
12438
12439 SetLastError(0xdeadbeef);
12441 ok(!hhook, "SetWinEventHook with invalid proc should fail\n");
12442 ok(GetLastError() == ERROR_INVALID_FILTER_PROC, "unexpected error %ld\n", GetLastError());
12443
12444 SetLastError(0xdeadbeef);
12445 ok(!UnhookWindowsHookEx((HHOOK)0xdeadbeef), "UnhookWindowsHookEx succeeded\n");
12446 ok(GetLastError() == ERROR_INVALID_HOOK_HANDLE, "unexpected error %ld\n", GetLastError());
12447
12449 test_dll_module = LoadLibraryA(test_dll_path);
12450 p_dummy_hook_proc = (void *)GetProcAddress(test_dll_module, "dummy_hook_proc");
12451#ifdef __REACTOS__
12452 /* Test failures on WS03-Win 10 1607 */
12453 if (0) {
12454#endif
12455 for (i = WH_MIN; i <= WH_MAX; i++)
12456 {
12457 winetest_push_context("ID %d", i);
12458
12459 /* Test that setting hooks should succeed for hook procs in a library. But for WH_JOURNALRECORD
12460 * and WH_JOURNALPLAYBACK, ERROR_ACCESS_DENIED is returned, even with administrator rights */
12461 SetLastError(0xdeadbeef);
12462 hhook = SetWindowsHookExA(i, p_dummy_hook_proc, test_dll_module, 0);
12463 error = GetLastError();
12465 {
12466 ok(!hhook, "SetWinEventHook succeeded.\n");
12467 ok(error == ERROR_ACCESS_DENIED, "Got unexpected error %ld.\n", GetLastError());
12468 }
12469 else
12470 {
12471 ok(!!hhook, "SetWinEventHook failed.\n");
12472 ok(error == NO_ERROR, "Got unexpected error %ld.\n", GetLastError());
12473 }
12474 if (hhook)
12476
12477 /* Test settings global hooks with a thread ID */
12478 SetLastError(0xdeadbeef);
12479 hhook = SetWindowsHookExA(i, p_dummy_hook_proc, test_dll_module, GetCurrentThreadId());
12480 error = GetLastError();
12482 || i == WH_KEYBOARD_LL || i == WH_MOUSE_LL)
12483 {
12484 ok(!hhook, "SetWinEventHook succeeded.\n");
12485 ok(error == ERROR_GLOBAL_ONLY_HOOK, "Got unexpected error %ld.\n", GetLastError());
12486 }
12487 else
12488 {
12489 ok(!!hhook, "SetWinEventHook failed.\n");
12490 ok(error == NO_ERROR, "Got unexpected error %ld.\n", GetLastError());
12491 }
12492 if (hhook)
12494
12496 }
12497#ifdef __REACTOS__
12498 }
12499#endif
12500 FreeLibrary(test_dll_module);
12502 ok(ret, "Failed to remove the test dll, error %ld.\n", GetLastError());
12503
12504 if (!pSetWinEventHook || !pUnhookWinEvent) return;
12505
12506 /* even process local incontext hooks require hmodule */
12507 SetLastError(0xdeadbeef);
12508 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc,
12510 ok(!hwinevent_hook, "WINEVENT_INCONTEXT requires hModule != 0\n");
12511 ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD, "unexpected error %ld\n", GetLastError());
12512
12513 /* even thread local incontext hooks require hmodule */
12514 SetLastError(0xdeadbeef);
12515 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc,
12517 ok(!hwinevent_hook, "WINEVENT_INCONTEXT requires hModule != 0\n");
12518 ok(GetLastError() == ERROR_HOOK_NEEDS_HMOD, "unexpected error %ld\n", GetLastError());
12519
12520 SetLastError(0xdeadbeef);
12521 hwinevent_hook = pSetWinEventHook(1, 0, 0, win_event_proc,
12523 ok(!hwinevent_hook, "SetWinEventHook with invalid event range should fail\n");
12524 ok(GetLastError() == ERROR_INVALID_HOOK_FILTER, "unexpected error %ld\n", GetLastError());
12525
12526 SetLastError(0xdeadbeef);
12527 hwinevent_hook = pSetWinEventHook(-1, 1, 0, win_event_proc,
12529 ok(!hwinevent_hook, "SetWinEventHook with invalid event range should fail\n");
12530 ok(GetLastError() == ERROR_INVALID_HOOK_FILTER, "unexpected error %ld\n", GetLastError());
12531
12532 SetLastError(0xdeadbeef);
12533 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc,
12534 0, 0xdeadbeef, WINEVENT_OUTOFCONTEXT);
12535 ok(!hwinevent_hook, "SetWinEventHook with invalid tid should fail\n");
12536 todo_wine
12537 ok(GetLastError() == ERROR_INVALID_THREAD_ID, "unexpected error %ld\n", GetLastError());
12538
12539 SetLastError(0xdeadbeef);
12540 hwinevent_hook = pSetWinEventHook(0, 0, 0, win_event_proc,
12542 ok(hwinevent_hook != 0, "SetWinEventHook error %ld\n", GetLastError());
12543 ok(GetLastError() == 0xdeadbeef, "unexpected error %ld\n", GetLastError());
12544 ret = pUnhookWinEvent(hwinevent_hook);
12545 ok( ret, "UnhookWinEvent error %ld\n", GetLastError());
12546
12547todo_wine {
12548 /* This call succeeds under win2k SP4, but fails under Wine.
12549 Does win2k test/use passed process id? */
12550 SetLastError(0xdeadbeef);
12551 hwinevent_hook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0, win_event_proc,
12552 0xdeadbeef, 0, WINEVENT_OUTOFCONTEXT);
12553 ok(hwinevent_hook != 0, "SetWinEventHook error %ld\n", GetLastError());
12554 ok(GetLastError() == 0xdeadbeef, "unexpected error %ld\n", GetLastError());
12555 ret = pUnhookWinEvent(hwinevent_hook);
12556 ok( ret, "UnhookWinEvent error %ld\n", GetLastError());
12557}
12558
12559 SetLastError(0xdeadbeef);
12560 ok(!pUnhookWinEvent((HWINEVENTHOOK)0xdeadbeef), "UnhookWinEvent succeeded\n");
12561 ok(GetLastError() == ERROR_INVALID_HANDLE, "unexpected error %ld\n", GetLastError());
12562}
#define NO_ERROR
Definition: dderror.h:5
#define FreeLibrary(x)
Definition: compat.h:748
#define CALLBACK
Definition: compat.h:35
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define error(str)
Definition: mkdosfs.c:1605
static char test_dll_path[MAX_PATH]
Definition: integrity.c:32
static char * get_test_dll_path(void)
Definition: msg.c:12377
#define LRESULT
Definition: ole.h:14
#define WINEVENT_OUTOFCONTEXT
Definition: winable.h:32
#define ERROR_INVALID_FILTER_PROC
Definition: winerror.h:1253
#define ERROR_INVALID_THREAD_ID
Definition: winerror.h:1270
#define ERROR_HOOK_NEEDS_HMOD
Definition: winerror.h:1254
#define ERROR_INVALID_HOOK_FILTER
Definition: winerror.h:1252
#define ERROR_INVALID_HOOK_HANDLE
Definition: winerror.h:1230
#define ERROR_GLOBAL_ONLY_HOOK
Definition: winerror.h:1255
#define WH_JOURNALPLAYBACK
Definition: winuser.h:31
#define WH_MIN
Definition: winuser.h:28
#define WH_MOUSE_LL
Definition: winuser.h:44
#define WH_MAX
Definition: winuser.h:45
#define WH_SYSMSGFILTER
Definition: winuser.h:36
#define WH_JOURNALRECORD
Definition: winuser.h:30

Referenced by START_TEST().

◆ test_SetActiveWindow()

static void test_SetActiveWindow ( void  )
static

Definition at line 16456 of file msg.c.

16457{
16458 HWND hwnd, popup, ret;
16459
16460 hwnd = CreateWindowExA(0, "TestWindowClass", "Test SetActiveWindow",
16462 100, 100, 200, 200, 0, 0, 0, NULL);
16463
16464 popup = CreateWindowExA(0, "TestWindowClass", "Test SetActiveWindow",
16466 100, 100, 200, 200, hwnd, 0, 0, NULL);
16467
16468 ok(hwnd != 0, "Failed to create overlapped window\n");
16469 ok(popup != 0, "Failed to create popup window\n");
16470 SetForegroundWindow( popup );
16472
16473 if (winetest_debug > 1) trace("SetActiveWindow(0)\n");
16474 ret = SetActiveWindow(0);
16475 ok( ret == popup || broken(ret == 0) /* w1064v1809 */, "Failed to SetActiveWindow(0), ret:%p\n", ret);
16476 if (ret == popup) ok_sequence(SetActiveWindowSeq0, "SetActiveWindow(0)", FALSE);
16478
16479 if (winetest_debug > 1) trace("SetActiveWindow(hwnd), hwnd visible\n");
16481 if (ret == hwnd) ok_sequence(SetActiveWindowSeq1, "SetActiveWindow(hwnd), hwnd visible", TRUE);
16483
16484 if (winetest_debug > 1) trace("SetActiveWindow(popup), hwnd visible, popup visible\n");
16485 ret = SetActiveWindow(popup);
16486 ok( ret == hwnd, "Failed to SetActiveWindow(popup), popup visible\n");
16487 ok_sequence(SetActiveWindowSeq2, "SetActiveWindow(popup), hwnd visible, popup visible", FALSE);
16489
16491 ShowWindow(popup, SW_HIDE);
16493
16494 if (winetest_debug > 1) trace("SetActiveWindow(hwnd), hwnd not visible\n");
16496#ifdef __REACTOS__
16497 ok( ret == NULL || broken(GetNTVersion() == _WIN32_WINNT_VISTA || GetNTVersion() == _WIN32_WINNT_WIN7), "SetActiveWindow(hwnd), hwnd not visible, previous is %p\n", ret );
16498#else
16499 ok( ret == NULL, "SetActiveWindow(hwnd), hwnd not visible, previous is %p\n", ret );
16500#endif
16501 ok_sequence(SetActiveWindowSeq3, "SetActiveWindow(hwnd), hwnd not visible", TRUE);
16503
16504 if (winetest_debug > 1) trace("SetActiveWindow(popup), hwnd not visible, popup not visible\n");
16505 ret = SetActiveWindow(popup);
16506 ok( ret == hwnd, "Failed to SetActiveWindow(popup)\n");
16507 ok_sequence(SetActiveWindowSeq4, "SetActiveWindow(popup), hwnd not visible, popup not visible", TRUE);
16509
16510 if (winetest_debug > 1) trace("done\n");
16511
16513}
static const struct message SetActiveWindowSeq3[]
Definition: msg.c:16408
static const struct message SetActiveWindowSeq2[]
Definition: msg.c:16378
static const struct message SetActiveWindowSeq0[]
Definition: msg.c:16342
static const struct message SetActiveWindowSeq4[]
Definition: msg.c:16429
static const struct message SetActiveWindowSeq1[]
Definition: msg.c:16372

Referenced by START_TEST().

◆ test_SetFocus()

static void test_SetFocus ( void  )
static

Definition at line 19625 of file msg.c.

19626{
19627 HWND parent, old_parent, child, old_focus, old_active;
19628 MSG msg;
19629 struct wnd_event wnd_event;
19630 HANDLE hthread;
19631 DWORD ret, tid;
19632
19634 ok(wnd_event.start_event != 0, "CreateEvent error %ld\n", GetLastError());
19635 hthread = CreateThread(NULL, 0, thread_proc, &wnd_event, 0, &tid);
19636 ok(hthread != 0, "CreateThread error %ld\n", GetLastError());
19638 ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
19640
19641 parent = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
19642 0, 0, 0, 0, 0, 0, 0, NULL);
19643 ok(parent != 0, "failed to create parent window\n");
19644 child = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD,
19645 0, 0, 0, 0, parent, 0, 0, NULL);
19646 ok(child != 0, "failed to create child window\n");
19647
19648 if (winetest_debug > 1) trace("parent %p, child %p, thread window %p\n", parent, child, wnd_event.hwnd);
19649
19650 SetFocus(0);
19651 SetActiveWindow(0);
19652
19653 flush_events();
19655
19656 ok(GetActiveWindow() == 0, "expected active 0, got %p\n", GetActiveWindow());
19657 ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
19658
19660
19661 old_focus = SetFocus(child);
19662 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19663 ok_sequence(WmSetFocus_1, "SetFocus on a child window", TRUE);
19664 ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
19665 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19666 ok(GetFocus() == child, "expected focus %p, got %p\n", child, GetFocus());
19667
19668 old_focus = SetFocus(parent);
19669 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19670 ok_sequence(WmSetFocus_2, "SetFocus on a parent window", FALSE);
19671 ok(old_focus == child, "expected old focus %p, got %p\n", child, old_focus);
19672 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19673 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19674
19675 SetLastError(0xdeadbeef);
19676 old_focus = SetFocus((HWND)0xdeadbeef);
19678 "expected ERROR_INVALID_WINDOW_HANDLE, got %ld\n", GetLastError());
19679 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19680 ok_sequence(WmEmptySeq, "SetFocus on an invalid window", FALSE);
19681 ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
19682 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19683 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19684
19685 SetLastError(0xdeadbeef);
19686 old_focus = SetFocus(GetDesktopWindow());
19687 ok(GetLastError() == ERROR_ACCESS_DENIED /* Vista+ */ ||
19688 broken(GetLastError() == 0xdeadbeef), "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
19689 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19690 ok_sequence(WmEmptySeq, "SetFocus on a desktop window", TRUE);
19691 ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
19692 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19693 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19694
19695 SetLastError(0xdeadbeef);
19696 old_focus = SetFocus(wnd_event.hwnd);
19697 ok(GetLastError() == ERROR_ACCESS_DENIED /* Vista+ */ ||
19698 broken(GetLastError() == 0xdeadbeef), "expected ERROR_ACCESS_DENIED, got %ld\n", GetLastError());
19699 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19700 ok_sequence(WmEmptySeq, "SetFocus on another thread window", TRUE);
19701 ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
19702 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19703 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19704
19705 SetLastError(0xdeadbeef);
19706 old_active = SetActiveWindow((HWND)0xdeadbeef);
19708 "expected ERROR_INVALID_WINDOW_HANDLE, got %ld\n", GetLastError());
19709 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19710 ok_sequence(WmEmptySeq, "SetActiveWindow on an invalid window", FALSE);
19711 ok(old_active == 0, "expected old focus 0, got %p\n", old_active);
19712 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19713 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19714
19715 SetLastError(0xdeadbeef);
19716 old_active = SetActiveWindow(GetDesktopWindow());
19717 todo_wine
19718 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
19719 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19720 ok_sequence(WmEmptySeq, "SetActiveWindow on a desktop window", TRUE);
19721 ok(old_active == 0, "expected old focus 0, got %p\n", old_focus);
19722 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19723 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19724
19725 SetLastError(0xdeadbeef);
19726 old_active = SetActiveWindow(wnd_event.hwnd);
19727 todo_wine
19728 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
19729 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19730 ok_sequence(WmEmptySeq, "SetActiveWindow on another thread window", TRUE);
19731 ok(old_active == 0, "expected old focus 0, got %p\n", old_active);
19732 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19733 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19734
19735 SetLastError(0xdeadbeef);
19737 ok(ret, "AttachThreadInput error %ld\n", GetLastError());
19738
19739 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19740 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19741
19742 flush_events();
19744
19745 old_focus = SetFocus(wnd_event.hwnd);
19746 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19747 ok(old_focus == wnd_event.hwnd, "expected old focus %p, got %p\n", wnd_event.hwnd, old_focus);
19748 ok(GetActiveWindow() == wnd_event.hwnd, "expected active %p, got %p\n", wnd_event.hwnd, GetActiveWindow());
19749 ok(GetFocus() == wnd_event.hwnd, "expected focus %p, got %p\n", wnd_event.hwnd, GetFocus());
19750
19751 old_focus = SetFocus(parent);
19752 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19753 ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
19754 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19755 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19756
19757 flush_events();
19759
19760 old_active = SetActiveWindow(wnd_event.hwnd);
19761 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19762 ok(old_active == parent, "expected old focus %p, got %p\n", parent, old_active);
19763 ok(GetActiveWindow() == wnd_event.hwnd, "expected active %p, got %p\n", wnd_event.hwnd, GetActiveWindow());
19764 ok(GetFocus() == wnd_event.hwnd, "expected focus %p, got %p\n", wnd_event.hwnd, GetFocus());
19765
19766 SetLastError(0xdeadbeef);
19768 ok(ret, "AttachThreadInput error %ld\n", GetLastError());
19769
19770 ok(GetActiveWindow() == 0, "expected active 0, got %p\n", GetActiveWindow());
19771 ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
19772
19773 old_parent = SetParent(child, GetDesktopWindow());
19774 ok(old_parent == parent, "expected old parent %p, got %p\n", parent, old_parent);
19775
19776 ok(GetActiveWindow() == 0, "expected active 0, got %p\n", GetActiveWindow());
19777 ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
19778
19779 old_focus = SetFocus(parent);
19780 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19781 ok(old_focus == parent, "expected old focus %p, got %p\n", parent, old_focus);
19782 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19783 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19784
19785 flush_events();
19787
19788 SetLastError(0xdeadbeef);
19789 old_focus = SetFocus(child);
19790 todo_wine
19791 ok(GetLastError() == ERROR_INVALID_PARAMETER /* Vista+ */ ||
19792 broken(GetLastError() == 0) /* XP */ ||
19793 broken(GetLastError() == 0xdeadbeef), "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
19794 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19795 ok_sequence(WmSetFocus_3, "SetFocus on a child window", TRUE);
19796 ok(old_focus == 0, "expected old focus 0, got %p\n", old_focus);
19797 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19798 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19799
19800 SetLastError(0xdeadbeef);
19801 old_active = SetActiveWindow(child);
19802 ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %ld\n", GetLastError());
19803 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
19804 ok_sequence(WmEmptySeq, "SetActiveWindow on a child window", FALSE);
19805 ok(old_active == parent, "expected old active %p, got %p\n", parent, old_active);
19806 ok(GetActiveWindow() == parent, "expected active %p, got %p\n", parent, GetActiveWindow());
19807 ok(GetFocus() == parent, "expected focus %p, got %p\n", parent, GetFocus());
19808
19810
19813
19815 ok(ret, "PostMessage(WM_QUIT) error %ld\n", GetLastError());
19816 ret = WaitForSingleObject(hthread, INFINITE);
19817 ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
19818 CloseHandle(hthread);
19819}
static const struct message WmSetFocus_3[]
Definition: msg.c:19620
static const struct message WmSetFocus_1[]
Definition: msg.c:19594
static const struct message WmSetFocus_2[]
Definition: msg.c:19613
BOOL WINAPI AttachThreadInput(_In_ DWORD, _In_ DWORD, _In_ BOOL)

Referenced by START_TEST().

◆ test_SetForegroundWindow()

static void test_SetForegroundWindow ( void  )
static

Definition at line 16527 of file msg.c.

16528{
16529 HWND hwnd;
16530
16531 hwnd = CreateWindowExA(0, "TestWindowClass", "Test SetForegroundWindow",
16533 100, 100, 200, 200, 0, 0, 0, NULL);
16534 ok (hwnd != 0, "Failed to create overlapped window\n");
16537
16538 if (winetest_debug > 1) trace("SetForegroundWindow( 0 )\n");
16540 ok_sequence(WmEmptySeq, "SetForegroundWindow( 0 ) away from foreground top level window", FALSE);
16541 if (winetest_debug > 1) trace("SetForegroundWindow( GetDesktopWindow() )\n");
16543#ifdef __REACTOS__
16545#endif
16546 ok_sequence(SetForegroundWindowSeq, "SetForegroundWindow( desktop ) away from "
16547 "foreground top level window", FALSE);
16548 if (winetest_debug > 1) trace("done\n");
16549
16551}
static const struct message SetForegroundWindowSeq[]
Definition: msg.c:16515

Referenced by START_TEST().

◆ test_SetParent()

static void test_SetParent ( void  )
static

Definition at line 18956 of file msg.c.

18957{
18958 HWND parent1, parent2, child, popup;
18959 RECT rc, rc_old;
18960
18961 parent1 = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
18962 100, 100, 200, 200, 0, 0, 0, NULL);
18963 ok(parent1 != 0, "Failed to create parent1 window\n");
18964
18965 parent2 = CreateWindowExA(0, "TestParentClass", NULL, WS_OVERLAPPEDWINDOW,
18966 400, 100, 200, 200, 0, 0, 0, NULL);
18967 ok(parent2 != 0, "Failed to create parent2 window\n");
18968
18969 /* WS_CHILD window */
18970 child = CreateWindowExA(0, "TestWindowClass", NULL, WS_CHILD | WS_VISIBLE,
18971 10, 10, 150, 150, parent1, 0, 0, NULL);
18972 ok(child != 0, "Failed to create child window\n");
18973
18974 GetWindowRect(parent1, &rc);
18975 if (winetest_debug > 1) trace("parent1 %s\n", wine_dbgstr_rect(&rc));
18976 GetWindowRect(child, &rc_old);
18977 MapWindowPoints(0, parent1, (POINT *)&rc_old, 2);
18978 if (winetest_debug > 1) trace("child %s\n", wine_dbgstr_rect(&rc_old));
18979
18981
18982 SetParent(child, parent2);
18983 flush_events();
18984 ok_sequence(WmSetParentSeq_1, "SetParent() visible WS_CHILD", FALSE);
18985
18986 ok(GetWindowLongA(child, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
18987 ok(!IsWindowVisible(child), "IsWindowVisible() should return FALSE\n");
18988
18989 GetWindowRect(parent2, &rc);
18990 if (winetest_debug > 1) trace("parent2 %s\n", wine_dbgstr_rect(&rc));
18991 GetWindowRect(child, &rc);
18992 MapWindowPoints(0, parent2, (POINT *)&rc, 2);
18993 if (winetest_debug > 1) trace("child %s\n", wine_dbgstr_rect(&rc));
18994
18995 ok(EqualRect(&rc_old, &rc), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc_old),
18996 wine_dbgstr_rect(&rc));
18997
18998 /* WS_POPUP window */
18999 popup = CreateWindowExA(0, "TestWindowClass", NULL, WS_POPUP | WS_VISIBLE,
19000 20, 20, 100, 100, 0, 0, 0, NULL);
19001 ok(popup != 0, "Failed to create popup window\n");
19002
19003 GetWindowRect(popup, &rc_old);
19004 if (winetest_debug > 1) trace("popup %s\n", wine_dbgstr_rect(&rc_old));
19005
19007
19008 SetParent(popup, child);
19009 flush_events();
19010#if !defined(__REACTOS__) || !defined(_WIN64)
19011 ok_sequence(WmSetParentSeq_2, "SetParent() visible WS_POPUP", TRUE);
19012#endif
19013
19014 ok(GetWindowLongA(popup, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
19015 ok(!IsWindowVisible(popup), "IsWindowVisible() should return FALSE\n");
19016
19017 GetWindowRect(child, &rc);
19018 if (winetest_debug > 1) trace("parent2 %s\n", wine_dbgstr_rect(&rc));
19019 GetWindowRect(popup, &rc);
19020 MapWindowPoints(0, child, (POINT *)&rc, 2);
19021 if (winetest_debug > 1) trace("popup %s\n", wine_dbgstr_rect(&rc));
19022
19023 ok(EqualRect(&rc_old, &rc), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc_old),
19024 wine_dbgstr_rect(&rc));
19025
19026 DestroyWindow(popup);
19028 DestroyWindow(parent1);
19029 DestroyWindow(parent2);
19030
19032}
static const struct message WmSetParentSeq_1[]
Definition: msg.c:18912
static const struct message WmSetParentSeq_2[]
Definition: msg.c:18924

Referenced by START_TEST().

◆ test_setparent_status()

static void test_setparent_status ( void  )
static

Definition at line 20309 of file msg.c.

20310{
20311 HANDLE hthread;
20312 struct wnd_event wnd_event;
20313 DWORD ret;
20314
20316
20317 wnd_event.hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
20318 100, 100, 200, 200, 0, 0, 0, NULL);
20319 ok(wnd_event.hwnd != 0, "CreateWindowEx failed\n");
20320
20322 ok(ret == 0, "wrong status %08lx\n", ret);
20323
20324 hthread = CreateThread(NULL, 0, SetParent_thread, &wnd_event, 0, NULL);
20325 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
20326
20328
20329 /* background thread's SetParent should complete allowing the thread to exit */
20330 ret = MsgWaitForMultipleObjects(1, &hthread, FALSE, 1000, QS_SENDMESSAGE);
20331 todo_wine ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjects returned %08lx\n", ret);
20332
20333 /* QS_SENDMESSAGE status should not have been set by SetParent */
20335 todo_wine ok(ret == 0, "wrong status %08lx\n", ret);
20336
20338
20339 WaitForSingleObject(hthread, INFINITE);
20340 CloseHandle(hthread);
20342}
static DWORD WINAPI SetParent_thread(void *param)
Definition: msg.c:20295

Referenced by START_TEST().

◆ test_setwindowpos()

static void test_setwindowpos ( void  )
static

Definition at line 6213 of file msg.c.

6214{
6215 HWND hwnd;
6216 RECT rc;
6217 LRESULT res;
6218 const INT X = 50;
6219 const INT Y = 50;
6220 const INT winX = 100;
6221 const INT winY = 100;
6222 const INT sysX = GetSystemMetrics(SM_CXMINTRACK);
6223
6224 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0,
6225 X, Y, winX, winY, 0,
6226 NULL, NULL, 0);
6227
6228 GetWindowRect(hwnd, &rc);
6229 expect(sysX + X, rc.right);
6230 expect(winY + Y, rc.bottom);
6231
6232 flush_events();
6234 res = SetWindowPos(hwnd, HWND_TOPMOST, 50, 50, winX, winY, 0);
6235 ok_sequence(WmZOrder, "Z-Order", TRUE);
6236 ok(res == TRUE, "SetWindowPos expected TRUE, got %Id\n", res);
6237
6238 GetWindowRect(hwnd, &rc);
6239 expect(sysX + X, rc.right);
6240 expect(winY + Y, rc.bottom);
6241
6242 res = SetWindowPos( hwnd, 0, 0, 0, 0, 0,
6244 ok_sequence(WmFrameChanged, "FrameChanged", FALSE);
6245 ok(res == TRUE, "SetWindowPos expected TRUE, got %Id.\n", res);
6246
6247 GetWindowRect(hwnd, &rc);
6248 expect(sysX + X, rc.right);
6249 expect(winY + Y, rc.bottom);
6250
6251 GetWindowRect(hwnd, &rc);
6252 res = SetWindowPos( hwnd, 0, 0, 0, 0, 0,
6254 ok_sequence(WmFrameChanged_move, "FrameChanged", FALSE);
6255 ok(res == TRUE, "SetWindowPos expected TRUE, got %Id.\n", res);
6256
6257 GetWindowRect(hwnd, &rc);
6258 expect(sysX, rc.right);
6259 expect(winY, rc.bottom);
6260
6261 /* get away from possible menu bar to avoid spurious position changed induced by WM. */
6262 res = SetWindowPos( hwnd, HWND_TOPMOST, 200, 200, 200, 200, SWP_SHOWWINDOW );
6263 ok(res == TRUE, "SetWindowPos expected TRUE, got %Id.\n", res);
6266 flush_events();
6267 pump_msg_loop( hwnd, 0 );
6269 GetWindowRect( hwnd, &rc );
6270 SetCursorPos( rc.left + 100, rc.top + 100 );
6271 flush_events();
6272 pump_msg_loop( hwnd, 0 );
6275 res = SetWindowPos( hwnd, 0, 205, 205, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
6276 ok(res == TRUE, "SetWindowPos expected TRUE, got %Id.\n", res);
6277 flush_events();
6278 ok_sequence(WmMove_mouse, "MouseMove", FALSE);
6279 /* if the window and client rects were not changed WM_MOUSEMOVE is not sent. */
6280 res = SetWindowPos( hwnd, 0, 205, 205, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE );
6281 ok(res == TRUE, "SetWindowPos expected TRUE, got %Id.\n", res);
6282 flush_events();
6283 ok_sequence(WmMove_mouse2, "MouseMove2", FALSE);
6285
6287}
#define Y(I)
static const struct message WmFrameChanged_move[]
Definition: msg.c:6170
#define expect(EXPECTED, GOT)
Definition: msg.c:2971
static const struct message WmMove_mouse2[]
Definition: msg.c:6206
static const struct message WmZOrder[]
Definition: msg.c:5371
static const struct message WmMove_mouse[]
Definition: msg.c:6182
static const struct message WmFrameChanged[]
Definition: msg.c:6159
#define SM_CXMINTRACK
Definition: winuser.h:1008

Referenced by START_TEST().

◆ test_SetWindowRgn()

static void test_SetWindowRgn ( void  )
static

Definition at line 15111 of file msg.c.

15112{
15113 HRGN hrgn;
15114 HWND hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
15115 100, 100, 200, 200, 0, 0, 0, NULL);
15116 ok( hwnd != 0, "Failed to create overlapped window\n" );
15117
15119 UpdateWindow( hwnd );
15120 flush_events();
15122
15123 if (winetest_debug > 1) trace("testing SetWindowRgn\n");
15124 hrgn = CreateRectRgn( 0, 0, 150, 150 );
15126 ok_sequence( WmSetWindowRgn, "WmSetWindowRgn", FALSE );
15127
15128 hrgn = CreateRectRgn( 30, 30, 160, 160 );
15130 ok_sequence( WmSetWindowRgn_no_redraw, "WmSetWindowRgn_no_redraw", FALSE );
15131
15132 hrgn = CreateRectRgn( 0, 0, 180, 180 );
15134 ok_sequence( WmSetWindowRgn, "WmSetWindowRgn2", FALSE );
15135
15136 SetWindowRgn( hwnd, 0, TRUE );
15137#ifdef __REACTOS__
15139#endif
15140 ok_sequence( WmSetWindowRgn_clear, "WmSetWindowRgn_clear", FALSE );
15141
15143}
static const struct message WmSetWindowRgn_no_redraw[]
Definition: msg.c:15072
static const struct message WmSetWindowRgn[]
Definition: msg.c:15060
static const struct message WmSetWindowRgn_clear[]
Definition: msg.c:15081
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)

Referenced by START_TEST().

◆ test_showwindow()

static void test_showwindow ( void  )
static

Definition at line 5037 of file msg.c.

5038{
5039 HWND hwnd, hwnd2, hchild;
5040 RECT rc;
5041
5042 hwnd = CreateWindowExA(0, "TestWindowClass", "Test overlapped", WS_OVERLAPPEDWINDOW,
5043 100, 100, 200, 200, 0, 0, 0, NULL);
5044 ok (hwnd != 0, "Failed to create overlapped window\n");
5045 hchild = CreateWindowExA(0, "TestWindowClass", "Test child", WS_CHILD,
5046 0, 0, 10, 10, hwnd, 0, 0, NULL);
5047 ok (hchild != 0, "Failed to create child\n");
5049
5050 /* ShowWindow( SW_SHOWNA) for invisible top level window */
5051 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWNA) for invisible top level window\n");
5052 ok( ShowWindow(hwnd, SW_SHOWNA) == FALSE, "ShowWindow: window was visible\n" );
5053 ok_sequence(WmSHOWNATopInvisible, "ShowWindow(SW_SHOWNA) on invisible top level window", FALSE);
5054
5055 /* ShowWindow( SW_SHOWNA) for now visible top level window */
5056 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWNA) for now visible top level window\n");
5057 ok( ShowWindow(hwnd, SW_SHOWNA) != FALSE, "ShowWindow: window was invisible\n" );
5058 ok_sequence(WmSHOWNATopVisible, "ShowWindow(SW_SHOWNA) on visible top level window", FALSE);
5059 /* back to invisible */
5060 ShowWindow(hchild, SW_HIDE);
5063 /* ShowWindow(SW_SHOWNA) with child and parent invisible */
5064 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWNA) for invisible child with invisible parent\n");
5065 ok( ShowWindow(hchild, SW_SHOWNA) == FALSE, "ShowWindow: window was visible\n" );
5066 ok_sequence(WmSHOWNAChildInvisParInvis, "ShowWindow(SW_SHOWNA) invisible child and parent", FALSE);
5067 /* ShowWindow(SW_SHOWNA) with child visible and parent invisible */
5068 ok( ShowWindow(hchild, SW_SHOW) != FALSE, "ShowWindow: window was invisible\n" );
5070 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWNA) for the visible child and invisible parent\n");
5071 ok( ShowWindow(hchild, SW_SHOWNA) != FALSE, "ShowWindow: window was invisible\n" );
5072 ok_sequence(WmSHOWNAChildVisParInvis, "ShowWindow(SW_SHOWNA) visible child and invisible parent", FALSE);
5073 /* ShowWindow(SW_SHOWNA) with child visible and parent visible */
5076 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWNA) for the visible child and parent\n");
5077 ok( ShowWindow(hchild, SW_SHOWNA) != FALSE, "ShowWindow: window was invisible\n" );
5078 ok_sequence(WmSHOWNAChildVisParVis, "ShowWindow(SW_SHOWNA) for the visible child and parent", FALSE);
5079
5080 /* ShowWindow(SW_SHOWNA) with child invisible and parent visible */
5081 ShowWindow( hchild, SW_HIDE);
5083 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWNA) for the invisible child and visible parent\n");
5084 ok( ShowWindow(hchild, SW_SHOWNA) == FALSE, "ShowWindow: window was visible\n" );
5085 ok_sequence(WmSHOWNAChildInvisParVis, "ShowWindow(SW_SHOWNA) for the invisible child and visible parent", FALSE);
5086
5087 SetCapture(hchild);
5088 ok(GetCapture() == hchild, "wrong capture window %p\n", GetCapture());
5089 DestroyWindow(hchild);
5090 ok(!GetCapture(), "wrong capture window %p\n", GetCapture());
5091
5094
5095 /* Popup windows */
5096 /* Test 1:
5097 * 1. Create invisible maximized popup window.
5098 * 2. Move and resize it.
5099 * 3. Show it maximized.
5100 */
5101 if (winetest_debug > 1) trace("calling CreateWindowExA( WS_MAXIMIZE ) for invisible maximized popup window\n");
5102 hwnd = CreateWindowExA(0, "TestWindowClass", "Test popup", WS_POPUP | WS_MAXIMIZE,
5103 100, 100, 200, 200, 0, 0, 0, NULL);
5104 ok (hwnd != 0, "Failed to create popup window\n");
5105 ok(IsZoomed(hwnd), "window should be maximized\n");
5106 ok_sequence(WmCreateInvisibleMaxPopupSeq, "CreateWindow(WS_MAXIMIZED):popup", FALSE);
5107
5108 GetWindowRect(hwnd, &rc);
5111 "Invalid maximized size before ShowWindow %s\n", wine_dbgstr_rect( &rc ));
5112 /* Reset window's size & position */
5113 SetWindowPos(hwnd, 0, 10, 10, 200, 200, SWP_NOZORDER | SWP_NOACTIVATE);
5114 ok(IsZoomed(hwnd), "window should be maximized\n");
5116
5117 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWMAXIMIZE ) for invisible maximized popup window\n");
5119 ok(IsZoomed(hwnd), "window should be maximized\n");
5120 ok_sequence(WmShowMaxPopupResizedSeq, "ShowWindow(SW_SHOWMAXIMIZED):invisible maximized and resized popup", FALSE);
5121
5122 GetWindowRect(hwnd, &rc);
5125 "Invalid maximized size after ShowWindow %s\n", wine_dbgstr_rect( &rc ));
5128
5129 /* Test 2:
5130 * 1. Create invisible maximized popup window.
5131 * 2. Show it maximized.
5132 */
5133 if (winetest_debug > 1) trace("calling CreateWindowExA( WS_MAXIMIZE ) for invisible maximized popup window\n");
5134 hwnd = CreateWindowExA(0, "TestWindowClass", "Test popup", WS_POPUP | WS_MAXIMIZE,
5135 100, 100, 200, 200, 0, 0, 0, NULL);
5136 ok (hwnd != 0, "Failed to create popup window\n");
5137 ok(IsZoomed(hwnd), "window should be maximized\n");
5138 ok_sequence(WmCreateInvisibleMaxPopupSeq, "CreateWindow(WS_MAXIMIZED):popup", FALSE);
5139
5140 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWMAXIMIZE ) for invisible maximized popup window\n");
5142 ok(IsZoomed(hwnd), "window should be maximized\n");
5143 ok_sequence(WmShowMaxPopupSeq, "ShowWindow(SW_SHOWMAXIMIZED):invisible maximized popup", FALSE);
5146
5147 /* Test 3:
5148 * 1. Create visible maximized popup window.
5149 */
5150 if (winetest_debug > 1) trace("calling CreateWindowExA( WS_MAXIMIZE ) for maximized popup window\n");
5151 hwnd = CreateWindowExA(0, "TestWindowClass", "Test popup", WS_POPUP | WS_MAXIMIZE | WS_VISIBLE,
5152 100, 100, 200, 200, 0, 0, 0, NULL);
5153 ok (hwnd != 0, "Failed to create popup window\n");
5154 ok(IsZoomed(hwnd), "window should be maximized\n");
5155 ok_sequence(WmCreateMaxPopupSeq, "CreateWindow(WS_MAXIMIZED):popup", FALSE);
5158
5159 /* Test 4:
5160 * 1. Create visible popup window.
5161 * 2. Maximize it.
5162 */
5163 if (winetest_debug > 1) trace("calling CreateWindowExA( WS_VISIBLE ) for popup window\n");
5164 hwnd = CreateWindowExA(0, "TestWindowClass", "Test popup", WS_POPUP | WS_VISIBLE,
5165 100, 100, 200, 200, 0, 0, 0, NULL);
5166 ok (hwnd != 0, "Failed to create popup window\n");
5167 ok(!IsZoomed(hwnd), "window should NOT be maximized\n");
5168 ok_sequence(WmCreatePopupSeq, "CreateWindow(WS_VISIBLE):popup", FALSE);
5169
5170 if (winetest_debug > 1) trace("calling ShowWindow( SW_SHOWMAXIMIZE ) for visible popup window\n");
5172 ok(IsZoomed(hwnd), "window should be maximized\n");
5173 ok_sequence(WmShowVisMaxPopupSeq, "ShowWindow(SW_SHOWMAXIMIZED):popup", FALSE);
5176
5177 /* Test 5:
5178 * 1. Restoring a minimized window.
5179 */
5180 hwnd = CreateWindowA("TestWindowClass", "window1", WS_VISIBLE | WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0);
5181 ok(hwnd != NULL, "Failed to create window\n");
5182
5183 hwnd2 = CreateWindowA("static", "window2", WS_VISIBLE | WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0);
5184 ok(hwnd2 != NULL, "Failed to create window\n");
5185
5187 SetActiveWindow(hwnd2);
5188 ok(GetActiveWindow() == hwnd2, "Unexpected active window\n");
5189 flush_events();
5192 flush_events();
5194 "ShowWindow(hwnd, SW_RESTORE): minimized overlapped", TRUE);
5195
5197 SetActiveWindow(hwnd2);
5198 ok(GetActiveWindow() == hwnd2, "Unexpected active window\n");
5199 flush_events();
5202 flush_events();
5203#ifdef __REACTOS__
5205#endif
5207 "ShowWindow(hwnd, SW_SHOWNOACTIVATE): minimized overlapped", TRUE);
5208
5209 DestroyWindow(hwnd2);
5212
5213 /* Test 6:
5214 * 1. Restoring a minimized but active window.
5215 */
5216 hwnd = CreateWindowA("TestWindowClass", "parent", WS_VISIBLE | WS_OVERLAPPEDWINDOW, 0, 0, 100, 100, 0, 0, 0, 0);
5217 ok(hwnd != NULL, "Failed to create window\n");
5218
5221 ok(GetActiveWindow() == hwnd, "Unexpected active window\n");
5222 flush_events();
5225 flush_events();
5227 "ShowWindow(hwnd, SW_RESTORE): active minimized overlapped", TRUE);
5228
5231 ok(GetActiveWindow() == hwnd, "Unexpected active window\n");
5232 flush_events();
5235 flush_events();
5236#ifdef __REACTOS__
5238#endif
5240 "ShowWindow(hwnd, SW_SHOWNOACTIVATE): active minimized overlapped", TRUE);
5241
5244}
static const struct message WmCreateInvisibleMaxPopupSeq[]
Definition: msg.c:785
static const struct message WmSHOWNAChildInvisParVis[]
Definition: msg.c:2130
static const struct message WmShowMaxPopupResizedSeq[]
Definition: msg.c:804
static const struct message WmSHOWNAChildInvisParInvis[]
Definition: msg.c:2117
static const struct message WmSHOWNATopInvisible[]
Definition: msg.c:2147
static const struct message WmShowVisMaxPopupSeq[]
Definition: msg.c:903
static const struct message WmShowMaxPopupSeq[]
Definition: msg.c:836
static const struct message WmCreateMaxPopupSeq[]
Definition: msg.c:741
static const struct message WmShowNoActivateActiveMinimizedOverlappedSeq[]
Definition: msg.c:1041
static const struct message WmShowRestoreMinimizedOverlappedSeq[]
Definition: msg.c:920
static const struct message WmSHOWNATopVisible[]
Definition: msg.c:2138
static const struct message WmSHOWNAChildVisParInvis[]
Definition: msg.c:2121
static const struct message WmSHOWNAChildVisParVis[]
Definition: msg.c:2125
static const struct message WmCreatePopupSeq[]
Definition: msg.c:869
static const struct message WmShowRestoreActiveMinimizedOverlappedSeq[]
Definition: msg.c:1000
static const struct message WmShowNoActivateMinimizedOverlappedSeq[]
Definition: msg.c:959
#define SW_SHOWNOACTIVATE
Definition: winuser.h:785

Referenced by START_TEST().

◆ test_ShowWindow()

static void test_ShowWindow ( void  )
static

Definition at line 15486 of file msg.c.

15487{
15488 /* ShowWindow commands in random order */
15489 static const struct
15490 {
15491 INT cmd; /* ShowWindow command */
15492 LPARAM ret; /* ShowWindow return value */
15493 DWORD style; /* window style after the command */
15494 const struct message *msg; /* message sequence the command produces */
15495 INT wp_cmd, wp_flags; /* window placement after the command */
15496 POINT wp_min, wp_max; /* window placement after the command */
15497 BOOL todo_msg; /* message sequence doesn't match what Wine does */
15498 } sw[] =
15499 {
15501 SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE },
15503 SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE },
15504/* 3 */ { SW_HIDE, TRUE, 0, WmHide_1,
15505 SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE },
15506/* 4 */ { SW_HIDE, FALSE, 0, WmEmptySeq,
15507 SW_SHOWNORMAL, 0, {-1,-1}, {-1,-1}, FALSE },
15509 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15511 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15512/* 7 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_1,
15513 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15514/* 8 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq,
15515 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15517 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15519 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15520/* 11 */ { SW_HIDE, TRUE, WS_MAXIMIZE, WmHide_1,
15521 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15522/* 12 */ { SW_HIDE, FALSE, WS_MAXIMIZE, WmEmptySeq,
15523 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15525 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15527 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15528/* 15 */ { SW_HIDE, TRUE, 0, WmHide_2,
15529 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15530/* 16 */ { SW_HIDE, FALSE, 0, WmEmptySeq,
15531 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15532/* 17 */ { SW_SHOW, FALSE, WS_VISIBLE, WmShow,
15533 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15534/* 18 */ { SW_SHOW, TRUE, WS_VISIBLE, WmEmptySeq,
15535 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15537 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15539 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15540/* 21 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2,
15541 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15543 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, TRUE },
15545 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15546/* 24 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2,
15547 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15548/* 25 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq,
15549 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15551 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15553 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15554/* 28 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2,
15555 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15556/* 29 */ { SW_HIDE, FALSE, WS_MINIMIZE, WmEmptySeq,
15557 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15559 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15560/* 31 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmEmptySeq,
15561 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15562/* 32 */ { SW_HIDE, TRUE, 0, WmHide_3,
15563 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15564/* 33 */ { SW_HIDE, FALSE, 0, WmEmptySeq,
15565 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15566/* 34 */ { SW_NORMALNA, FALSE, 0, WmEmptySeq, /* what does this mean?! */
15567 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15568/* 35 */ { SW_NORMALNA, FALSE, 0, WmEmptySeq,
15569 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15570/* 36 */ { SW_HIDE, FALSE, 0, WmEmptySeq,
15571 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15573 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15574/* 38 */ { SW_RESTORE, TRUE, WS_VISIBLE, WmEmptySeq,
15575 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15577 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15579 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15581 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15583 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15585 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15587 SW_SHOWMINIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15589 SW_SHOWMINIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15591 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15593 SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15595 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15597 SW_SHOWMAXIMIZED, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15599 SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15601 SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15602/* 52 */ { SW_HIDE, TRUE, 0, WmHide_1,
15603 SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15604/* 53 */ { SW_HIDE, FALSE, 0, WmEmptySeq,
15605 SW_SHOWNORMAL, WPF_RESTORETOMAXIMIZED, {-32000,-32000}, {-1,-1}, FALSE },
15607 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15608/* 55 */ { SW_HIDE, TRUE, WS_MINIMIZE, WmHide_2,
15609 SW_SHOWMINIMIZED, 0, {-32000,-32000}, {-1,-1}, FALSE },
15611 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE },
15612/* 57 */ { SW_SHOW, TRUE, WS_VISIBLE, WmEmptySeq,
15613 SW_SHOWNORMAL, 0, {-32000,-32000}, {-1,-1}, FALSE }
15614 };
15615 HWND hwnd;
15616 DWORD style;
15617 LPARAM ret;
15618 INT i;
15619 WINDOWPLACEMENT wp;
15620 RECT win_rc, work_rc = {0, 0, 0, 0};
15621 HMONITOR hmon;
15623 POINT pt = {0, 0};
15624
15625#define WS_BASE (WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_POPUP|WS_CLIPSIBLINGS)
15626 hwnd = CreateWindowExA(0, "ShowWindowClass", NULL, WS_BASE,
15627 120, 120, 90, 90,
15628 0, 0, 0, NULL);
15629 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
15630
15631 style = GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BASE;
15632 ok(style == 0, "expected style 0, got %08lx\n", style);
15633
15634 flush_events();
15636
15637 SetLastError(0xdeadbeef);
15638 hmon = MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY);
15639 ok(hmon != 0, "MonitorFromPoint error %lu\n", GetLastError());
15640
15641 mi.cbSize = sizeof(mi);
15642 SetLastError(0xdeadbeef);
15644 ok(ret, "GetMonitorInfo error %lu\n", GetLastError());
15645 if (winetest_debug > 1) trace("monitor %s, work %s\n", wine_dbgstr_rect(&mi.rcMonitor),
15647 work_rc = mi.rcWork;
15648
15649 GetWindowRect(hwnd, &win_rc);
15650 OffsetRect(&win_rc, -work_rc.left, -work_rc.top);
15651
15652 wp.length = sizeof(wp);
15653 SetLastError(0xdeadbeaf);
15654 ret = GetWindowPlacement(hwnd, &wp);
15655 ok(ret, "GetWindowPlacement error %lu\n", GetLastError());
15656 ok(wp.flags == 0, "expected 0, got %#x\n", wp.flags);
15657 ok(wp.showCmd == SW_SHOWNORMAL, "expected SW_SHOWNORMAL, got %d\n", wp.showCmd);
15658 ok(wp.ptMinPosition.x == -1 && wp.ptMinPosition.y == -1,
15659 "expected -1,-1 got %ld,%ld\n", wp.ptMinPosition.x, wp.ptMinPosition.y);
15660 ok(wp.ptMaxPosition.x == -1 && wp.ptMaxPosition.y == -1,
15661 "expected -1,-1 got %ld,%ld\n", wp.ptMaxPosition.x, wp.ptMaxPosition.y);
15662 todo_wine_if (work_rc.left || work_rc.top) /* FIXME: remove once Wine is fixed */
15663 ok(EqualRect(&win_rc, &wp.rcNormalPosition), "expected %s got %s\n", wine_dbgstr_rect(&win_rc),
15664 wine_dbgstr_rect(&wp.rcNormalPosition));
15665
15666 for (i = 0; i < ARRAY_SIZE(sw); i++)
15667 {
15668 static const char * const sw_cmd_name[13] =
15669 {
15670 "SW_HIDE", "SW_SHOWNORMAL", "SW_SHOWMINIMIZED", "SW_SHOWMAXIMIZED",
15671 "SW_SHOWNOACTIVATE", "SW_SHOW", "SW_MINIMIZE", "SW_SHOWMINNOACTIVE",
15672 "SW_SHOWNA", "SW_RESTORE", "SW_SHOWDEFAULT", "SW_FORCEMINIMIZE",
15673 "SW_NORMALNA" /* 0xCC */
15674 };
15675 char comment[64];
15676 INT idx; /* index into the above array of names */
15677
15678 idx = (sw[i].cmd == SW_NORMALNA) ? 12 : sw[i].cmd;
15679
15681 if (winetest_debug > 1) trace("%d: sending %s, current window style %08lx\n", i+1, sw_cmd_name[idx], style);
15682 ret = ShowWindow(hwnd, sw[i].cmd);
15683 ok(!ret == !sw[i].ret, "%d: cmd %s: expected ret %Iu, got %Iu\n", i+1, sw_cmd_name[idx], sw[i].ret, ret);
15684 style = GetWindowLongA(hwnd, GWL_STYLE) & ~WS_BASE;
15685 ok(style == sw[i].style, "%d: expected style %08lx, got %08lx\n", i+1, sw[i].style, style);
15686
15687 sprintf(comment, "%d: ShowWindow(%s)", i+1, sw_cmd_name[idx]);
15688#if !defined(__REACTOS__) || !defined(_WIN64)
15689#ifdef __REACTOS__
15691#endif
15692 ok_sequence(sw[i].msg, comment, sw[i].todo_msg);
15693#endif
15694
15695 wp.length = sizeof(wp);
15696 SetLastError(0xdeadbeaf);
15697 ret = GetWindowPlacement(hwnd, &wp);
15698 ok(ret, "GetWindowPlacement error %lu\n", GetLastError());
15699 ok(wp.flags == sw[i].wp_flags, "expected %#x, got %#x\n", sw[i].wp_flags, wp.flags);
15700 ok(wp.showCmd == sw[i].wp_cmd, "expected %d, got %d\n", sw[i].wp_cmd, wp.showCmd);
15701
15702 /* NT moves the minimized window to -32000,-32000, win9x to 3000,3000 */
15703 if ((wp.ptMinPosition.x + work_rc.left == -32000 && wp.ptMinPosition.y + work_rc.top == -32000) ||
15704 (wp.ptMinPosition.x + work_rc.left == 3000 && wp.ptMinPosition.y + work_rc.top == 3000))
15705 {
15706 ok((wp.ptMinPosition.x + work_rc.left == sw[i].wp_min.x && wp.ptMinPosition.y + work_rc.top == sw[i].wp_min.y) ||
15707 (wp.ptMinPosition.x + work_rc.left == 3000 && wp.ptMinPosition.y + work_rc.top == 3000),
15708 "expected %ld,%ld got %ld,%ld\n", sw[i].wp_min.x, sw[i].wp_min.y, wp.ptMinPosition.x, wp.ptMinPosition.y);
15709 }
15710 else
15711 {
15712 ok(wp.ptMinPosition.x == sw[i].wp_min.x && wp.ptMinPosition.y == sw[i].wp_min.y,
15713 "expected %ld,%ld got %ld,%ld\n", sw[i].wp_min.x, sw[i].wp_min.y, wp.ptMinPosition.x, wp.ptMinPosition.y);
15714 }
15715
15716 todo_wine_if(wp.ptMaxPosition.x != sw[i].wp_max.x || wp.ptMaxPosition.y != sw[i].wp_max.y)
15717 ok(wp.ptMaxPosition.x == sw[i].wp_max.x && wp.ptMaxPosition.y == sw[i].wp_max.y,
15718 "expected %ld,%ld got %ld,%ld\n", sw[i].wp_max.x, sw[i].wp_max.y, wp.ptMaxPosition.x, wp.ptMaxPosition.y);
15719
15720if (0) /* FIXME: Wine behaves completely different here */
15721 ok(EqualRect(&win_rc, &wp.rcNormalPosition), "expected %s got %s\n",
15723 }
15725 flush_events();
15726}
unsigned int idx
Definition: utils.c:41
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
static HANDLE hmon
Definition: localmon.c:41
#define for
Definition: utility.h:88
#define comment(fmt, arg1)
Definition: rebar.c:847
static const struct message WmMinimize_1[]
Definition: msg.c:15343
static const struct message WmMinMax_3[]
Definition: msg.c:15414
static const struct message WmShowNoActivate_1[]
Definition: msg.c:15171
static const struct message WmRestore_2[]
Definition: msg.c:15244
#define WS_BASE
static const struct message WmMinMax_2[]
Definition: msg.c:15401
static const struct message WmShowMaximized_2[]
Definition: msg.c:15448
static const struct message WmMinMax_1[]
Definition: msg.c:15397
static const struct message WmShowMinNoActivate[]
Definition: msg.c:15388
static const struct message WmHide_1[]
Definition: msg.c:15299
static const struct message WmShowNormal[]
Definition: msg.c:15146
static const struct message WmHide_3[]
Definition: msg.c:15317
static const struct message WmMinimize_2[]
Definition: msg.c:15357
static const struct message WmShowNA_2[]
Definition: msg.c:15218
static const struct message WmRestore_3[]
Definition: msg.c:15256
static const struct message WmShowMaximized_3[]
Definition: msg.c:15471
static const struct message WmHide_2[]
Definition: msg.c:15309
static const struct message WmShowMaximized_1[]
Definition: msg.c:15427
static const struct message WmMinMax_4[]
Definition: msg.c:15423
static const struct message WmShowNoActivate_2[]
Definition: msg.c:15182
static const struct message WmShowMinimized_1[]
Definition: msg.c:15326
#define SW_NORMALNA
Definition: msg.c:46
static const struct message WmShowNA_1[]
Definition: msg.c:15211
static const struct message WmRestore_5[]
Definition: msg.c:15287
static const struct message WmRestore_1[]
Definition: msg.c:15224
static const struct message WmRestore_4[]
Definition: msg.c:15277
static const struct message WmMinimize_3[]
Definition: msg.c:15370
static const struct message WmShow[]
Definition: msg.c:15159
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
POINT ptMaxPosition
Definition: winuser.h:3402
RECT rcNormalPosition
Definition: winuser.h:3403
POINT ptMinPosition
Definition: winuser.h:3401
Definition: ftp_var.h:139
RECT rcMonitor
Definition: winuser.h:3893
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI GetMonitorInfoA(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define WPF_RESTORETOMAXIMIZED
Definition: winuser.h:2568

Referenced by START_TEST().

◆ test_static_messages()

static void test_static_messages ( void  )
static

Definition at line 7801 of file msg.c.

7802{
7803 /* FIXME: make as comprehensive as the button message test */
7804 static const struct
7805 {
7806 DWORD style;
7807 DWORD dlg_code;
7808 const struct message *setfont;
7809 } static_ctrl[] = {
7812 };
7813 unsigned int i;
7814 HWND hwnd;
7815 DWORD dlg_code;
7816
7818
7819 for (i = 0; i < ARRAY_SIZE(static_ctrl); i++)
7820 {
7821 hwnd = CreateWindowExA(0, "my_static_class", "test", static_ctrl[i].style | WS_POPUP,
7822 0, 0, 50, 14, 0, 0, 0, NULL);
7823 ok(hwnd != 0, "Failed to create static window\n");
7824
7825 dlg_code = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0);
7826 ok(dlg_code == static_ctrl[i].dlg_code, "%u: wrong dlg_code %08lx\n", i, dlg_code);
7827
7830 SetFocus(0);
7832
7833 if (winetest_debug > 1) trace("static style %08lx\n", static_ctrl[i].style);
7835 ok_sequence(static_ctrl[i].setfont, "WM_SETFONT on a static", FALSE);
7836
7838 }
7839}
static void subclass_static(void)
Definition: msg.c:7784
static const struct message WmSetFontStaticSeq2[]
Definition: msg.c:7749
#define SS_LEFT
Definition: pedump.c:692

Referenced by START_TEST().

◆ test_swp_paint_region_on_extend_zerosize()

static void test_swp_paint_region_on_extend_zerosize ( void  )
static

Definition at line 9646 of file msg.c.

9647{
9648 HRGN hrgn_actual_child = CreateRectRgn( 0, 0, 0, 0 );
9649 HRGN hrgn_actual = CreateRectRgn( 0, 0, 0, 0 );
9650 const RECT rect_1 = { 10, 10, 100, 100 };
9651 RECT rect_expect_child, rect_expect;
9652 RECT rect_actual_child, rect_actual;
9653 HWND hparent, hchild;
9654 int result;
9655
9656 hparent = CreateWindowExA( 0, "SimpleWindowClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
9657 80, 80, 200, 200, NULL, 0, 0, NULL );
9658 ok( hparent != 0, "Creating parent window returned error %lu\n", GetLastError() );
9659
9660 hchild = CreateWindowExA( 0, "SimpleWindowClass", "Test child (no border)", WS_CHILD | WS_VISIBLE,
9661 10, 10, 0, 0, hparent, 0, 0, NULL );
9662 ok( hchild != 0, "Creating child window returned error %lu\n", GetLastError() );
9663
9664 if (winetest_debug > 1) trace("testing extending zero-size window\n");
9665
9666 UpdateWindow( hparent );
9667 flush_events();
9668
9669 SetWindowPos( hchild, HWND_TOP,
9670 rect_1.left,
9671 rect_1.top,
9672 rect_1.right - rect_1.left,
9673 rect_1.bottom - rect_1.top,
9675
9676 ok( GetUpdateRgn( hparent, hrgn_actual, FALSE ) != ERROR,
9677 "GetUpdateRgn on parent shall succeed\n" );
9678 ok( GetUpdateRgn( hchild, hrgn_actual_child, FALSE ) != ERROR,
9679 "GetUpdateRgn on child shall succeed\n" );
9680
9681 result = GetRgnBox( hrgn_actual, &rect_actual );
9682 ok( result == SIMPLEREGION, "GetRgnBox (on parent) returned %d\n", result );
9683 if (result == COMPLEXREGION) dump_region( hrgn_actual );
9684
9685 rect_expect = rect_1;
9686 ok( EqualRect( &rect_actual, &rect_expect ), "parent update region: got %s, expected %s\n",
9687 wine_dbgstr_rect( &rect_actual ), wine_dbgstr_rect( &rect_expect ) );
9688
9689 result = GetRgnBox( hrgn_actual_child, &rect_actual_child );
9690 ok( result == SIMPLEREGION, "GetRgnBox (on child) returned %d\n", result );
9691 if (result == COMPLEXREGION) dump_region( hrgn_actual_child );
9692
9693 ok( GetClientRect( hchild, &rect_expect_child ), "GetClientRect failed\n" );
9694 ok( EqualRect( &rect_actual_child, &rect_expect_child ), "child update region: got %s, expected %s\n",
9695 wine_dbgstr_rect( &rect_actual_child ), wine_dbgstr_rect( &rect_expect_child ) );
9696
9697 DestroyWindow( hchild );
9698 DestroyWindow( hparent );
9699 DeleteObject( hrgn_actual_child );
9700 DeleteObject( hrgn_actual );
9701}
#define COMPLEXREGION
Definition: wingdi.h:363

Referenced by START_TEST().

◆ test_swp_paint_region_on_show()

static void test_swp_paint_region_on_show ( void  )
static

Definition at line 9551 of file msg.c.

9552{
9553 HRGN hrgn_actual_child = CreateRectRgn( 0, 0, 0, 0 );
9554 HRGN hrgn_actual = CreateRectRgn( 0, 0, 0, 0 );
9555 const RECT rect_1 = { 10, 10, 100, 100 };
9556 const RECT rect_2 = { 20, 20, 120, 120 };
9557 RECT rect_expect_child, rect_expect;
9558 RECT rect_actual_child, rect_actual;
9559 HWND hparent, hchild;
9560 int result;
9561
9562 hparent = CreateWindowExA( 0, "SimpleWindowClass", "Test parent", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
9563 80, 80, 200, 200, NULL, 0, 0, NULL );
9564 ok( hparent != 0, "Creating parent window returned error %lu\n", GetLastError() );
9565
9566 hchild = CreateWindowExA( 0, "SimpleWindowClass", "Test child", WS_CHILD | WS_BORDER,
9567 0, 0, 100, 100, hparent, 0, 0, NULL );
9568 ok( hchild != 0, "Creating child window returned error %lu\n", GetLastError() );
9569
9570 if (winetest_debug > 1) trace("testing show window (no move / size)\n");
9571
9572 SetWindowPos( hchild, HWND_TOP,
9573 rect_1.left, rect_1.top, rect_1.right - rect_1.left, rect_1.bottom - rect_1.top,
9575
9576 UpdateWindow( hparent );
9577 flush_events();
9578
9579 SetWindowPos( hchild, HWND_TOP, 0, 0, 0, 0,
9581
9582 ok( GetUpdateRgn( hparent, hrgn_actual, FALSE ) != ERROR,
9583 "GetUpdateRgn on parent shall succeed\n" );
9584 ok( GetUpdateRgn( hchild, hrgn_actual_child, FALSE ) != ERROR,
9585 "GetUpdateRgn on child shall succeed\n" );
9586
9587 result = GetRgnBox( hrgn_actual, &rect_actual );
9588 ok( result == SIMPLEREGION, "GetRgnBox (on parent) returned %d\n", result );
9589 if (result == COMPLEXREGION) dump_region( hrgn_actual );
9590
9591 rect_expect = rect_1;
9592 ok( EqualRect( &rect_actual, &rect_expect ), "parent update region: got %s, expected %s\n",
9593 wine_dbgstr_rect( &rect_actual ), wine_dbgstr_rect( &rect_expect ) );
9594
9595 result = GetRgnBox( hrgn_actual_child, &rect_actual_child );
9596 ok( result == SIMPLEREGION, "GetRgnBox (on child) returned %d\n", result );
9597 if (result == COMPLEXREGION) dump_region( hrgn_actual_child );
9598
9599 ok( GetClientRect( hchild, &rect_expect_child ), "GetClientRect failed\n" );
9600 ok( EqualRect( &rect_actual_child, &rect_expect_child ), "child update region: got %s, expected %s\n",
9601 wine_dbgstr_rect( &rect_actual_child ), wine_dbgstr_rect( &rect_expect_child ) );
9602
9603 if (winetest_debug > 1) trace("testing show window (with move / resize)\n");
9604
9605 SetWindowPos( hchild, HWND_TOP,
9606 rect_1.left, rect_1.top, rect_1.right - rect_1.left, rect_1.bottom - rect_1.top,
9608
9609 UpdateWindow( hparent );
9610 flush_events();
9611
9612 SetWindowPos( hchild, HWND_TOP,
9613 rect_2.left,
9614 rect_2.top,
9615 rect_2.right - rect_2.left,
9616 rect_2.bottom - rect_2.top,
9618
9619 ok( GetUpdateRgn( hparent, hrgn_actual, FALSE ) != ERROR,
9620 "GetUpdateRgn on parent shall succeed\n" );
9621 ok( GetUpdateRgn( hchild, hrgn_actual_child, FALSE ) != ERROR,
9622 "GetUpdateRgn on child shall succeed\n" );
9623
9624 result = GetRgnBox( hrgn_actual, &rect_actual );
9625 ok( result == SIMPLEREGION, "GetRgnBox (on parent) returned %d\n", result );
9626 if (result == COMPLEXREGION) dump_region( hrgn_actual );
9627
9628 rect_expect = rect_2;
9629 ok( EqualRect( &rect_actual, &rect_expect ), "parent update region: got %s, expected %s\n",
9630 wine_dbgstr_rect( &rect_actual ), wine_dbgstr_rect( &rect_expect ) );
9631
9632 result = GetRgnBox( hrgn_actual_child, &rect_actual_child );
9633 ok( result == SIMPLEREGION, "GetRgnBox (on child) returned %d\n", result );
9634 if (result == COMPLEXREGION) dump_region( hrgn_actual_child );
9635
9636 ok( GetClientRect( hchild, &rect_expect_child ), "GetClientRect failed\n" );
9637 ok( EqualRect( &rect_actual_child, &rect_expect_child ), "child update region: got %s, expected %s\n",
9638 wine_dbgstr_rect( &rect_actual_child ), wine_dbgstr_rect( &rect_expect_child ) );
9639
9640 DestroyWindow( hchild );
9641 DestroyWindow( hparent );
9642 DeleteObject( hrgn_actual_child );
9643 DeleteObject( hrgn_actual );
9644}

Referenced by START_TEST().

◆ test_swp_paint_regions()

static void test_swp_paint_regions ( void  )
static

Definition at line 9543 of file msg.c.

9544{
9545 subtest_swp_paint_regions( 1, "SimpleWindowClass", "SimpleWindowClass" );
9546 subtest_swp_paint_regions( 0, "SimpleWindowClass", "SimpleWindowClass" );
9547 subtest_swp_paint_regions( 0, "SimpleWindowClass", "SimpleWindowClassWithParentDC" );
9548 subtest_swp_paint_regions( 0, "SimpleWindowClassWithParentDC", "SimpleWindowClass" );
9549}
#define subtest_swp_paint_regions(w, p, c)
Definition: msg.c:9277

Referenced by START_TEST().

◆ test_sys_menu()

static void test_sys_menu ( void  )
static

Definition at line 5246 of file msg.c.

5247{
5248 HWND hwnd;
5249 HMENU hmenu;
5250 UINT state;
5251
5252 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, WS_OVERLAPPEDWINDOW,
5253 100, 100, 200, 200, 0, 0, 0, NULL);
5254 ok (hwnd != 0, "Failed to create overlapped window\n");
5255
5257
5258 /* test existing window without CS_NOCLOSE style */
5260 ok(hmenu != 0, "GetSystemMenu error %ld\n", GetLastError());
5261
5263 ok(state != 0xffffffff, "wrong SC_CLOSE state %x\n", state);
5264 ok(!(state & (MF_DISABLED | MF_GRAYED)), "wrong SC_CLOSE state %x\n", state);
5265
5267 ok_sequence(WmEmptySeq, "WmEnableMenuItem", FALSE);
5268
5270 ok(state != 0xffffffff, "wrong SC_CLOSE state %x\n", state);
5271 ok((state & (MF_DISABLED | MF_GRAYED)) == MF_GRAYED, "wrong SC_CLOSE state %x\n", state);
5272
5274 ok_sequence(WmEmptySeq, "WmEnableMenuItem", FALSE);
5275
5277 ok(state != 0xffffffff, "wrong SC_CLOSE state %x\n", state);
5278 ok(!(state & (MF_DISABLED | MF_GRAYED)), "wrong SC_CLOSE state %x\n", state);
5279
5280 /* test whether removing WS_SYSMENU destroys a system menu */
5285 ok(hmenu != 0, "GetSystemMenu error %ld\n", GetLastError());
5286
5288
5289 /* test new window with CS_NOCLOSE style */
5290 hwnd = CreateWindowExA(0, "NoCloseWindowClass", NULL, WS_OVERLAPPEDWINDOW,
5291 100, 100, 200, 200, 0, 0, 0, NULL);
5292 ok (hwnd != 0, "Failed to create overlapped window\n");
5293
5295 ok(hmenu != 0, "GetSystemMenu error %ld\n", GetLastError());
5296
5298 ok(state == 0xffffffff, "wrong SC_CLOSE state %x\n", state);
5299
5301
5302 /* test new window without WS_SYSMENU style */
5303 hwnd = CreateWindowExA(0, "NoCloseWindowClass", NULL, WS_OVERLAPPEDWINDOW & ~WS_SYSMENU,
5304 100, 100, 200, 200, 0, 0, 0, NULL);
5305 ok(hwnd != 0, "Failed to create overlapped window\n");
5306
5308 ok(!hmenu, "GetSystemMenu error %ld\n", GetLastError());
5309
5311}
#define MF_BYCOMMAND
Definition: winuser.h:202
UINT WINAPI GetMenuState(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_GRAYED
Definition: winuser.h:129
#define MF_DISABLED
Definition: winuser.h:130

Referenced by START_TEST().

◆ test_timers()

static void test_timers ( void  )
static

Definition at line 11745 of file msg.c.

11746{
11747 struct timer_info info;
11748 DWORD id;
11749 MSG msg;
11750
11751 info.hWnd = CreateWindowA("TestWindowClass", NULL,
11753 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
11754 NULL, NULL, 0);
11755
11756 info.id = SetTimer(info.hWnd,TIMER_ID,10000,tfunc);
11757 ok(info.id, "SetTimer failed\n");
11758 ok(info.id==TIMER_ID, "SetTimer timer ID different\n");
11759 info.handles[0] = CreateEventW(NULL,0,0,NULL);
11760 info.handles[1] = CreateThread(NULL,0,timer_thread_proc,&info,0,&id);
11761
11763
11764 WaitForSingleObject(info.handles[1], INFINITE);
11765
11766 CloseHandle(info.handles[0]);
11767 CloseHandle(info.handles[1]);
11768
11769 ok( KillTimer(info.hWnd, TIMER_ID), "KillTimer failed\n");
11770
11771 /* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms,
11772 * which occurs sometimes, but most testing on the VMs indicates a minimum timeout closer to
11773 * 15.6 ms.
11774 */
11775 count = 0;
11776 id = SetTimer(info.hWnd, TIMER_ID, 0, callback_count);
11777 ok(id != 0, "did not get id from SetTimer.\n");
11778 ok(id==TIMER_ID, "SetTimer timer ID different\n");
11779 while (count < TIMER_COUNT && GetMessageA(&msg, info.hWnd, 0, 0))
11783 "did not get expected median timeout (%d != ~%d).\n",
11785 ok(KillTimer(info.hWnd, id), "KillTimer failed\n");
11786 /* Perform the same check on SetSystemTimer (only available on w2k3 and older) */
11787 if (pSetSystemTimer)
11788 {
11789 count = 0;
11790 id = pSetSystemTimer(info.hWnd, TIMER_ID, 0, callback_count);
11791 ok(id != 0, "did not get id from SetSystemTimer.\n");
11792 ok(id==TIMER_ID, "SetTimer timer ID different\n");
11793 while (count < TIMER_COUNT && GetMessageA(&msg, info.hWnd, 0, 0))
11794 {
11795 if (msg.message == WM_SYSTIMER)
11796 timer_fired();
11797 ok(msg.message != WM_TIMER, "unexpected WM_TIMER\n");
11799 }
11802 "did not get expected median timeout (%d != ~%d).\n",
11804 ok(pKillSystemTimer(info.hWnd, id), "KillSystemTimer failed\n");
11805 }
11806
11807 ok(DestroyWindow(info.hWnd), "failed to destroy window\n");
11808}
#define abs(i)
Definition: fconv.c:206
#define TIMER_DURATION_TOLERANCE
Definition: msg.c:11670
static void CALLBACK callback_count(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: msg.c:11718
#define TIMER_DURATION_ALT
Definition: msg.c:11669
#define TIMER_DURATION_EXPECTED
Definition: msg.c:11668
static DWORD WINAPI timer_thread_proc(LPVOID x)
Definition: msg.c:11730
static int timer_duration
Definition: msg.c:11674
static VOID CALLBACK tfunc(HWND hwnd, UINT uMsg, UINT_PTR id, DWORD dwTime)
Definition: msg.c:11662
#define TIMER_ID
Definition: msg.c:11666
#define TIMER_COUNT
Definition: msg.c:11667
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by START_TEST(), and timers_suite().

◆ test_timers_exception()

static void test_timers_exception ( DWORD  code)
static

Definition at line 11877 of file msg.c.

11878{
11879 UINT_PTR id;
11880 MSG msg;
11881
11882 exception = code;
11883 id = SetTimer(NULL, 0, 1000, callback_exception);
11884 ok(id != 0, "did not get id from SetTimer.\n");
11885
11886 memset(&msg, 0, sizeof(msg));
11887 msg.message = WM_TIMER;
11888 msg.wParam = id;
11889 msg.lParam = (LPARAM)callback_exception;
11890
11891 count = 0;
11893 ok(count == 1, "did not get one count as expected (%i).\n", count);
11894
11895 KillTimer(NULL, id);
11896}
static void CALLBACK callback_exception(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: msg.c:11724

Referenced by test_timers_exceptions().

◆ test_timers_exceptions()

static void test_timers_exceptions ( void  )
static

Definition at line 11898 of file msg.c.

11899{
11909 test_timers_exception(0xE000BEEF); /* customer exception */
11910}
#define EXCEPTION_SINGLE_STEP
Definition: minwinbase.h:47
#define EXCEPTION_ARRAY_BOUNDS_EXCEEDED
Definition: minwinbase.h:48
#define EXCEPTION_DATATYPE_MISALIGNMENT
Definition: minwinbase.h:45
#define EXCEPTION_FLT_DENORMAL_OPERAND
Definition: minwinbase.h:49
#define EXCEPTION_FLT_INEXACT_RESULT
Definition: minwinbase.h:51
#define EXCEPTION_ILLEGAL_INSTRUCTION
Definition: minwinbase.h:60
#define EXCEPTION_ACCESS_VIOLATION
Definition: minwinbase.h:44
#define EXCEPTION_BREAKPOINT
Definition: minwinbase.h:46
#define EXCEPTION_FLT_DIVIDE_BY_ZERO
Definition: minwinbase.h:50
static void test_timers_exception(DWORD code)
Definition: msg.c:11877

Referenced by START_TEST().

◆ test_timers_no_wnd()

static void test_timers_no_wnd ( void  )
static

Definition at line 11810 of file msg.c.

11811{
11812 static UINT_PTR ids[0xffff];
11813 UINT_PTR id, id2;
11814 DWORD start;
11815 MSG msg;
11816 int i;
11817
11818 count = 0;
11819 id = SetTimer(NULL, 0, 100, callback_count);
11820 ok(id != 0, "did not get id from SetTimer.\n");
11821 id2 = SetTimer(NULL, id, 200, callback_count);
11822 ok(id2 == id, "did not get same id from SetTimer when replacing (%Ii expected %Ii).\n", id2, id);
11823 Sleep(150);
11824 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
11825 ok(count == 0, "did not get zero count as expected (%i).\n", count);
11826 Sleep(150);
11827 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
11828 ok(count == 1, "did not get one count as expected (%i).\n", count);
11829 KillTimer(NULL, id);
11830 Sleep(250);
11831 while (PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
11832 ok(count == 1, "killing replaced timer did not work (%i).\n", count);
11833
11834 /* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms,
11835 * which occurs sometimes, but most testing on the VMs indicates a minimum timeout closer to
11836 * 15.6 ms.
11837 */
11838 count = 0;
11839 id = SetTimer(NULL, 0, 0, callback_count);
11840 ok(id != 0, "did not get id from SetTimer.\n");
11841 while (count < TIMER_COUNT && GetMessageA(&msg, NULL, 0, 0))
11845 "did not get expected median timeout (%d != ~%d).\n",
11847 KillTimer(NULL, id);
11848 /* Note: SetSystemTimer doesn't support a NULL window, see test_timers */
11849
11850 if (pSetCoalescableTimer)
11851 {
11852 count = 0;
11853 id = pSetCoalescableTimer(NULL, 0, 0, callback_count, 0);
11854 ok(id != 0, "SetCoalescableTimer failed with %lu.\n", GetLastError());
11855 start = GetTickCount();
11856 while (GetTickCount()-start < 100 && GetMessageA(&msg, NULL, 0, 0))
11858 ok(count > 1, "expected count > 1, got %d.\n", count);
11859 KillTimer(NULL, id);
11860 }
11861 else
11862 win_skip("SetCoalescableTimer not available.\n");
11863
11864 /* Check what happens when we're running out of timers */
11865 for (i = 0; i < ARRAY_SIZE(ids); i++)
11866 {
11867 SetLastError(0xdeadbeef);
11869 if (!ids[i]) break;
11870 }
11871 ok(i != ARRAY_SIZE(ids), "all timers were created successfully\n");
11873 "GetLastError() = %ld\n", GetLastError());
11874 while (i > 0) KillTimer(NULL, ids[--i]);
11875}
GLuint * ids
Definition: glext.h:5907
#define ERROR_NO_MORE_USER_HANDLES
Definition: winerror.h:1004
#define USER_TIMER_MAXIMUM
Definition: winuser.h:916

Referenced by START_TEST().

◆ test_TrackMouseEvent()

static void test_TrackMouseEvent ( void  )
static

Definition at line 14875 of file msg.c.

14876{
14877 TRACKMOUSEEVENT tme;
14878 BOOL ret;
14879 HWND hwnd, hchild;
14880 RECT rc_parent, rc_child;
14881 UINT default_hover_time, hover_width = 0, hover_height = 0;
14882
14883#define track_hover(track_hwnd, track_hover_time) \
14884 tme.cbSize = sizeof(tme); \
14885 tme.dwFlags = TME_HOVER; \
14886 tme.hwndTrack = track_hwnd; \
14887 tme.dwHoverTime = track_hover_time; \
14888 SetLastError(0xdeadbeef); \
14889 ret = pTrackMouseEvent(&tme); \
14890 ok(ret, "TrackMouseEvent(TME_HOVER) error %ld\n", GetLastError())
14891
14892#define track_query(expected_track_flags, expected_track_hwnd, expected_hover_time) \
14893 tme.cbSize = sizeof(tme); \
14894 tme.dwFlags = TME_QUERY; \
14895 tme.hwndTrack = (HWND)0xdeadbeef; \
14896 tme.dwHoverTime = 0xdeadbeef; \
14897 SetLastError(0xdeadbeef); \
14898 ret = pTrackMouseEvent(&tme); \
14899 ok(ret, "TrackMouseEvent(TME_QUERY) error %ld\n", GetLastError());\
14900 ok(tme.cbSize == sizeof(tme), "wrong tme.cbSize %lu\n", tme.cbSize); \
14901 ok(tme.dwFlags == (expected_track_flags), \
14902 "wrong tme.dwFlags %08lx, expected %08x\n", tme.dwFlags, (expected_track_flags)); \
14903 ok(tme.hwndTrack == (expected_track_hwnd), \
14904 "wrong tme.hwndTrack %p, expected %p\n", tme.hwndTrack, (expected_track_hwnd)); \
14905 ok(tme.dwHoverTime == (expected_hover_time), \
14906 "wrong tme.dwHoverTime %lu, expected %u\n", tme.dwHoverTime, (expected_hover_time))
14907
14908#define track_hover_cancel(track_hwnd) \
14909 tme.cbSize = sizeof(tme); \
14910 tme.dwFlags = TME_HOVER | TME_CANCEL; \
14911 tme.hwndTrack = track_hwnd; \
14912 tme.dwHoverTime = 0xdeadbeef; \
14913 SetLastError(0xdeadbeef); \
14914 ret = pTrackMouseEvent(&tme); \
14915 ok(ret, "TrackMouseEvent(TME_HOVER | TME_CANCEL) error %ld\n", GetLastError())
14916
14917 default_hover_time = 0xdeadbeef;
14918 SetLastError(0xdeadbeef);
14919 ret = SystemParametersInfoA(SPI_GETMOUSEHOVERTIME, 0, &default_hover_time, 0);
14920 ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */
14921 "SystemParametersInfo(SPI_GETMOUSEHOVERTIME) error %lu\n", GetLastError());
14922 if (!ret) default_hover_time = 400;
14923 if (winetest_debug > 1) trace("SPI_GETMOUSEHOVERTIME returned %u ms\n", default_hover_time);
14924
14925 SetLastError(0xdeadbeef);
14926 ret = SystemParametersInfoA(SPI_GETMOUSEHOVERWIDTH, 0, &hover_width, 0);
14927 ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */
14928 "SystemParametersInfo(SPI_GETMOUSEHOVERWIDTH) error %lu\n", GetLastError());
14929 if (!ret) hover_width = 4;
14930 SetLastError(0xdeadbeef);
14931 ret = SystemParametersInfoA(SPI_GETMOUSEHOVERHEIGHT, 0, &hover_height, 0);
14932 ok(ret || broken(GetLastError() == 0xdeadbeef), /* win9x */
14933 "SystemParametersInfo(SPI_GETMOUSEHOVERHEIGHT) error %lu\n", GetLastError());
14934 if (!ret) hover_height = 4;
14935 if (winetest_debug > 1) trace("hover rect is %u x %d\n", hover_width, hover_height);
14936
14937 hwnd = CreateWindowExA(0, "TestWindowClass", NULL,
14939 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
14940 NULL, NULL, 0);
14941 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
14942
14943 hchild = CreateWindowExA(0, "TestWindowClass", NULL,
14945 50, 50, 200, 200, hwnd,
14946 NULL, NULL, 0);
14947 ok(!!hchild, "Failed to create window, error %lu.\n", GetLastError());
14948
14950 flush_events();
14952
14953 tme.cbSize = 0;
14954 tme.dwFlags = TME_QUERY;
14955 tme.hwndTrack = (HWND)0xdeadbeef;
14956 tme.dwHoverTime = 0xdeadbeef;
14957 SetLastError(0xdeadbeef);
14958 ret = pTrackMouseEvent(&tme);
14959 ok(!ret, "TrackMouseEvent should fail\n");
14961 "not expected error %lu\n", GetLastError());
14962
14963 tme.cbSize = sizeof(tme);
14964 tme.dwFlags = TME_HOVER;
14965 tme.hwndTrack = (HWND)0xdeadbeef;
14966 tme.dwHoverTime = 0xdeadbeef;
14967 SetLastError(0xdeadbeef);
14968 ret = pTrackMouseEvent(&tme);
14969 ok(!ret, "TrackMouseEvent should fail\n");
14971 "not expected error %lu\n", GetLastError());
14972
14973 tme.cbSize = sizeof(tme);
14975 tme.hwndTrack = (HWND)0xdeadbeef;
14976 tme.dwHoverTime = 0xdeadbeef;
14977 SetLastError(0xdeadbeef);
14978 ret = pTrackMouseEvent(&tme);
14979 ok(!ret, "TrackMouseEvent should fail\n");
14981 "not expected error %lu\n", GetLastError());
14982
14983 GetWindowRect(hwnd, &rc_parent);
14984 GetWindowRect(hchild, &rc_child);
14985 SetCursorPos(rc_child.left - 10, rc_child.top - 10);
14986
14987 /* Process messages so that the system updates its internal current
14988 * window and hittest, otherwise TrackMouseEvent calls don't have any
14989 * effect.
14990 */
14991 flush_events();
14993
14994 track_query(0, NULL, 0);
14995 track_hover(hchild, 0);
14996 track_query(0, NULL, 0);
14997
14998 flush_events();
15000
15001 track_hover(hwnd, 0);
15002 tme.cbSize = sizeof(tme);
15003 tme.dwFlags = TME_QUERY;
15004 tme.hwndTrack = (HWND)0xdeadbeef;
15005 tme.dwHoverTime = 0xdeadbeef;
15006 SetLastError(0xdeadbeef);
15007 ret = pTrackMouseEvent(&tme);
15008 ok(ret, "TrackMouseEvent(TME_QUERY) error %ld\n", GetLastError());
15009 ok(tme.cbSize == sizeof(tme), "wrong tme.cbSize %lu\n", tme.cbSize);
15010 if (!tme.dwFlags)
15011 {
15012 skip( "Cursor not inside window, skipping TrackMouseEvent tests\n" );
15014 return;
15015 }
15016 ok(tme.dwFlags == TME_HOVER, "wrong tme.dwFlags %08lx, expected TME_HOVER\n", tme.dwFlags);
15017 ok(tme.hwndTrack == hwnd, "wrong tme.hwndTrack %p, expected %p\n", tme.hwndTrack, hwnd);
15018 ok(tme.dwHoverTime == default_hover_time, "wrong tme.dwHoverTime %lu, expected %u\n",
15019 tme.dwHoverTime, default_hover_time);
15020
15021 pump_msg_loop_timeout(default_hover_time, FALSE);
15022 ok_sequence(WmMouseHoverSeq, "WmMouseHoverSeq", FALSE);
15023
15024 track_query(0, NULL, 0);
15025
15027 track_query(TME_HOVER, hwnd, default_hover_time);
15028
15029 Sleep(default_hover_time / 2);
15030 mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0);
15031 mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0);
15032
15033 track_query(TME_HOVER, hwnd, default_hover_time);
15034
15035 pump_msg_loop_timeout(default_hover_time, FALSE);
15036 ok_sequence(WmMouseHoverSeq, "WmMouseHoverSeq", FALSE);
15037
15038 track_query(0, NULL, 0);
15039
15041 track_query(TME_HOVER, hwnd, default_hover_time);
15042
15043 pump_msg_loop_timeout(default_hover_time, TRUE);
15044 ok_sequence(WmMouseHoverSeq, "WmMouseHoverSeq", FALSE);
15045
15046 track_query(0, NULL, 0);
15047
15049 track_query(TME_HOVER, hwnd, default_hover_time);
15051
15053
15054#undef track_hover
15055#undef track_query
15056#undef track_hover_cancel
15057}
static void pump_msg_loop_timeout(DWORD timeout, BOOL inject_mouse_move)
Definition: msg.c:14831
#define track_query(expected_track_flags, expected_track_hwnd, expected_hover_time)
static const struct message WmMouseHoverSeq[]
Definition: msg.c:14821
#define track_hover_cancel(track_hwnd)
#define track_hover(track_hwnd, track_hover_time)
#define HOVER_DEFAULT
Definition: commctrl.h:5003
BOOL WINAPI SystemParametersInfoA(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by START_TEST().

◆ test_TrackPopupMenu()

static void test_TrackPopupMenu ( void  )
static

Definition at line 20054 of file msg.c.

20055{
20056 MSG msg;
20057 HWND hwnd;
20058 BOOL ret;
20059
20060 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0,
20061 0, 0, 1, 1, 0,
20062 NULL, NULL, 0);
20063 ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
20064
20066
20068 ok(hpopupmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
20069
20070 AppendMenuA(hpopupmenu, MF_STRING, 100, "item 1");
20071 AppendMenuA(hpopupmenu, MF_STRING, 100, "item 2");
20072
20073 flush_events();
20075 ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
20076 ok_sequence(WmTrackPopupMenu, "TrackPopupMenu", TRUE);
20077 ok(ret == 1, "TrackPopupMenu failed with error %li\n", GetLastError());
20078
20079 /* Test popup closing with an ESC-press */
20080 flush_events();
20082 ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
20083 ok(ret == 1, "TrackPopupMenu failed with error %li\n", GetLastError());
20084 PostQuitMessage(0);
20086 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
20087 {
20090 }
20091 ok_sequence(WmTrackPopupMenuEsc, "TrackPopupMenuEsc", FALSE); /* Shouldn't get any message */
20092
20094
20095 flush_events();
20097 ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
20098 ok_sequence(WmTrackPopupMenuAbort, "WmTrackPopupMenuAbort", TRUE);
20099 ok(ret == TRUE, "TrackPopupMenu failed\n");
20100
20102
20103 /* set cursor over the window, otherwise the WM_CANCELMODE message may not always be sent */
20104 SetCursorPos( 0, 0 );
20106
20107 flush_events();
20109 SetTimer( hwnd, TIMER_ID, 500, NULL );
20110 ret = TrackPopupMenu( hpopupmenu, 0, 100,100, 0, hwnd, NULL );
20111#ifdef __REACTOS__
20113#endif
20114 ok_sequence( WmTrackPopupMenuMinimizeWindow, "TrackPopupMenuMinimizeWindow", TRUE );
20115 ok( ret == 1, "TrackPopupMenu failed with error %li\n", GetLastError() );
20118
20120
20122
20123 flush_events();
20125 ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
20126 ok_sequence(WmTrackPopupMenuCapture, "TrackPopupMenuCapture", TRUE);
20127 ok(ret == 1, "TrackPopupMenuCapture failed with error %li\n", GetLastError());
20128
20131}
static const struct message WmTrackPopupMenuMinimizeWindow[]
Definition: msg.c:2170
static const struct message WmTrackPopupMenuAbort[]
Definition: msg.c:2308
static const struct message WmTrackPopupMenu[]
Definition: msg.c:2222
static LRESULT WINAPI cancel_init_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:20041
static const struct message WmTrackPopupMenuEsc[]
Definition: msg.c:2251
static LRESULT WINAPI cancel_popup_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:20019
static const struct message WmTrackPopupMenuCapture[]
Definition: msg.c:2255
static LRESULT WINAPI minimize_popup_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: msg.c:20000
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
#define MF_STRING
Definition: winuser.h:138
BOOL WINAPI AppendMenuA(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)

Referenced by START_TEST().

◆ test_TrackPopupMenuEmpty()

static void test_TrackPopupMenuEmpty ( void  )
static

Definition at line 20133 of file msg.c.

20134{
20135 HWND hwnd;
20136 BOOL ret;
20137
20138 hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0,
20139 0, 0, 1, 1, 0,
20140 NULL, NULL, 0);
20141 ok(hwnd != NULL, "CreateWindowEx failed with error %ld\n", GetLastError());
20142
20144
20146 ok(hpopupmenu != NULL, "CreateMenu failed with error %ld\n", GetLastError());
20147
20148 flush_events();
20150 ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL);
20151 ok_sequence(WmTrackPopupMenuEmpty, "TrackPopupMenuEmpty", TRUE);
20152 ok(ret == 0, "TrackPopupMenu succeeded\n");
20153
20156}
static const struct message WmTrackPopupMenuEmpty[]
Definition: msg.c:2286

Referenced by START_TEST().

◆ test_unicode_wm_char()

static void test_unicode_wm_char ( void  )
static

Definition at line 16886 of file msg.c.

16887{
16888 HWND hwnd;
16889 MSG msg;
16890 struct message seq[2];
16891 HKL hkl_orig, hkl_greek;
16892 DWORD cp;
16893 LCID thread_locale;
16894
16895 hkl_orig = GetKeyboardLayout( 0 );
16896 GetLocaleInfoW( LOWORD( hkl_orig ), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, (WCHAR*)&cp, sizeof(cp) / sizeof(WCHAR) );
16897 if (cp != 1252)
16898 {
16899 skip( "Default codepage %ld\n", cp );
16900 return;
16901 }
16902
16903 hkl_greek = LoadKeyboardLayoutA( "00000408", 0 );
16904 if (!hkl_greek || hkl_greek == hkl_orig /* win2k */)
16905 {
16906 skip( "Unable to load Greek keyboard layout\n" );
16907 return;
16908 }
16909
16911 100, 100, 200, 200, 0, 0, 0, NULL );
16913
16914 PostMessageW( hwnd, WM_CHAR, 0x3b1, 0 );
16915
16916 while (GetMessageW( &msg, hwnd, 0, 0 ))
16917 {
16918 if (!ignore_message( msg.message )) break;
16919 }
16920
16921 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16922 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16923 ok( msg.wParam == 0x3b1, "bad wparam %Ix\n", msg.wParam );
16924 ok( msg.lParam == 0, "bad lparam %Ix\n", msg.lParam );
16925
16927
16928 memset( seq, 0, sizeof(seq) );
16929 seq[0].message = WM_CHAR;
16930 seq[0].flags = sent|wparam;
16931 seq[0].wParam = 0x3b1;
16932
16933 ok_sequence( seq, "unicode WM_CHAR", FALSE );
16934
16936
16937 /* greek alpha -> 'a' in cp1252 */
16938 PostMessageW( hwnd, WM_CHAR, 0x3b1, 0 );
16939
16940 ok( GetMessageA( &msg, hwnd, 0, 0 ), "no message\n" );
16941 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16942 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16943 ok( msg.wParam == 0x61, "bad wparam %Ix\n", msg.wParam );
16944 ok( msg.lParam == 0, "bad lparam %Ix\n", msg.lParam );
16945
16947
16948 seq[0].wParam = 0x61;
16949 ok_sequence( seq, "unicode WM_CHAR", FALSE );
16950
16951 thread_locale = GetThreadLocale();
16952 ActivateKeyboardLayout( hkl_greek, 0 );
16953 ok( GetThreadLocale() == thread_locale, "locale changed from %08lx to %08lx\n",
16954 thread_locale, GetThreadLocale() );
16955
16957
16958 /* greek alpha -> 0xe1 in cp1253 */
16959 PostMessageW( hwnd, WM_CHAR, 0x3b1, 0 );
16960
16961 ok( GetMessageA( &msg, hwnd, 0, 0 ), "no message\n" );
16962 ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd );
16963 ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message );
16964 ok( msg.wParam == 0xe1, "bad wparam %Ix\n", msg.wParam );
16965 ok( msg.lParam == 0, "bad lparam %Ix\n", msg.lParam );
16966
16968
16969 seq[0].wParam = 0x3b1;
16970 ok_sequence( seq, "unicode WM_CHAR", FALSE );
16971
16973 ActivateKeyboardLayout( hkl_orig, 0 );
16974}
LCID WINAPI GetThreadLocale(void)
Definition: locale.c:2803
DWORD LCID
Definition: nls.h:13
HKL WINAPI LoadKeyboardLayoutA(_In_ LPCSTR, _In_ UINT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)

Referenced by START_TEST().

◆ test_WaitForInputIdle()

static void test_WaitForInputIdle ( char argv0)
static

Definition at line 18842 of file msg.c.

18843{
18844 char path[MAX_PATH];
18847 BOOL ret;
18848 HANDLE start_event, end_event, thread;
18849 unsigned int i;
18850 DWORD id;
18852 const IMAGE_NT_HEADERS *nt = (const IMAGE_NT_HEADERS *)((const char *)dos + dos->e_lfanew);
18854
18855 if (console_app) /* build the test with -mwindows for better coverage */
18856 trace( "not built as a GUI app, WaitForInputIdle may not be fully tested\n" );
18857
18858 start_event = CreateEventA(NULL, 0, 0, "test_WaitForInputIdle_start");
18859 end_event = CreateEventA(NULL, 0, 0, "test_WaitForInputIdle_end");
18860 ok(start_event != 0, "failed to create start event, error %lu\n", GetLastError());
18861 ok(end_event != 0, "failed to create end event, error %lu\n", GetLastError());
18862
18863 memset( &startup, 0, sizeof(startup) );
18864 startup.cb = sizeof(startup);
18865 startup.dwFlags = STARTF_USESHOWWINDOW;
18866 startup.wShowWindow = SW_SHOWNORMAL;
18867
18868 thread = CreateThread( NULL, 0, wait_idle_thread, NULL, 0, &id );
18869
18870 for (i = 0; i < ARRAY_SIZE(wait_idle_expect); i++)
18871 {
18873 ResetEvent( end_event );
18874 sprintf( path, "%s msg %u", argv0, i );
18876 ok( ret, "CreateProcess '%s' failed err %lu.\n", path, GetLastError() );
18877 if (ret)
18878 {
18880 ok( ret == WAIT_OBJECT_0, "%u: WaitForSingleObject failed\n", i );
18881 if (ret == WAIT_OBJECT_0)
18882 {
18883 ret = WaitForInputIdle( pi.hProcess, 1000 );
18884 if (ret == WAIT_FAILED)
18885 ok( console_app ||
18886 ret == wait_idle_expect[i].exp ||
18888 "%u: WaitForInputIdle error %08x expected %08lx\n",
18889 i, ret, wait_idle_expect[i].exp );
18892 "%u: WaitForInputIdle error %08x expected %08lx\n",
18893 i, ret, wait_idle_expect[i].exp );
18894 SetEvent( end_event );
18895 WaitForSingleObject( pi.hProcess, 1000 ); /* give it a chance to exit on its own */
18896 }
18897 TerminateProcess( pi.hProcess, 0 ); /* just in case */
18899 ret = WaitForInputIdle( pi.hProcess, 100 );
18900 ok( ret == WAIT_FAILED, "%u: WaitForInputIdle after exit error %08x\n", i, ret );
18903 }
18904 }
18905 CloseHandle( end_event );
18907 PostThreadMessageA( id, WM_QUIT, 0, 0 );
18908 WaitForSingleObject( thread, 10000 );
18910}
static void startup(void)
PIMAGE_NT_HEADERS nt
Definition: delayimp.cpp:445
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1376
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:686
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
IMAGE_DOS_HEADER dos
Definition: module.c:67
DWORD exp
Definition: msg.c:18625
static DWORD CALLBACK wait_idle_thread(void *arg)
Definition: msg.c:18823
static const struct @1864 wait_idle_expect[]
#define IMAGE_SUBSYSTEM_WINDOWS_GUI
Definition: ntimage.h:437
#define wait_child_process
Definition: test.h:159
static char argv0[MAX_PATH]
Definition: shlexec.c:49
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
#define STARTF_USESHOWWINDOW
Definition: winbase.h:468
#define WAIT_FAILED
Definition: winbase.h:390
DWORD WINAPI WaitForInputIdle(_In_ HANDLE, _In_ DWORD)

Referenced by START_TEST().

◆ test_winevents()

static void test_winevents ( void  )
static

Definition at line 12172 of file msg.c.

12173{
12174 BOOL ret;
12175 MSG msg;
12176 HWND hwnd, hwnd2;
12177 UINT i;
12178 HANDLE hthread, hevent;
12179 DWORD tid;
12181 const struct message *events = WmWinEventsSeq;
12182
12183 hwnd = CreateWindowExA(0, "TestWindowClass", NULL,
12185 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
12186 NULL, NULL, 0);
12187 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
12188
12189 /****** start of global hook test *************/
12191 if (!hCBT_global_hook)
12192 {
12193 ok(DestroyWindow(hwnd), "failed to destroy window\n");
12194 skip( "cannot set global hook\n" );
12195 return;
12196 }
12197
12198 hevent = CreateEventA(NULL, 0, 0, NULL);
12199 ok(!!hevent, "Failed to create event, error %lu.\n", GetLastError());
12200 hwnd2 = hevent;
12201
12202 hthread = CreateThread(NULL, 0, cbt_global_hook_thread_proc, &hwnd2, 0, &tid);
12203 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
12204
12205 ok(WaitForSingleObject(hevent, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12206
12207 ok_sequence(WmGlobalHookSeq_1, "global hook 1", FALSE);
12208
12210 /* this one should be received only by old hook proc */
12212 /* this one should be received only by old hook proc */
12214
12215 ok_sequence(WmGlobalHookSeq_2, "global hook 2", FALSE);
12216
12218 ok( ret, "UnhookWindowsHookEx error %ld\n", GetLastError());
12219
12221 ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12222 CloseHandle(hthread);
12224 ok(!IsWindow(hwnd2), "window should be destroyed on thread exit\n");
12225 /****** end of global hook test *************/
12226
12227 if (!pSetWinEventHook || !pNotifyWinEvent || !pUnhookWinEvent)
12228 {
12229 ok(DestroyWindow(hwnd), "failed to destroy window\n");
12230 return;
12231 }
12232
12234
12235 if (0)
12236 {
12237 /* this test doesn't pass under Win9x */
12238 /* win2k ignores events with hwnd == 0 */
12239 SetLastError(0xdeadbeef);
12240 pNotifyWinEvent(events[0].message, 0, events[0].wParam, events[0].lParam);
12241 ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || /* Win2k */
12242 GetLastError() == 0xdeadbeef, /* Win9x */
12243 "unexpected error %ld\n", GetLastError());
12244 ok_sequence(WmEmptySeq, "empty notify winevents", FALSE);
12245 }
12246
12247 for (i = 0; i < ARRAY_SIZE(WmWinEventsSeq); i++)
12248 pNotifyWinEvent(events[i].message, hwnd, events[i].wParam, events[i].lParam);
12249
12250 ok_sequence(WmWinEventsSeq, "notify winevents", FALSE);
12251
12252 /****** start of event filtering test *************/
12253 hhook = pSetWinEventHook(
12254 EVENT_OBJECT_SHOW, /* 0x8002 */
12255 EVENT_OBJECT_LOCATIONCHANGE, /* 0x800B */
12259 ok(hhook != 0, "SetWinEventHook error %ld\n", GetLastError());
12260
12261 hevent = CreateEventA(NULL, 0, 0, NULL);
12262 ok(!!hevent, "Failed to create event, error %lu.\n", GetLastError());
12263 hwnd2 = hevent;
12264
12265 hthread = CreateThread(NULL, 0, win_event_global_thread_proc, &hwnd2, 0, &tid);
12266 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
12267
12268 ok(WaitForSingleObject(hevent, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12269
12270 ok_sequence(WmWinEventAlertSeq, "alert winevent", FALSE);
12271
12273 /* this one should be received only by old hook proc */
12274 pNotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_CARET, 0); /* 0x8000 */
12275 pNotifyWinEvent(EVENT_OBJECT_SHOW, hwnd, OBJID_CARET, 0); /* 0x8002 */
12276 /* this one should be received only by old hook proc */
12277 pNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hwnd, OBJID_CARET, 0); /* 0x800C */
12278
12279 ok_sequence(WmWinEventCaretSeq, "caret winevent", FALSE);
12280
12281 ret = pUnhookWinEvent(hhook);
12282 ok( ret, "UnhookWinEvent error %ld\n", GetLastError());
12283
12285 ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12286 CloseHandle(hthread);
12288 ok(!IsWindow(hwnd2), "window should be destroyed on thread exit\n");
12289 /****** end of event filtering test *************/
12290
12291 /****** start of out of context event test *************/
12292 hhook = pSetWinEventHook(EVENT_MIN, EVENT_MAX, 0,
12295 ok(hhook != 0, "SetWinEventHook error %ld\n", GetLastError());
12296
12297 hevent = CreateEventA(NULL, 0, 0, NULL);
12298 ok(!!hevent, "Failed to create event, error %lu.\n", GetLastError());
12299 hwnd2 = hevent;
12300
12302
12303 hthread = CreateThread(NULL, 0, win_event_global_thread_proc, &hwnd2, 0, &tid);
12304 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
12305
12306 ok(WaitForSingleObject(hevent, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12307
12308 ok_sequence(WmEmptySeq, "empty notify winevents", FALSE);
12309 /* process pending winevent messages */
12310 ok(!PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE), "msg queue should be empty\n");
12311 ok_sequence(WmWinEventAlertSeq_2, "alert winevent for out of context proc", FALSE);
12312
12314 /* this one should be received only by old hook proc */
12315 pNotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_CARET, 0); /* 0x8000 */
12316 pNotifyWinEvent(EVENT_OBJECT_SHOW, hwnd, OBJID_CARET, 0); /* 0x8002 */
12317 /* this one should be received only by old hook proc */
12318 pNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hwnd, OBJID_CARET, 0); /* 0x800C */
12319
12320 ok_sequence(WmWinEventCaretSeq_2, "caret winevent for incontext proc", FALSE);
12321 /* process pending winevent messages */
12322 ok(!PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE), "msg queue should be empty\n");
12323 ok_sequence(WmWinEventCaretSeq_2, "caret winevent for out of context proc", FALSE);
12324
12325 ret = pUnhookWinEvent(hhook);
12326 ok( ret, "UnhookWinEvent error %ld\n", GetLastError());
12327
12329 ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12330 CloseHandle(hthread);
12332 ok(!IsWindow(hwnd2), "window should be destroyed on thread exit\n");
12333 /****** end of out of context event test *************/
12334
12335 /****** start of MOUSE_LL hook test *************/
12337 /* WH_MOUSE_LL is not supported on Win9x platforms */
12338 if (!hCBT_global_hook)
12339 {
12340 win_skip("Skipping WH_MOUSE_LL test on this platform\n");
12341 goto skip_mouse_ll_hook_test;
12342 }
12343
12344 hevent = CreateEventA(NULL, 0, 0, NULL);
12345 ok(!!hevent, "Failed to create event, error %lu.\n", GetLastError());
12346 hwnd2 = hevent;
12347
12348 hthread = CreateThread(NULL, 0, mouse_ll_global_thread_proc, &hwnd2, 0, &tid);
12349 ok(hthread != NULL, "CreateThread failed, error %ld\n", GetLastError());
12350
12351 while (WaitForSingleObject(hevent, 100) == WAIT_TIMEOUT)
12352 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
12353
12354 ok_sequence(WmMouseLLHookSeq, "MOUSE_LL hook other thread", FALSE);
12356
12357 mouse_event(MOUSEEVENTF_MOVE, -1, 0, 0, 0);
12358 mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
12359 mouse_event(MOUSEEVENTF_MOVE, 1, 0, 0, 0);
12360
12361 ok_sequence(WmMouseLLHookSeq, "MOUSE_LL hook same thread", FALSE);
12362
12364 ok( ret, "UnhookWindowsHookEx error %ld\n", GetLastError());
12365
12367 ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n");
12368 CloseHandle(hthread);
12370 ok(!IsWindow(hwnd2), "window should be destroyed on thread exit\n");
12371 /****** end of MOUSE_LL hook test *************/
12372skip_mouse_ll_hook_test:
12373
12374 ok(DestroyWindow(hwnd), "failed to destroy window\n");
12375}
HANDLE events[2]
Definition: event.c:4
static const struct message WmWinEventAlertSeq_2[]
Definition: msg.c:11957
static const struct message WmWinEventAlertSeq[]
Definition: msg.c:11953
static const struct message WmWinEventCaretSeq_2[]
Definition: msg.c:11947
static const struct message WmWinEventsSeq[]
Definition: msg.c:11913
static DWORD WINAPI cbt_global_hook_thread_proc(void *param)
Definition: msg.c:12105
static const struct message WmGlobalHookSeq_1[]
Definition: msg.c:11964
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)
Definition: msg.c:11987
static const struct message WmWinEventCaretSeq[]
Definition: msg.c:11940
static LRESULT CALLBACK cbt_global_hook_proc(int nCode, WPARAM wParam, LPARAM lParam)
Definition: msg.c:12018
static const struct message WmGlobalHookSeq_2[]
Definition: msg.c:11972
static const struct message WmMouseLLHookSeq[]
Definition: msg.c:11980
static DWORD WINAPI mouse_ll_global_thread_proc(void *param)
Definition: msg.c:12141
static DWORD WINAPI win_event_global_thread_proc(void *param)
Definition: msg.c:12078
#define OBJID_CARET
Definition: winable.h:23

Referenced by START_TEST().

◆ test_WM_DEVICECHANGE()

static void test_WM_DEVICECHANGE ( HWND  hwnd)
static

Definition at line 5477 of file msg.c.

5478{
5479 DWORD ret;
5480 MSG msg;
5481 int i;
5482 static const WPARAM wparams[] = {0,
5489 DBT_CONFIGMGPRIVATE, /* 0x7fff */
5490 DBT_DEVICEARRIVAL, /* 0x8000 */
5497
5498 for (i = 0; i < ARRAY_SIZE(wparams); i++)
5499 {
5500 SetLastError(0xdeadbeef);
5501 ret = PostMessageA(hwnd, WM_DEVICECHANGE, wparams[i], 0);
5502 if (wparams[i] & 0x8000)
5503 {
5504 ok(ret == FALSE, "PostMessage returned %ld\n", ret);
5505 ok(GetLastError() == ERROR_MESSAGE_SYNC_ONLY, "PostMessage error %08lx\n", GetLastError());
5506 }
5507 else
5508 {
5510 ok(ret == WAIT_OBJECT_0, "MsgWaitForMultipleObjects returned %lx\n", ret);
5511 memset(&msg, 0, sizeof(msg));
5512 ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "PeekMessage should succeed\n");
5513 ok(msg.message == WM_DEVICECHANGE, "got %04x instead of WM_DEVICECHANGE\n", msg.message);
5514 }
5515 }
5516}
#define DBT_DEVICEREMOVEPENDING
Definition: dbt.h:15
#define DBT_DEVICETYPESPECIFIC
Definition: dbt.h:17
#define DBT_DEVNODES_CHANGED
Definition: dbt.h:28
#define DBT_CONFIGCHANGECANCELED
Definition: dbt.h:31
#define DBT_QUERYCHANGECONFIG
Definition: dbt.h:29
#define DBT_DEVICEQUERYREMOVE
Definition: dbt.h:13
#define DBT_DEVICEREMOVECOMPLETE
Definition: dbt.h:16
#define DBT_DEVICEQUERYREMOVEFAILED
Definition: dbt.h:14
#define DBT_NO_DISK_SPACE
Definition: dbt.h:9
#define DBT_LOW_DISK_SPACE
Definition: dbt.h:10
#define DBT_CONFIGMGPRIVATE
Definition: dbt.h:11
#define DBT_CUSTOMEVENT
Definition: dbt.h:18
#define DBT_CONFIGCHANGED
Definition: dbt.h:30

Referenced by test_messages().

◆ test_WM_SETREDRAW()

static void test_WM_SETREDRAW ( HWND  hwnd)
static

Definition at line 4765 of file msg.c.

4766{
4768
4769 flush_events();
4771
4773 ok_sequence(WmSetRedrawFalseSeq, "SetRedraw:FALSE", FALSE);
4774
4775 ok(!(GetWindowLongA(hwnd, GWL_STYLE) & WS_VISIBLE), "WS_VISIBLE should NOT be set\n");
4776 ok(!IsWindowVisible(hwnd), "IsWindowVisible() should return FALSE\n");
4777
4780 ok_sequence(WmSetRedrawTrueSeq, "SetRedraw:TRUE", FALSE);
4781
4782 ok(GetWindowLongA(hwnd, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
4783 ok(IsWindowVisible(hwnd), "IsWindowVisible() should return TRUE\n");
4784
4785 /* restore original WS_VISIBLE state */
4787
4788 flush_events();
4790}
static const struct message WmSetRedrawFalseSeq[]
Definition: msg.c:2004
static const struct message WmSetRedrawTrueSeq[]
Definition: msg.c:2010

Referenced by test_messages().

◆ test_wmime_keydown_message()

static void test_wmime_keydown_message ( void  )
static

Definition at line 8261 of file msg.c.

8262{
8263 HWND hwnd;
8264 MSG msg;
8265
8266 if (winetest_debug > 1) trace("Message sequences by WM_IME_KEYDOWN\n");
8267
8269 hwnd = CreateWindowExA(0, "wmime_keydown_class", NULL, WS_OVERLAPPEDWINDOW,
8270 CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, 0,
8271 NULL, NULL, 0);
8272 flush_events();
8274
8276 SendMessageA(hwnd, WM_CHAR, 'A', 1);
8277 ok_sequence(WmImeKeydownMsgSeq_0, "WM_IME_KEYDOWN 0", FALSE);
8278
8279 while ( PeekMessageA(&msg, 0, 0, 0, PM_REMOVE) )
8280 {
8283 }
8284 ok_sequence(WmImeKeydownMsgSeq_1, "WM_IME_KEYDOWN 1", FALSE);
8285
8287}
static const struct message WmImeKeydownMsgSeq_0[]
Definition: msg.c:8221
static void register_wmime_keydown_class(void)
Definition: msg.c:8250
static const struct message WmImeKeydownMsgSeq_1[]
Definition: msg.c:8228
#define WM_IME_KEYDOWN
Definition: winuser.h:1866

Referenced by START_TEST().

◆ TestDlgProcA()

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

Definition at line 11121 of file msg.c.

11122{
11123 static LONG defwndproc_counter = 0;
11124 LRESULT ret;
11125 struct recvd_message msg;
11126
11127 if (ignore_message( message )) return 0;
11128
11129 if (test_def_id)
11130 {
11132 ret = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
11133 if (after_end_dialog)
11134 ok( ret == 0, "DM_GETDEFID should return 0 after EndDialog, got %Ix\n", ret );
11135 else
11136 ok(HIWORD(ret) == DC_HASDEFID, "DM_GETDEFID should return DC_HASDEFID, got %Ix\n", ret);
11137 }
11138
11139 msg.hwnd = hwnd;
11140 msg.message = message;
11141 msg.flags = sent|wparam|lparam;
11142 if (defwndproc_counter) msg.flags |= defwinproc;
11143 msg.wParam = wParam;
11144 msg.lParam = lParam;
11145 msg.descr = "dialog";
11146 add_message(&msg);
11147
11148 defwndproc_counter++;
11150 defwndproc_counter--;
11151
11152 return ret;
11153}
#define DM_SETDEFID
Definition: winuser.h:2135
#define DC_HASDEFID
Definition: winuser.h:2651
#define DM_GETDEFID
Definition: winuser.h:2134

Referenced by register_classes().

◆ TestModalDlgProc2()

static INT_PTR CALLBACK TestModalDlgProc2 ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 4823 of file msg.c.

4824{
4825 struct recvd_message msg;
4826
4827 if (ignore_message( message )) return 0;
4828
4829 switch (message)
4830 {
4831 /* ignore */
4832 case WM_MOUSEMOVE:
4833 case WM_NCMOUSEMOVE:
4834 case WM_NCMOUSELEAVE:
4835 case WM_SETCURSOR:
4836 return 0;
4837 case WM_NCHITTEST:
4838 return HTCLIENT;
4839 }
4840
4841 msg.hwnd = hwnd;
4842 msg.message = message;
4843 msg.flags = sent|wparam|lparam;
4844 msg.wParam = wParam;
4845 msg.lParam = lParam;
4846 msg.descr = "dialog";
4847 add_message(&msg);
4848
4849 if (message == WM_INITDIALOG) EndDialog( hwnd, 0 );
4850 return 0;
4851}
#define WM_NCMOUSELEAVE
Definition: winuser.h:1870

Referenced by test_dialog_messages().

◆ TestModalDlgProcA()

static INT_PTR CALLBACK TestModalDlgProcA ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 4792 of file msg.c.

4793{
4794 struct recvd_message msg;
4795
4796 if (ignore_message( message )) return 0;
4797
4798 switch (message)
4799 {
4800 /* ignore */
4801 case WM_MOUSEMOVE:
4802 case WM_NCMOUSEMOVE:
4803 case WM_NCMOUSELEAVE:
4804 case WM_SETCURSOR:
4805 return 0;
4806 case WM_NCHITTEST:
4807 return HTCLIENT;
4808 }
4809
4810 msg.hwnd = hwnd;
4811 msg.message = message;
4812 msg.flags = sent|wparam|lparam;
4813 msg.wParam = wParam;
4814 msg.lParam = lParam;
4815 msg.descr = "dialog";
4816 add_message(&msg);
4817
4818 if (message == WM_INITDIALOG) SetTimer( hwnd, 1, 100, NULL );
4819 if (message == WM_TIMER) EndDialog( hwnd, 0 );
4820 return 0;
4821}

Referenced by test_messages().

◆ tfunc()

static VOID CALLBACK tfunc ( HWND  hwnd,
UINT  uMsg,
UINT_PTR  id,
DWORD  dwTime 
)
static

Definition at line 11662 of file msg.c.

11663{
11664}

Referenced by test_timers(), test_timers_no_wnd(), and timer_thread_proc().

◆ thread_proc()

static DWORD WINAPI thread_proc ( void param)
static

Definition at line 9985 of file msg.c.

9986{
9987 MSG msg;
9988 struct wnd_event *wnd_event = param;
9989
9990 wnd_event->hwnd = CreateWindowExA(0, "TestWindowClass", "window caption text", WS_OVERLAPPEDWINDOW,
9991 100, 100, 200, 200, 0, 0, 0, NULL);
9992 ok(wnd_event->hwnd != 0, "Failed to create overlapped window\n");
9993
9995
9996 while (GetMessageA(&msg, 0, 0, 0))
9997 {
10000 }
10001
10002 ok(IsWindow(wnd_event->hwnd), "window should still exist\n");
10003
10004 return 0;
10005}

Referenced by test_interthread_messages(), and test_SetFocus().

◆ timer_fired()

static void timer_fired ( void  )
static

Definition at line 11684 of file msg.c.

11685{
11686 if (count < TIMER_COUNT)
11687 {
11688 LARGE_INTEGER performance_counter;
11689 BOOL ret;
11690
11691 ret = QueryPerformanceCounter(&performance_counter);
11692 ok(ret, "QueryPerformanceCounter failed\n");
11693
11694 timer_ticks[count] = performance_counter.QuadPart;
11695 }
11696
11697 count++;
11698
11699 if (count == TIMER_COUNT)
11700 {
11701 LARGE_INTEGER performance_frequency;
11702 BOOL ret;
11703
11704 /* calculate durations */
11705 for (int i=0; i < TIMER_COUNT-1; i++)
11707
11709
11710 ret = QueryPerformanceFrequency(&performance_frequency);
11711 ok(ret, "QueryPerformanceFrequency failed\n");
11712
11713 /* median duration, converted to microseconds */
11714 timer_duration = (int)(timer_ticks[(TIMER_COUNT - 1) / 2] * 1000000 / performance_frequency.QuadPart);
11715 }
11716}
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
_ACRTIMP void __cdecl qsort(void *, size_t, size_t, int(__cdecl *)(const void *, const void *))
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
static ULONGLONG timer_ticks[TIMER_COUNT]
Definition: msg.c:11673
static int compare_ulonglong(const void *a, const void *b)
Definition: msg.c:11676
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by callback_count(), callback_exception(), and test_timers().

◆ timer_thread_proc()

static DWORD WINAPI timer_thread_proc ( LPVOID  x)
static

Definition at line 11730 of file msg.c.

11731{
11732 struct timer_info *info = x;
11733 DWORD r;
11734
11735 r = KillTimer(info->hWnd, 0x19);
11736 ok(r,"KillTimer failed in thread\n");
11737 r = SetTimer(info->hWnd,TIMER_ID,10000,tfunc);
11738 ok(r,"SetTimer failed in thread\n");
11739 ok(r==TIMER_ID,"SetTimer id different\n");
11740 r = SetEvent(info->handles[0]);
11741 ok(r,"SetEvent failed in thread\n");
11742 return 0;
11743}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

Referenced by test_timers().

◆ UINT_PTR()

static UINT_PTR ( WINAPI pSetSystemTimer)
static

◆ update_layered_proc()

static DWORD CALLBACK update_layered_proc ( void param)
static

Definition at line 19856 of file msg.c.

19857{
19858 struct layered_window_info *info = param;
19859 POINT src = { 0, 0 };
19860
19861 info->ret = pUpdateLayeredWindow( info->hwnd, 0, NULL, &info->size,
19862 info->hdc, &src, 0, NULL, ULW_OPAQUE );
19863 ok( info->ret, "failed\n");
19864 SetEvent( info->event );
19865 return 0;
19866}

Referenced by test_layered_window().

◆ visualize_region_differences()

static void visualize_region_differences ( HWND  hwnd,
HWND  hother,
HRGN  hrgn_expect,
HRGN  hrgn_actual 
)
static

Definition at line 9176 of file msg.c.

9177{
9178 HBRUSH b_expectonly, b_actualonly, b_intersect;
9179 HRGN hrgn_intersect;
9180 HWND hstatic, hshow, hhide;
9181 HDC hdc, hdctmp;
9183 MSG msg;
9184 RECT rect;
9185 DWORD start_time, elapsed, timeout = 60 * 1000;
9186 BOOL toggle = TRUE, stop = FALSE;
9187
9188 start_time = GetTickCount();
9189
9190 b_expectonly = CreateSolidBrush( RGB( 64, 64, 255 ));
9191 b_actualonly = CreateSolidBrush( RGB( 255, 64, 64 ));
9192 b_intersect = CreateSolidBrush( RGB( 159, 64, 159 ));
9193
9194 hrgn_intersect = CreateRectRgn( 0, 0, 0, 0 );
9195 CombineRgn( hrgn_intersect, hrgn_expect, hrgn_actual, RGN_AND );
9196
9197 GetClientRect( hwnd, &rect );
9198 hdc = GetDC( hwnd );
9199 hbitmap = CreateCompatibleBitmap( hdc, rect.right, rect.bottom );
9200 hdctmp = CreateCompatibleDC( hdc );
9201 ReleaseDC( hwnd, hdc );
9202
9203 SelectObject( hdctmp, hbitmap );
9204 FillRgn( hdctmp, hrgn_expect, b_expectonly );
9205 FillRgn( hdctmp, hrgn_actual, b_actualonly );
9206 FillRgn( hdctmp, hrgn_intersect, b_intersect );
9207
9208 DeleteObject( hdctmp );
9209 DeleteObject( hrgn_intersect );
9210 DeleteObject( b_intersect );
9211 DeleteObject( b_actualonly );
9212 DeleteObject( b_expectonly );
9213
9214 hstatic = CreateWindowExA( 0, WC_STATICA, "", WS_CHILD | SS_BITMAP,
9215 0, 0, rect.right, rect.bottom, hwnd, 0, 0, NULL );
9217
9218 hshow = hstatic;
9219 hhide = hother;
9220
9221 for (;;)
9222 {
9223 if (stop) toggle = hshow == hother;
9224 if (toggle)
9225 {
9226 HWND htmp;
9227 HDWP hdwp;
9228
9229 hdwp = BeginDeferWindowPos( !!hhide + !!hshow );
9230 if (hhide)
9231 {
9232 DeferWindowPos( hdwp, hhide, NULL, 0, 0, 0, 0,
9234 }
9235 if (hshow)
9236 {
9237 DeferWindowPos( hdwp, hshow, HWND_TOP, 0, 0, 0, 0,
9239 }
9240 EndDeferWindowPos( hdwp );
9241
9242 htmp = hshow;
9243 hshow = hhide;
9244 hhide = htmp;
9245 toggle = FALSE;
9246 }
9247 if (stop) break;
9248 if ((elapsed = GetTickCount() - start_time) >= timeout)
9249 {
9250 stop = TRUE;
9251 continue;
9252 }
9254 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE ))
9255 {
9258 if (msg.message == WM_MOUSEMOVE)
9259 {
9260 start_time = GetTickCount();
9261 }
9262 else if (msg.message == WM_LBUTTONUP || (msg.message == WM_CHAR && msg.wParam == VK_SPACE))
9263 {
9264 toggle = !toggle;
9265 }
9266 else if (msg.message == WM_RBUTTONUP || (msg.message == WM_CHAR && msg.wParam == VK_RETURN))
9267 {
9268 stop = TRUE;
9269 }
9270 }
9271 }
9272
9273 DestroyWindow( hstatic );
9275}
static HBITMAP hbitmap
#define RGB(r, g, b)
Definition: precomp.h:67
#define SS_BITMAP
Definition: pedump.c:704
#define WC_STATICA
Definition: commctrl.h:4684
#define RGN_AND
Definition: wingdi.h:356
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
Definition: painting.c:183
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define STM_SETIMAGE
Definition: winuser.h:2129
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by subtest_hvredraw(), and subtest_swp_paint_regions_().

◆ void()

static void ( WINAPI pNotifyWinEvent)
static

◆ wait_for_thread()

static void wait_for_thread ( HANDLE  thread)
static

Definition at line 13165 of file msg.c.

13166{
13168 {
13169 MSG msg;
13170 while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA(&msg);
13171 }
13172}

Referenced by test_SendMessageTimeout().

◆ wait_idle_proc()

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

Definition at line 18817 of file msg.c.

18818{
18819 if (msg == WM_WININICHANGE) Sleep( 200 ); /* make sure the child waits */
18820 return DefWindowProcA( hwnd, msg, wp, lp );
18821}

Referenced by wait_idle_thread().

◆ wait_idle_thread()

static DWORD CALLBACK wait_idle_thread ( void arg)
static

Definition at line 18823 of file msg.c.

18824{
18825 WNDCLASSA cls;
18826 MSG msg;
18827 HWND hwnd;
18828
18829 memset( &cls, 0, sizeof(cls) );
18831 cls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
18833 cls.lpszClassName = "TestClass";
18834 register_class(&cls);
18835
18836 hwnd = CreateWindowExA(0, "TestClass", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
18837 while (GetMessageA( &msg, 0, 0, 0 )) DispatchMessageA( &msg );
18839 return 0;
18840}
static LRESULT CALLBACK wait_idle_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
Definition: msg.c:18817

Referenced by test_WaitForInputIdle().

◆ wait_move_event()

static void wait_move_event ( HWND  hwnd,
int  x,
int  y 
)
static

Definition at line 14376 of file msg.c.

14377{
14378 MSG msg;
14379 DWORD timeout = GetTickCount() + 500;
14380 BOOL ret;
14381 int delay;
14382
14383 while ((delay = timeout - GetTickCount()) > 0)
14384 {
14386 if (ret && msg.pt.x > x && msg.pt.y > y) break;
14387 if (!ret) MsgWaitForMultipleObjects( 0, NULL, FALSE, delay, QS_ALLINPUT );
14388 else Sleep( delay );
14389 }
14390}

Referenced by test_PeekMessage2().

◆ win_event_global_hook_proc()

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

Definition at line 11987 of file msg.c.

11994{
11995 char buf[256];
11996
11997 if (GetClassNameA(hwnd, buf, sizeof(buf)))
11998 {
11999 if (!lstrcmpiA(buf, "TestWindowClass") ||
12000 !lstrcmpiA(buf, "static"))
12001 {
12002 struct recvd_message msg;
12003
12004 msg.hwnd = hwnd;
12005 msg.message = event;
12007 msg.wParam = object_id;
12008 msg.lParam = (thread_id == GetCurrentThreadId()) ? child_id : (child_id + 2);
12009 msg.descr = "WEH_2";
12010 add_message(&msg);
12011 }
12012 }
12013}

Referenced by test_winevents().

◆ win_event_global_thread_proc()

static DWORD WINAPI win_event_global_thread_proc ( void param)
static

Definition at line 12078 of file msg.c.

12079{
12080 HWND hwnd;
12081 MSG msg;
12082 HANDLE hevent = *(HANDLE *)param;
12083
12084 hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0,0,0,0,0,0,0, NULL);
12085 ok(!!hwnd, "Failed to create window, error %lu.\n", GetLastError());
12086 if (winetest_debug > 1) trace("created thread window %p\n", hwnd);
12087
12088 *(HWND *)param = hwnd;
12089
12091 /* this event should be received only by our new hook proc,
12092 * an old one does not expect an event from another thread.
12093 */
12094 pNotifyWinEvent(EVENT_OBJECT_LOCATIONCHANGE, hwnd, OBJID_ALERT, 0);
12096
12097 while (GetMessageA(&msg, 0, 0, 0))
12098 {
12101 }
12102 return 0;
12103}
#define OBJID_ALERT
Definition: winable.h:25

Referenced by test_winevents().

◆ win_event_proc()

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

Definition at line 11432 of file msg.c.

11439{
11440 ok(thread_id == winevent_hook_thread_id, "we didn't ask for events from other threads\n");
11441
11442 /* ignore mouse cursor events */
11443 if (object_id == OBJID_CURSOR) return;
11444
11445 if (!hwnd || is_our_logged_class(hwnd))
11446 {
11447 struct recvd_message msg;
11448
11449 msg.hwnd = hwnd;
11450 msg.message = event;
11452 msg.wParam = object_id;
11453 msg.lParam = child_id;
11454 msg.descr = "WEH";
11455 add_message(&msg);
11456 }
11457}
#define OBJID_CURSOR
Definition: winable.h:24

Referenced by START_TEST(), and test_set_hook().

◆ wm_quit_dlg_proc()

static INT_PTR CALLBACK wm_quit_dlg_proc ( HWND  hwnd,
UINT  message,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 14609 of file msg.c.

14610{
14611 struct recvd_message msg;
14612
14613 if (ignore_message( message )) return 0;
14614
14615 msg.hwnd = hwnd;
14616 msg.message = message;
14617 msg.flags = sent|wparam|lparam;
14618 msg.wParam = wp;
14619 msg.lParam = lp;
14620 msg.descr = "dialog";
14621 add_message(&msg);
14622
14623 switch (message)
14624 {
14625 case WM_INITDIALOG:
14626 PostMessageA(hwnd, WM_QUIT, 0x1234, 0x5678);
14627 PostMessageA(hwnd, WM_USER, 0xdead, 0xbeef);
14628 return 0;
14629
14630 case WM_GETDLGCODE:
14631 return 0;
14632
14633 case WM_USER:
14634 EndDialog(hwnd, 0);
14635 break;
14636 }
14637
14638 return 1;
14639}

Referenced by test_quit_message().

◆ wmime_keydown_procA()

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

Definition at line 8235 of file msg.c.

8236{
8237 struct recvd_message msg;
8238
8239 msg.hwnd = hwnd;
8240 msg.message = message;
8241 msg.flags = wparam|lparam;
8242 msg.wParam = wParam;
8243 msg.lParam = lParam;
8244 msg.descr = "wmime_keydown";
8245 add_message(&msg);
8246
8248}

Referenced by register_wmime_keydown_class().

Variable Documentation

◆ after_end_dialog

BOOL after_end_dialog
static

Definition at line 2336 of file msg.c.

Referenced by test_messages(), and TestDlgProcA().

◆ auto_radio_button_BM_CLICK

const struct message auto_radio_button_BM_CLICK[]
static

Definition at line 7322 of file msg.c.

Referenced by test_autoradio_BM_CLICK().

◆ auto_radio_button_VK_DOWN_dialog

const struct message auto_radio_button_VK_DOWN_dialog[]
static

Definition at line 7407 of file msg.c.

Referenced by test_autoradio_kbd_move().

◆ auto_radio_button_VK_DOWN_radio3

◆ auto_radio_button_VK_UP_child

const struct message auto_radio_button_VK_UP_child[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 7354 of file msg.c.

Referenced by test_autoradio_kbd_move().

◆ auto_radio_button_VK_UP_dialog

const struct message auto_radio_button_VK_UP_dialog[]
static

Definition at line 7368 of file msg.c.

Referenced by test_autoradio_kbd_move().

◆ auto_radio_button_VK_UP_parent

const struct message auto_radio_button_VK_UP_parent[]
static
Initial value:

Definition at line 7361 of file msg.c.

Referenced by test_autoradio_kbd_move().

◆ auto_radio_button_VK_UP_radio1

const struct message auto_radio_button_VK_UP_radio1[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 7474 of file msg.c.

Referenced by test_autoradio_kbd_move().

◆ broken

◆ cbt_global_hook_thread_id

DWORD cbt_global_hook_thread_id
static

Definition at line 12016 of file msg.c.

Referenced by cbt_global_hook_proc().

◆ cbt_hook_thread_id

DWORD cbt_hook_thread_id
static

Definition at line 121 of file msg.c.

Referenced by cbt_hook_proc(), and START_TEST().

◆ COLORREF

Definition at line 2347 of file msg.c.

◆ count

int count = 0
static

Definition at line 11672 of file msg.c.

◆ destroy_window_with_children

const struct message destroy_window_with_children[]
static
Initial value:

Definition at line 12922 of file msg.c.

Referenced by test_DestroyWindow().

◆ DoubleSetCaptureSeq

const struct message DoubleSetCaptureSeq[]
static
Initial value:
=
{
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 20437 of file msg.c.

Referenced by test_DoubleSetCapture().

◆ dummy_window_text

const WCHAR dummy_window_text[] = {'d','u','m','m','y',' ','t','e','x','t',0}
static

Definition at line 11499 of file msg.c.

Referenced by get_text_len_proc(), and test_message_conversion().

◆ DWORD

Definition at line 2344 of file msg.c.

◆ edit_eimes_getcompstratonce_korean_seq

const struct message edit_eimes_getcompstratonce_korean_seq[]
static
Initial value:
=
{
{WM_IME_ENDCOMPOSITION, sent},
{WM_IME_COMPOSITION, sent | wparam, 'W'},
{0}
}

Definition at line 13475 of file msg.c.

Referenced by test_edit_ime_messages().

◆ edit_eimes_getcompstratonce_seq

const struct message edit_eimes_getcompstratonce_seq[]
static
Initial value:
=
{
{WM_IME_STARTCOMPOSITION, sent},
{WM_IME_COMPOSITION, sent | wparam, 'W'},
{WM_IME_ENDCOMPOSITION, sent},
{0}
}

Definition at line 13467 of file msg.c.

Referenced by test_edit_ime_messages().

◆ edit_window_proc

WNDPROC edit_window_proc
static

Definition at line 7963 of file msg.c.

Referenced by combobox_edit_subclass_proc(), and test_combobox_messages().

◆ edit_wm_ime_char_seq

const struct message edit_wm_ime_char_seq[]
static
Initial value:
=
{
{WM_IME_CHAR, sent | wparam, '0'},
{WM_CHAR, sent | wparam, '0'},
{0}
}

Definition at line 13460 of file msg.c.

Referenced by test_edit_ime_messages().

◆ edit_wm_ime_composition_korean_seq

const struct message edit_wm_ime_composition_korean_seq[]
static
Initial value:
=
{
{WM_IME_ENDCOMPOSITION, sent},
{WM_IME_COMPOSITION, sent | wparam, 'W'},
{WM_CHAR, sent | wparam, 'W'},
{WM_CHAR, sent | wparam, 'i'},
{WM_CHAR, sent | wparam, 'n'},
{WM_CHAR, sent | wparam, 'e'},
{0}
}

Definition at line 13445 of file msg.c.

Referenced by test_edit_ime_messages().

◆ edit_wm_ime_composition_seq

const struct message edit_wm_ime_composition_seq[]
static
Initial value:
=
{
{WM_IME_STARTCOMPOSITION, sent},
{WM_IME_COMPOSITION, sent | wparam, 'W'},
{WM_IME_ENDCOMPOSITION, sent},
{WM_CHAR, sent | wparam, 'W'},
{WM_CHAR, sent | wparam, 'i'},
{WM_CHAR, sent | wparam, 'n'},
{WM_CHAR, sent | wparam, 'e'},
{0}
}

Definition at line 13429 of file msg.c.

Referenced by test_edit_ime_messages().

◆ exception

DWORD exception
static

Definition at line 11723 of file msg.c.

◆ exp

DWORD exp

Definition at line 18625 of file msg.c.

Referenced by __declspec(), __libm_sse2_exp(), __libm_sse2_expf(), _assert(), _check_ref(), _check_release(), _CIexp(), _finite(), _finitef(), _libm_sse2_exp_precise(), _scalb(), _Stl_set_exponent(), _Stl_string_to_double(), _Stl_tenscale(), _test_color(), _test_img_height(), _test_img_width(), check_floats_(), check_mat(), check_vertex_components(), cosh(), Tokenizer::count_captures(), do_authorization(), edit_pos_ok_(), EditTypeDlg_WriteClass(), ExceptionFilterSSEException(), ExceptionFilterSSESupport(), exp(), expf(), expl(), expT(), float_32_to_16(), gl_fog_color_pixels(), gl_fog_color_vertices(), gl_fog_index_pixels(), gl_fog_index_vertices(), Global_Exp(), HTTP_DoAuthorization(), I10_OUTPUT(), JSGlobal_parseFloat(), ldexp(), Math_exp(), MatrixTest(), MSVCRT_exp(), mul_pow10(), ncdestroy_test_proc(), Number_toString(), parse_decimal(), parse_numeric_literal(), ParseFile(), pf_output_hex_fp(), powT(), pp_add_macro(), r_verify_inifile(), r_verifyProxyEnable(), rdssl_mod_exp(), RpcAuthInfo_Create(), RpcBindingSetAuthInfoExA(), RpcBindingSetAuthInfoExW(), RPCRT4_ServerConnectionAuth(), RPCRT4_ServerGetRegisteredAuthInfo(), rpn_exp(), sec_rsa_encrypt(), sinh(), SquareDouble(), tanh(), test__tcscoll(), test__tcsncoll(), test__tcsnicoll(), test__wcsicmp_l(), test_ACLMulti(), test_C_locale(), test_enumerate_name(), Test_exp_approx(), Test_exp_exact(), test_FoldStringW(), test_GdipGetVisibleClipBounds_screen(), test_GdipGetVisibleClipBounds_window(), test_ismbckata(), test_ismbclegal(), test_mbbtombc(), test_mbcjisjms(), test_mbcjmsjis(), test_mbctohira(), test_mbctokata(), test_mbctombb(), Test_ofuncs(), test_ResolveLocaleName(), test_ScCountProps(), test_searchenv(), test_SpecialCasing(), test_strstr(), test_tab(), test_UlPropSize(), test_updates(), test_VarAbs(), test_VarAdd(), test_VarAnd(), test_VarDiv(), test_VarEqv(), test_VarFix(), test_VarIdiv(), test_VarImp(), test_VarInt(), test_VarMod(), test_VarMul(), test_VarNeg(), test_VarNot(), test_VarOr(), test_VarPow(), test_VarRound(), test_VarSub(), test_VarXor(), test_vsnprintf_s(), test_vsnwprintf_s(), test_WaitForInputIdle(), test_wndproc_forwards(), testAcquireSecurityContext(), throw(), ValarrayTest::transcendentals(), and xdr_double().

◆ g_broadcast_msg

UINT g_broadcast_msg
static

Definition at line 18454 of file msg.c.

Referenced by broadcast_test_proc(), broadcast_test_sub_proc(), and test_broadcast().

◆ g_broadcast_sub_wparam

WPARAM* g_broadcast_sub_wparam
static

Definition at line 18465 of file msg.c.

Referenced by broadcast_test_sub_proc(), and test_broadcast().

◆ g_broadcast_wparam

WPARAM g_broadcast_wparam
static

Definition at line 18453 of file msg.c.

Referenced by broadcast_test_proc(), and test_broadcast().

◆ g_oldproc_sub

WNDPROC* g_oldproc_sub
static

Definition at line 18464 of file msg.c.

Referenced by broadcast_test_sub_proc(), and test_broadcast().

◆ hCBT_global_hook

HHOOK hCBT_global_hook
static

Definition at line 12015 of file msg.c.

Referenced by cbt_global_hook_proc(), and test_winevents().

◆ hCBT_hook

HHOOK hCBT_hook
static

Definition at line 120 of file msg.c.

Referenced by can_skip_message(), cbt_hook_proc(), and START_TEST().

◆ HDC

◆ hEvent_hook

HWINEVENTHOOK hEvent_hook
static

Definition at line 118 of file msg.c.

Referenced by can_skip_message(), and START_TEST().

◆ hKBD_hook

HHOOK hKBD_hook
static

Definition at line 119 of file msg.c.

Referenced by can_skip_message(), KeyboardHookProc(), and test_hotkey().

◆ HMODULE

Definition at line 2344 of file msg.c.

◆ hook_depth

◆ hook_hwnd

HWND hook_hwnd
static

Definition at line 12564 of file msg.c.

Referenced by rec_get_message_hook(), and test_recursive_hook().

◆ hotkey_letter

int hotkey_letter
static

Definition at line 19247 of file msg.c.

Referenced by KeyboardHookProc(), and test_hotkey().

◆ hpopupmenu

◆ HWND

◆ iface_guid

const GUID iface_guid = {0x66666666}
static

Definition at line 11462 of file msg.c.

Referenced by MsgConversionProcW(), and test_message_conversion().

◆ ignore_mouse_messages

BOOL ignore_mouse_messages = TRUE
static

Definition at line 117 of file msg.c.

Referenced by MsgCheckProc(), and test_setwindowpos().

◆ lbox_window_proc

WNDPROC lbox_window_proc
static

Definition at line 7963 of file msg.c.

Referenced by combobox_lbox_subclass_proc(), and test_combobox_messages().

◆ log_all_parent_messages

◆ LONG

Definition at line 2343 of file msg.c.

◆ LPARAM

◆ LPCPINFOEXA

Definition at line 2352 of file msg.c.

◆ manifest_dep

const char manifest_dep[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"testdep1\" type=\"win32\" processorArchitecture=\"" ARCH "\"/>"
" <file name=\"testdep.dll\" />"
"</assembly>"
#define ARCH
Definition: msg.c:73

Definition at line 10055 of file msg.c.

Referenced by test_interthread_messages().

◆ manifest_main

const char manifest_main[]
static
Initial value:
=
"<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">"
"<assemblyIdentity version=\"1.2.3.4\" name=\"Wine.Test\" type=\"win32\" />"
"<dependency>"
" <dependentAssembly>"
" <assemblyIdentity type=\"win32\" name=\"testdep1\" version=\"1.2.3.4\" processorArchitecture=\"" ARCH "\" />"
" </dependentAssembly>"
"</dependency>"
"</assembly>"

Definition at line 10061 of file msg.c.

Referenced by test_interthread_messages().

◆ max_hook_depth

◆ max_msg_depth

int max_msg_depth
static

Definition at line 12780 of file msg.c.

Referenced by recursive_messages_proc(), and test_recursive_messages().

◆ mdi_client

◆ ml_edit_lbutton_down

const struct message ml_edit_lbutton_down[]
static
Initial value:

Definition at line 13369 of file msg.c.

Referenced by test_edit_messages().

◆ ml_edit_lbutton_up

const struct message ml_edit_lbutton_up[]
static
Initial value:
=
{
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 13395 of file msg.c.

Referenced by test_edit_messages().

◆ ml_edit_setfocus

const struct message ml_edit_setfocus[]
static

◆ NCRBUTTONDOWNSeq

const struct message NCRBUTTONDOWNSeq[]
static
Initial value:
=
{
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ WM_CONTEXTMENU, sent, 0, -1 },
{ 0 }
}

Definition at line 17830 of file msg.c.

Referenced by test_defwinproc().

◆ NCXBUTTONUPSeq1

const struct message NCXBUTTONUPSeq1[]
static
Initial value:
=
{
{ WM_APPCOMMAND, sent|lparam, 0, MAKELPARAM(0, FAPPCOMMAND_MOUSE | APPCOMMAND_BROWSER_BACKWARD) },
{ 0 }
}
#define WM_APPCOMMAND
Definition: winuser.h:1910

Definition at line 17839 of file msg.c.

Referenced by test_defwinproc().

◆ NCXBUTTONUPSeq2

const struct message NCXBUTTONUPSeq2[]
static
Initial value:
=
{
{ WM_APPCOMMAND, sent|lparam, 0, MAKELPARAM(0, FAPPCOMMAND_MOUSE | APPCOMMAND_BROWSER_FORWARD) },
{ 0 }
}

Definition at line 17845 of file msg.c.

Referenced by test_defwinproc().

◆ old_button_proc

WNDPROC old_button_proc
static

Definition at line 6799 of file msg.c.

Referenced by button_hook_proc(), and subclass_button().

◆ old_combobox_proc

WNDPROC old_combobox_proc
static

Definition at line 7963 of file msg.c.

Referenced by combobox_hook_proc(), and subclass_combobox().

◆ old_edit_proc

WNDPROC old_edit_proc
static

Definition at line 13403 of file msg.c.

Referenced by edit_hook_proc(), and subclass_edit().

◆ old_mdi_client_proc

WNDPROC old_mdi_client_proc
static

Definition at line 4039 of file msg.c.

Referenced by mdi_client_hook_proc(), and mdi_register_classes().

◆ old_static_proc

WNDPROC old_static_proc
static

Definition at line 7758 of file msg.c.

Referenced by static_hook_proc(), and subclass_static().

◆ orig_edit_proc

WNDPROC orig_edit_proc
static

Definition at line 15755 of file msg.c.

Referenced by dlg_creation_edit_proc(), test_dlg_proc2(), and test_dlg_proc4().

◆ paint_loop_done

BOOL paint_loop_done
static

Definition at line 2336 of file msg.c.

Referenced by PaintLoopProcA(), and test_paintingloop().

◆ pOldViewerProc

WNDPROC pOldViewerProc
static

Definition at line 18243 of file msg.c.

Referenced by recursive_viewer_proc(), and test_clipboard_viewers().

◆ recursive_hook

HHOOK recursive_hook
static

Definition at line 12565 of file msg.c.

Referenced by rec_get_message_hook(), and test_recursive_hook().

◆ ScrollWindowPaint1

◆ ScrollWindowPaint2

const struct message ScrollWindowPaint2[]
static
Initial value:
= {
{ WM_PAINT, sent },
{ 0 }
}

Definition at line 12850 of file msg.c.

Referenced by test_scrollwindowex().

◆ send_message_1

const struct message send_message_1[]
static
Initial value:
= {
{ WM_USER+2, sent|wparam|lparam, 0, 0 },
{ WM_USER, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 20158 of file msg.c.

Referenced by test_SendMessage_other_thread().

◆ send_message_2

const struct message send_message_2[]
static
Initial value:
= {
{ WM_USER+4, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 20163 of file msg.c.

Referenced by test_SendMessage_other_thread().

◆ send_message_3

const struct message send_message_3[]
static
Initial value:
= {
{ WM_USER+3, sent|wparam|lparam, 0, 0 },
{ WM_USER+1, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 20167 of file msg.c.

Referenced by test_SendMessage_other_thread().

◆ send_message_5

◆ sequence

◆ sequence_cnt

int sequence_cnt
static

◆ sequence_cs

CRITICAL_SECTION sequence_cs
static

Definition at line 2340 of file msg.c.

Referenced by add_message_(), flush_sequence(), and START_TEST().

◆ sequence_size

int sequence_size
static

Definition at line 2337 of file msg.c.

Referenced by add_message_(), and flush_sequence().

◆ SetActiveWindowSeq0

◆ SetActiveWindowSeq1

const struct message SetActiveWindowSeq1[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 16372 of file msg.c.

Referenced by test_SetActiveWindow().

◆ SetActiveWindowSeq2

◆ SetActiveWindowSeq3

◆ SetActiveWindowSeq4

◆ SetCurSelComboSeq

const struct message SetCurSelComboSeq[]
static
Initial value:
=
{
{ 0 }
}
#define LB_GETITEMDATA
Definition: winuser.h:2070
#define LB_GETTEXT
Definition: winuser.h:2085
#define LB_SETTOPINDEX
Definition: winuser.h:2106
#define LB_GETTEXTLEN
Definition: winuser.h:2086

Definition at line 7844 of file msg.c.

Referenced by test_combobox_messages().

◆ SetCurSelComboSeq2

const struct message SetCurSelComboSeq2[]
static
Initial value:

Definition at line 7859 of file msg.c.

Referenced by test_combobox_messages().

◆ SetCurSelComboSeq_edit

const struct message SetCurSelComboSeq_edit[]
static
Initial value:
=
{
{ 0 }
}
#define INT_MAX
Definition: limits.h:26

Definition at line 7871 of file msg.c.

Referenced by test_combobox_messages().

◆ SetFocusButtonSeq

const struct message SetFocusButtonSeq[]
static
Initial value:

Definition at line 7918 of file msg.c.

Referenced by test_combobox_messages().

◆ SetFocusButtonSeq2

◆ SetFocusComboBoxSeq

◆ SetForegroundWindowSeq

const struct message SetForegroundWindowSeq[]
static
Initial value:

Definition at line 16515 of file msg.c.

Referenced by test_SetForegroundWindow().

◆ skip_WH_KEYBOARD_hook

BOOL skip_WH_KEYBOARD_hook
static

Definition at line 12567 of file msg.c.

Referenced by keyboard_recursive_hook_proc(), and test_recursive_hook().

◆ skip_WH_MOUSE_hook

BOOL skip_WH_MOUSE_hook
static

Definition at line 12567 of file msg.c.

Referenced by mouse_recursive_hook_proc(), and test_recursive_hook().

◆ sl_edit_invisible

const struct message sl_edit_invisible[]
static
Initial value:

Definition at line 13295 of file msg.c.

Referenced by test_edit_messages().

◆ sl_edit_killfocus

const struct message sl_edit_killfocus[]
static
Initial value:

Definition at line 13326 of file msg.c.

Referenced by test_edit_messages().

◆ sl_edit_lbutton_dblclk

const struct message sl_edit_lbutton_dblclk[]
static
Initial value:
=
{
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 13338 of file msg.c.

Referenced by test_edit_messages().

◆ sl_edit_lbutton_down

const struct message sl_edit_lbutton_down[]
static
Initial value:

Definition at line 13344 of file msg.c.

Referenced by test_edit_messages().

◆ sl_edit_lbutton_up

const struct message sl_edit_lbutton_up[]
static
Initial value:
=
{
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam|msg_todo, OBJID_CARET, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam|msg_todo, OBJID_CARET, 0 },
{ 0 }
}

Definition at line 13386 of file msg.c.

Referenced by test_edit_messages().

◆ sl_edit_setfocus

◆ test_context_menu

BOOL test_context_menu
static

Definition at line 116 of file msg.c.

Referenced by MsgCheckProc(), and test_defwinproc().

◆ test_def_id

BOOL test_def_id
static

Definition at line 2336 of file msg.c.

Referenced by test_messages(), and TestDlgProcA().

◆ test_DestroyWindow_flag

BOOL test_DestroyWindow_flag
static

Definition at line 115 of file msg.c.

Referenced by cbt_hook_proc(), MsgCheckProc(), and test_DestroyWindow().

◆ test_hook_cleanup_hook_proc_call_thread_id

DWORD test_hook_cleanup_hook_proc_call_thread_id
static

◆ test_hook_cleanup_hook_proc_child_id

LONG test_hook_cleanup_hook_proc_child_id
static

◆ test_hook_cleanup_hook_proc_thread_id

DWORD test_hook_cleanup_hook_proc_thread_id
static

◆ testWindowClassW

const WCHAR testWindowClassW[]
static
Initial value:
=
{ 'T','e','s','t','W','i','n','d','o','w','C','l','a','s','s','W',0 }

Definition at line 124 of file msg.c.

Referenced by register_classes(), test_dbcs_wm_char(), test_message_conversion(), and test_unicode_wm_char().

◆ timer_duration

int timer_duration = 0
static

Definition at line 11674 of file msg.c.

Referenced by test_timers(), test_timers_no_wnd(), and timer_fired().

◆ timer_ticks

ULONGLONG timer_ticks[TIMER_COUNT]
static

Definition at line 11673 of file msg.c.

Referenced by timer_fired().

◆ TIMERPROC

TIMERPROC

Definition at line 2348 of file msg.c.

◆ todo

BOOL todo

Definition at line 18626 of file msg.c.

Referenced by messages_equal(), ok_sequence_(), test_msg_setpos_(), and test_WaitForInputIdle().

◆ UINT

Definition at line 2348 of file msg.c.

◆ UINT_PTR

Definition at line 2348 of file msg.c.

◆ ULONG

Definition at line 2350 of file msg.c.

◆ 

const struct { ... } wait_idle_expect[]
Initial value:
=
{
{ 0, 0, FALSE },
{ 0, 0, FALSE },
{ 0, 0, FALSE },
{ 0, 0, FALSE },
{ 0, 0, FALSE },
{ 0, 0, FALSE },
{ 0, 0, FALSE },
}

Referenced by test_WaitForInputIdle().

◆ winevent_hook_thread_id

DWORD winevent_hook_thread_id
static

Definition at line 122 of file msg.c.

Referenced by START_TEST(), and win_event_proc().

◆ WINEVENTPROC

WINEVENTPROC

Definition at line 2344 of file msg.c.

◆ wm_lb_addstring

const struct message wm_lb_addstring[]
static
Initial value:
=
{
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ef },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 },
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ed },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam, OBJID_CLIENT, 0 },
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ee },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam, OBJID_CLIENT, 0 },
{ 0 }
}

Definition at line 17060 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_addstring_ownerdraw

const struct message wm_lb_addstring_ownerdraw[]
static
Initial value:
=
{
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ed },
{ WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf0f2, 0xf30604ed },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 },
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ee },
{ WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf1f2, 0xf30604ee },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 2 },
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ef },
{ WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf2f2, 0xf30604ef },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 3 },
{ 0 }
}

Definition at line 17071 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_addstring_sort_ownerdraw

const struct message wm_lb_addstring_sort_ownerdraw[]
static
Initial value:
=
{
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ed },
{ WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf0f2, 0xf30604ed },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 },
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ee },
{ WM_COMPAREITEM, sent|wparam|lparam|parent, 0xf30604ed, 0xf30604ee },
{ WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf1f2, 0xf30604ee },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 2 },
{ LB_ADDSTRING, sent|wparam|lparam, 0, 0xf30604ef },
{ WM_COMPAREITEM, sent|wparam|lparam|parent, 0xf30604ed, 0xf30604ef },
{ WM_COMPAREITEM, sent|wparam|lparam|parent, 0xf30604ee, 0xf30604ef },
{ WM_MEASUREITEM, sent|wparam|lparam|parent, 0xf2f2, 0xf30604ef },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CLIENT, 3 },
{ 0 }
}

Definition at line 17084 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_click_0

const struct message wm_lb_click_0[]
static

Definition at line 17009 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_dblclick_0

const struct message wm_lb_dblclick_0[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 17100 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_deletestring

const struct message wm_lb_deletestring[]
static
Initial value:

Definition at line 17041 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_deletestring_reset

const struct message wm_lb_deletestring_reset[]
static

◆ wm_lb_setcursel_0

const struct message wm_lb_setcursel_0[]
static
Initial value:
=
{
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 },
{ EVENT_OBJECT_SELECTION, winevent_hook|wparam|lparam, OBJID_CLIENT, 1 },
{ 0 }
}
#define WM_CTLCOLORLISTBOX
Definition: winuser.h:1796

Definition at line 16978 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_setcursel_1

const struct message wm_lb_setcursel_1[]
static
Initial value:
=
{
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 2 },
{ EVENT_OBJECT_SELECTION, winevent_hook|wparam|lparam, OBJID_CLIENT, 2 },
{ 0 }
}

Definition at line 16987 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_lb_setcursel_2

const struct message wm_lb_setcursel_2[]
static
Initial value:
=
{
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 3 },
{ EVENT_OBJECT_SELECTION, winevent_hook|wparam|lparam, OBJID_CLIENT, 3 },
{ 0 }
}

Definition at line 16998 of file msg.c.

Referenced by test_listbox_messages().

◆ wm_popup_menu_1

const struct message wm_popup_menu_1[]
static

Definition at line 17399 of file msg.c.

Referenced by test_menu_messages().

◆ wm_popup_menu_2

const struct message wm_popup_menu_2[]
static

Definition at line 17435 of file msg.c.

Referenced by test_menu_messages().

◆ wm_popup_menu_3

const struct message wm_popup_menu_3[]
static

Definition at line 17490 of file msg.c.

Referenced by test_menu_messages().

◆ wm_single_menu_item

const struct message wm_single_menu_item[]
static
Initial value:
=
{
{ WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'Q', 0x20000001 },
{ WM_SYSKEYDOWN, sent|wparam|lparam, 'Q', 0x20000001 },
{ WM_SYSCHAR, sent|wparam|lparam, 'q', 0x20000001 },
{ WM_INITMENU, sent|lparam, 0, 0 },
{ WM_MENUCOMMAND, sent },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'Q', 0xe0000001 },
{ WM_SYSKEYUP, sent|wparam|lparam, 'Q', 0xe0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_CHAR, sent|wparam|lparam, VK_ESCAPE, 0x00000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_ESCAPE, 0xc0000001 },
{ 0 }
}
#define SC_KEYMENU
Definition: winuser.h:2632
#define MF_HILITE
Definition: winuser.h:205

Definition at line 17546 of file msg.c.

Referenced by test_menu_messages().

◆ WmAltPressRelease

const struct message WmAltPressRelease[]
static
Initial value:
= {
{ WM_SYSKEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
{ WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
{ WM_SYSKEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_SYSKEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 1 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0, },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 },
{ WM_SYSKEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_SYSKEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
{ 0 }
}
#define OBJID_SYSMENU
Definition: winable.h:16
#define MF_RIGHTJUSTIFY
Definition: winuser.h:144
#define MF_SYSMENU
Definition: winuser.h:141
#define MF_POPUP
Definition: winuser.h:136

Definition at line 10444 of file msg.c.

Referenced by test_accelerators().

◆ WmAltVkN

const struct message WmAltVkN[]
static

Definition at line 10324 of file msg.c.

Referenced by test_accelerators().

◆ WmAltVkN_2

const struct message WmAltVkN_2[]
static
Initial value:
= {
{ WM_SYSKEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
{ WM_SYSKEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0x20000001 },
{ WM_SYSKEYDOWN, wparam|lparam, 'N', 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xe0000001 },
{ WM_SYSKEYUP, wparam|lparam, 'N', 0xe0000001 },
{ WM_SYSKEYUP, sent|wparam|lparam, 'N', 0xe0000001 },
{ WM_KEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
{ 0 }
}

Definition at line 10358 of file msg.c.

Referenced by test_accelerators().

◆ WmChildActivateDisabledWindowSeq

const struct message WmChildActivateDisabledWindowSeq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 3123 of file msg.c.

Referenced by test_mdi_messages().

◆ WmChildActivateWindowSeq

◆ WmChildPaintNc

const struct message WmChildPaintNc[]
static
Initial value:

Definition at line 8454 of file msg.c.

Referenced by test_paint_messages().

◆ WmClearStateButtonSeq

const struct message WmClearStateButtonSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}
#define BN_UNHILITE
Definition: winuser.h:1963

Definition at line 6745 of file msg.c.

Referenced by test_button_messages().

◆ WmClearStateOwnerdrawSeq

const struct message WmClearStateOwnerdrawSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6775 of file msg.c.

Referenced by test_button_messages().

◆ WmContextMenuSeq

struct message WmContextMenuSeq[]
static
Initial value:

Definition at line 17940 of file msg.c.

Referenced by test_defwinproc().

◆ WmCreateChildPopupSeq

const struct message WmCreateChildPopupSeq[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_MOVE, sent },
{ 0 }
}
#define HCBT_CREATEWND
Definition: winuser.h:58
#define SIZE_RESTORED
Definition: winuser.h:2541

Definition at line 1082 of file msg.c.

Referenced by test_messages().

◆ WmCreateChildSeq

const struct message WmCreateChildSeq[]
static
Initial value:

Definition at line 1430 of file msg.c.

Referenced by invisible_parent_tests(), and test_messages().

◆ WmCreateCustomDialogSeq

const struct message WmCreateCustomDialogSeq[]
static

Definition at line 1692 of file msg.c.

Referenced by test_messages().

◆ WmCreateDialogParamSeq_0

const struct message WmCreateDialogParamSeq_0[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_MOVE, sent },
{ WM_CHANGEUISTATE, sent|optional },
{ 0 }
}

Definition at line 15858 of file msg.c.

Referenced by test_dialog_messages().

◆ WmCreateDialogParamSeq_1

const struct message WmCreateDialogParamSeq_1[]
static

◆ WmCreateDialogParamSeq_2

const struct message WmCreateDialogParamSeq_2[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_MOVE, sent },
{ WM_CHANGEUISTATE, sent|optional },
{ 0 }
}

Definition at line 15902 of file msg.c.

Referenced by test_dialog_messages().

◆ WmCreateDialogParamSeq_3

const struct message WmCreateDialogParamSeq_3[]
static

Definition at line 15914 of file msg.c.

Referenced by test_dialog_messages().

◆ WmCreateDialogParamSeq_4

const struct message WmCreateDialogParamSeq_4[]
static

Definition at line 15947 of file msg.c.

Referenced by test_dialog_messages().

◆ WmCreateInvisibleMaxPopupSeq

const struct message WmCreateInvisibleMaxPopupSeq[]
static
Initial value:

Definition at line 785 of file msg.c.

Referenced by test_showwindow().

◆ WmCreateInvisiblePopupSeq

const struct message WmCreateInvisiblePopupSeq[]
static
Initial value:
= {
{ WM_STYLECHANGING, sent },
{ WM_STYLECHANGED, sent },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_MOVE, sent },
{ 0 }
}

Definition at line 1095 of file msg.c.

Referenced by test_messages().

◆ WmCreateMaximizedChildSeq

◆ WmCreateMaxPopupSeq

const struct message WmCreateMaxPopupSeq[]
static

Definition at line 741 of file msg.c.

Referenced by test_showwindow().

◆ WmCreateMDIchildInvisibleMaxSeq4

const struct message WmCreateMDIchildInvisibleMaxSeq4[]
static

Definition at line 3525 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIchildInvisibleParentSeq

const struct message WmCreateMDIchildInvisibleParentSeq[]
static

Definition at line 3148 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIchildInvisibleSeq

const struct message WmCreateMDIchildInvisibleSeq[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_MOVE, sent },
{ 0 }
}

Definition at line 3252 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIchildVisibleMaxSeq1

const struct message WmCreateMDIchildVisibleMaxSeq1[]
static

Definition at line 3284 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIchildVisibleMaxSeq2

const struct message WmCreateMDIchildVisibleMaxSeq2[]
static

Definition at line 3342 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIchildVisibleMaxSeq3

const struct message WmCreateMDIchildVisibleMaxSeq3[]
static

Definition at line 3423 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIchildVisibleSeq

const struct message WmCreateMDIchildVisibleSeq[]
static

Definition at line 3082 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateMDIclientSeq

const struct message WmCreateMDIclientSeq[]
static

◆ WmCreateMDIframeSeq

const struct message WmCreateMDIframeSeq[]
static

Definition at line 2976 of file msg.c.

Referenced by test_mdi_messages().

◆ WmCreateOverlappedSeq

const struct message WmCreateOverlappedSeq[]
static
Initial value:
= {
{ 0x0093, sent|defwinproc|optional },
{ 0x0094, sent|defwinproc|optional },
{ EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 188 of file msg.c.

Referenced by test_messages().

◆ WmCreatePopupSeq

const struct message WmCreatePopupSeq[]
static

Definition at line 869 of file msg.c.

Referenced by test_showwindow().

◆ WmCreateVisibleChildSeq

const struct message WmCreateVisibleChildSeq[]
static

◆ WmCtrlAltShiftVkN

const struct message WmCtrlAltShiftVkN[]
static
Initial value:
= {
{ WM_KEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
{ WM_KEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
{ WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0x20000001 },
{ WM_KEYDOWN, sent|wparam|lparam, VK_SHIFT, 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0x20000001 },
{ WM_KEYDOWN, wparam|lparam, 'N', 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xe0000001 },
{ WM_KEYUP, wparam|lparam, 'N', 0xe0000001 },
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xe0000001 },
{ WM_KEYUP, wparam|lparam, VK_SHIFT, 0xe0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_SHIFT, 0xe0000001 },
{ WM_KEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_KEYUP, wparam|lparam, VK_CONTROL, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_CONTROL, 0xc0000001 },
{ 0 }
}

Definition at line 10417 of file msg.c.

Referenced by test_accelerators().

◆ WmCtrlAltVkN

const struct message WmCtrlAltVkN[]
static
Initial value:
= {
{ WM_KEYDOWN, wparam|lparam, VK_MENU, 0x20000001 },
{ WM_KEYDOWN, sent|wparam|lparam, VK_MENU, 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0x20000001 },
{ WM_KEYDOWN, wparam|lparam, 'N', 0x20000001 },
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 0x20000001 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xe0000001 },
{ WM_KEYUP, wparam|lparam, 'N', 0xe0000001 },
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xe0000001 },
{ WM_KEYUP, wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_MENU, 0xc0000001 },
{ WM_KEYUP, wparam|lparam, VK_CONTROL, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_CONTROL, 0xc0000001 },
{ 0 }
}

Definition at line 10373 of file msg.c.

Referenced by test_accelerators().

◆ WmCtrlShiftVkN

const struct message WmCtrlShiftVkN[]
static
Initial value:

Definition at line 10396 of file msg.c.

Referenced by test_accelerators().

◆ WmCtrlVkN

const struct message WmCtrlVkN[]
static
Initial value:
= {
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 1 },
{ WM_CHAR, wparam|lparam, 0x000e, 1 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xc0000001 },
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
{ WM_KEYUP, wparam|lparam, VK_CONTROL, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_CONTROL, 0xc0000001 },
{ 0 }
}

Definition at line 10292 of file msg.c.

Referenced by test_accelerators().

◆ WmCtrlVkN_2

const struct message WmCtrlVkN_2[]
static
Initial value:

Definition at line 10309 of file msg.c.

Referenced by test_accelerators().

◆ WmDefDlgSetFocus_1

◆ WmDefDlgSetFocus_2

const struct message WmDefDlgSetFocus_2[]
static
Initial value:

Definition at line 15846 of file msg.c.

Referenced by test_dialog_messages().

◆ WmDestroyChildSeq

◆ WmDestroyInvisibleChildSeq

const struct message WmDestroyInvisibleChildSeq[]
static
Initial value:
= {
{ 0x0090, sent|optional },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 1669 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmDestroyMDIchildInvisibleSeq

const struct message WmDestroyMDIchildInvisibleSeq[]
static
Initial value:
= {
{ 0x0090, sent|optional },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 3269 of file msg.c.

Referenced by test_mdi_messages().

◆ WmDestroyMDIchildVisibleMaxSeq1

const struct message WmDestroyMDIchildVisibleMaxSeq1[]
static

Definition at line 3654 of file msg.c.

Referenced by test_mdi_messages().

◆ WmDestroyMDIchildVisibleMaxSeq2

const struct message WmDestroyMDIchildVisibleMaxSeq2[]
static

Definition at line 3563 of file msg.c.

Referenced by test_mdi_messages().

◆ WmDestroyMDIchildVisibleSeq

const struct message WmDestroyMDIchildVisibleSeq[]
static

Definition at line 3183 of file msg.c.

Referenced by test_mdi_messages().

◆ WmDestroyMDIclientSeq

◆ WmDestroyMDIframeSeq

◆ WmDestroyOverlappedSeq

◆ WmDisableButtonSeq

const struct message WmDisableButtonSeq[]
static
Initial value:

Definition at line 6754 of file msg.c.

Referenced by test_button_messages().

◆ WmDispatchPaint

const struct message WmDispatchPaint[]
static
Initial value:

Definition at line 13050 of file msg.c.

Referenced by test_DispatchMessage().

◆ WmDrawMenuBarSeq

◆ WmEmptySeq

◆ WmEnableWindowSeq_1

const struct message WmEnableWindowSeq_1[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 2016 of file msg.c.

Referenced by test_messages().

◆ WmEnableWindowSeq_2

const struct message WmEnableWindowSeq_2[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ 0 }
}

Definition at line 2026 of file msg.c.

Referenced by test_messages().

◆ WmEnableWindowSeq_3

const struct message WmEnableWindowSeq_3[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 2033 of file msg.c.

Referenced by test_messages().

◆ WmEnableWindowSeq_4

const struct message WmEnableWindowSeq_4[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ 0 }
}

Definition at line 2040 of file msg.c.

Referenced by test_messages().

◆ WmEndCustomDialogSeq

◆ WmErase

const struct message WmErase[]
static
Initial value:
= {
{ 0 }
}

Definition at line 8398 of file msg.c.

Referenced by test_paint_messages().

◆ WmExitThreadSeq

const struct message WmExitThreadSeq[]
static
Initial value:

Definition at line 1662 of file msg.c.

Referenced by test_interthread_messages().

◆ WmF1Seq

const struct message WmF1Seq[]
static
Initial value:
= {
{ WM_KEYDOWN, sent|wparam|lparam, VK_F1, 0x00000001 },
{ WM_KEYF1, wparam|lparam, 0, 0 },
{ WM_KEYF1, sent|wparam|lparam, 0, 0 },
{ WM_HELP, sent|defwinproc },
{ WM_KEYUP, wparam|lparam, VK_F1, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_F1, 0xc0000001 },
{ 0 }
}
#define WM_KEYF1
Definition: msg.c:49

Definition at line 10490 of file msg.c.

Referenced by test_accelerators().

◆ WmFirstDrawChildSeq1

const struct message WmFirstDrawChildSeq1[]
static
Initial value:
= {
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ 0 }
}

Definition at line 1414 of file msg.c.

Referenced by test_messages().

◆ WmFirstDrawChildSeq2

const struct message WmFirstDrawChildSeq2[]
static
Initial value:
= {
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ 0 }
}

Definition at line 1419 of file msg.c.

Referenced by test_messages().

◆ WmFirstDrawSetWindowPosSeq1

const struct message WmFirstDrawSetWindowPosSeq1[]
static

Definition at line 1257 of file msg.c.

Referenced by test_messages().

◆ WmFirstDrawSetWindowPosSeq2

const struct message WmFirstDrawSetWindowPosSeq2[]
static
Initial value:

Definition at line 1288 of file msg.c.

Referenced by test_messages().

◆ WmFirstDrawSetWindowPosSeq3

const struct message WmFirstDrawSetWindowPosSeq3[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_MOVE, sent },
{ EVENT_OBJECT_SHOW, winevent_hook|wine_only },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|wine_only, 0, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|lparam|wparam|wine_only, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|lparam|wparam|wine_only, 0, 0 },
{ 0 }
}

Definition at line 1317 of file msg.c.

Referenced by test_messages().

◆ WmFirstDrawSetWindowPosSeq4

const struct message WmFirstDrawSetWindowPosSeq4[]
static

◆ WmFirstDrawSetWindowPosSeq5

const struct message WmFirstDrawSetWindowPosSeq5[]
static
Initial value:

Definition at line 1367 of file msg.c.

Referenced by test_messages().

◆ WmFirstDrawSetWindowPosSeq6

const struct message WmFirstDrawSetWindowPosSeq6[]
static
Initial value:

Definition at line 1394 of file msg.c.

Referenced by test_messages().

◆ WmFrameChanged

const struct message WmFrameChanged[]
static

◆ WmFrameChanged_move

const struct message WmFrameChanged_move[]
static
Initial value:

Definition at line 6170 of file msg.c.

Referenced by test_setwindowpos().

◆ WmGetScrollInfoSeq

const struct message WmGetScrollInfoSeq[]
static
Initial value:
=
{
{ SBM_GETSCROLLINFO, sent },
{ 0 }
}

Definition at line 2051 of file msg.c.

Referenced by test_scroll_messages().

◆ WmGetScrollRangeSeq

const struct message WmGetScrollRangeSeq[]
static
Initial value:
=
{
{ 0 }
}
#define SBM_GETRANGE
Definition: winuser.h:2115

Definition at line 2046 of file msg.c.

Referenced by test_scroll_messages().

◆ WmGetTextLengthAfromW

const struct message WmGetTextLengthAfromW[]
static
Initial value:
= {
{ 0 }
}

Definition at line 11493 of file msg.c.

Referenced by test_message_conversion().

◆ WmGetUpdateRect

const struct message WmGetUpdateRect[]
static
Initial value:

Definition at line 8355 of file msg.c.

Referenced by test_paint_messages().

◆ WmGlobalHookSeq_1

const struct message WmGlobalHookSeq_1[]
static
Initial value:

Definition at line 11964 of file msg.c.

Referenced by test_winevents().

◆ WmGlobalHookSeq_2

const struct message WmGlobalHookSeq_2[]
static

◆ WmHide_1

◆ WmHide_2

const struct message WmHide_2[]
static
Initial value:
= {
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 15309 of file msg.c.

Referenced by test_ShowWindow().

◆ WmHide_3

◆ WmHideChildInvisibleParentSeq

const struct message WmHideChildInvisibleParentSeq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 1620 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmHideChildInvisibleParentSeq_2

◆ WmHideChildSeq

◆ WmHideChildSeq2

◆ WmHideMDIclientSeq

◆ WmHideOverlappedSeq

◆ WmHotkeyCombined

const struct message WmHotkeyCombined[]
static
Initial value:

Definition at line 19184 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyNew

const struct message WmHotkeyNew[]
static
Initial value:
= {
{ HCBT_KEYSKIPPED, hook|optional, 0, 0x80000001 },
{ WM_KEYUP, sent, 0, 0x80000001 },
{ 0 }
}

Definition at line 19215 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyPress

const struct message WmHotkeyPress[]
static
Initial value:
= {
{ 0 }
}

Definition at line 19167 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyPressALT

const struct message WmHotkeyPressALT[]
static
Initial value:

Definition at line 19223 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyPressLWIN

const struct message WmHotkeyPressLWIN[]
static
Initial value:

Definition at line 19161 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyPressWithALT

const struct message WmHotkeyPressWithALT[]
static
Initial value:

Definition at line 19229 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyPrevious

◆ WmHotkeyRelease

const struct message WmHotkeyRelease[]
static
Initial value:
= {
{ HCBT_KEYSKIPPED, hook|lparam|optional, 0, 0x80000001 },
{ WM_KEYUP, sent|lparam, 0, 0x80000001 },
{ 0 }
}

Definition at line 19172 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyReleaseALT

const struct message WmHotkeyReleaseALT[]
static
Initial value:

Definition at line 19240 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyReleaseLWIN

const struct message WmHotkeyReleaseLWIN[]
static
Initial value:

Definition at line 19178 of file msg.c.

Referenced by test_hotkey().

◆ WmHotkeyReleaseWithALT

const struct message WmHotkeyReleaseWithALT[]
static
Initial value:
= {
{ HCBT_KEYSKIPPED, hook|lparam|optional, 0, 0xa0000001 },
{ WM_SYSKEYUP, sent|lparam, 0, 0xa0000001 },
{ 0 }
}

Definition at line 19234 of file msg.c.

Referenced by test_hotkey().

◆ WmImeKeydownMsgSeq_0

const struct message WmImeKeydownMsgSeq_0[]
static
Initial value:
=
{
{ WM_CHAR, wparam, 'A' },
{ 0 }
}

Definition at line 8221 of file msg.c.

Referenced by test_wmime_keydown_message().

◆ WmImeKeydownMsgSeq_1

const struct message WmImeKeydownMsgSeq_1[]
static
Initial value:

Definition at line 8228 of file msg.c.

Referenced by test_wmime_keydown_message().

◆ WmInitEndSession

const struct message WmInitEndSession[]
static
Initial value:
= {
{ 0x003B, sent },
{ WM_QUERYENDSESSION, sent|defwinproc|wparam|lparam, 0, ENDSESSION_LOGOFF },
{ 0 }
}

Definition at line 5329 of file msg.c.

Referenced by test_messages().

◆ WmInitEndSession_2

const struct message WmInitEndSession_2[]
static
Initial value:
= {
{ 0x003B, sent },
{ 0 }
}

Definition at line 5336 of file msg.c.

Referenced by test_messages().

◆ WmInitEndSession_3

const struct message WmInitEndSession_3[]
static
Initial value:
= {
{ 0x003B, sent },
{ WM_ENDSESSION, sent|defwinproc|wparam|lparam, 0, ENDSESSION_LOGOFF },
{ 0 }
}

Definition at line 5343 of file msg.c.

Referenced by test_messages().

◆ WmInitEndSession_4

const struct message WmInitEndSession_4[]
static
Initial value:
= {
{ 0x003B, sent },
{ 0 }
}

Definition at line 5350 of file msg.c.

Referenced by test_messages().

◆ WmInitEndSession_5

const struct message WmInitEndSession_5[]
static
Initial value:
= {
{ 0x003B, sent },
{ WM_ENDSESSION, sent|defwinproc|lparam, 1, ENDSESSION_LOGOFF },
{ 0 }
}

Definition at line 5357 of file msg.c.

Referenced by test_messages().

◆ WmInvalidateErase

const struct message WmInvalidateErase[]
static
Initial value:

Definition at line 8368 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateErasePaint

const struct message WmInvalidateErasePaint[]
static
Initial value:

Definition at line 8382 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateErasePaint2

const struct message WmInvalidateErasePaint2[]
static
Initial value:

Definition at line 8390 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateFull

const struct message WmInvalidateFull[]
static
Initial value:

Definition at line 8362 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidatePaint

const struct message WmInvalidatePaint[]
static
Initial value:

Definition at line 8375 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateParent

const struct message WmInvalidateParent[]
static
Initial value:

Definition at line 8413 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateParentChild

const struct message WmInvalidateParentChild[]
static
Initial value:

Definition at line 8420 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateParentChild2

const struct message WmInvalidateParentChild2[]
static
Initial value:

Definition at line 8430 of file msg.c.

Referenced by test_paint_messages().

◆ WmInvalidateRgn

const struct message WmInvalidateRgn[]
static
Initial value:

Definition at line 8349 of file msg.c.

Referenced by test_paint_messages().

◆ WmKeyDownComboSeq

const struct message WmKeyDownComboSeq[]
static
Initial value:

Definition at line 7879 of file msg.c.

Referenced by test_combobox_messages().

◆ WmKeyDownSkippedSeq

const struct message WmKeyDownSkippedSeq[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 13808 of file msg.c.

Referenced by test_PeekMessage().

◆ WmKeyDownWasDownSkippedSeq

const struct message WmKeyDownWasDownSkippedSeq[]
static
Initial value:
=
{
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0x40000001 },
{ 0 }
}

Definition at line 13813 of file msg.c.

Referenced by test_PeekMessage().

◆ WmKeyPressNormal

const struct message WmKeyPressNormal[]
static
Initial value:
= {
{ WM_KEYDOWN, sent|wparam|lparam, 0x41, 0x1 },
{ 0 }
}

Definition at line 19039 of file msg.c.

Referenced by test_keyflags().

◆ WmKeyPressRepeat

const struct message WmKeyPressRepeat[]
static
Initial value:
= {
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0x40000001 },
{ WM_KEYDOWN, sent|wparam|lparam, 0x41, 0x40000001 },
{ 0 }
}

Definition at line 19044 of file msg.c.

Referenced by test_keyflags().

◆ WmKeyReleaseNormal

const struct message WmKeyReleaseNormal[]
static
Initial value:
= {
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, 0x41, 0xc0000001 },
{ 0 }
}

Definition at line 19049 of file msg.c.

Referenced by test_keyflags().

◆ WmKeyReleaseOnly

const struct message WmKeyReleaseOnly[]
static
Initial value:
= {
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 0x41, 0x80000001 },
{ WM_KEYUP, sent|wparam|lparam, 0x41, 0x80000001 },
{ 0 }
}

Definition at line 19034 of file msg.c.

Referenced by test_keyflags().

◆ WmKeyUpSkippedSeq

const struct message WmKeyUpSkippedSeq[]
static
Initial value:
=
{
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xc0000001 },
{ 0 }
}

Definition at line 13818 of file msg.c.

Referenced by test_PeekMessage().

◆ WmKillFocusButtonSeq

const struct message WmKillFocusButtonSeq[]
static
Initial value:

Definition at line 6469 of file msg.c.

Referenced by test_button_messages().

◆ WmKillFocusOwnerdrawSeq

const struct message WmKillFocusOwnerdrawSeq[]
static

◆ WmKillFocusStaticSeq

const struct message WmKillFocusStaticSeq[]
static

◆ WmLayeredWinEmptySeq

const struct message WmLayeredWinEmptySeq[]
static
Initial value:
= {
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 19842 of file msg.c.

Referenced by test_layered_window().

◆ WmLButtonDownSeq

const struct message WmLButtonDownSeq[]
static
Initial value:

Definition at line 6539 of file msg.c.

Referenced by test_button_messages().

◆ WmLButtonDownStaticSeq

const struct message WmLButtonDownStaticSeq[]
static
Initial value:

Definition at line 6554 of file msg.c.

Referenced by test_button_messages().

◆ WmLButtonUpAutoSeq

const struct message WmLButtonUpAutoSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6589 of file msg.c.

Referenced by test_button_messages().

◆ WmLButtonUpBrokenSeq

const struct message WmLButtonUpBrokenSeq[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 6604 of file msg.c.

Referenced by test_button_messages().

◆ WmLButtonUpSeq

const struct message WmLButtonUpSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6569 of file msg.c.

Referenced by test_button_messages().

◆ WmLButtonUpStaticSeq

const struct message WmLButtonUpStaticSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6579 of file msg.c.

Referenced by test_button_messages().

◆ WmMaximizeMDIchildInvisibleParentSeq

const struct message WmMaximizeMDIchildInvisibleParentSeq[]
static

Definition at line 3885 of file msg.c.

Referenced by test_mdi_messages().

◆ WmMaximizeMDIchildInvisibleSeq

const struct message WmMaximizeMDIchildInvisibleSeq[]
static

Definition at line 3824 of file msg.c.

Referenced by test_mdi_messages().

◆ WmMaximizeMDIchildInvisibleSeq2

const struct message WmMaximizeMDIchildInvisibleSeq2[]
static

◆ WmMaximizeMDIchildVisibleSeq

◆ WmMinimize_1

const struct message WmMinimize_1[]
static
Initial value:

Definition at line 15343 of file msg.c.

Referenced by test_ShowWindow().

◆ WmMinimize_2

const struct message WmMinimize_2[]
static
Initial value:

Definition at line 15357 of file msg.c.

Referenced by test_ShowWindow().

◆ WmMinimize_3

const struct message WmMinimize_3[]
static
Initial value:
= {
{ EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 15370 of file msg.c.

Referenced by test_ShowWindow().

◆ WmMinimizeMDIchildVisibleSeq

◆ WmMinMax_1

const struct message WmMinMax_1[]
static
Initial value:
= {
{ 0 }
}

Definition at line 15397 of file msg.c.

Referenced by test_ShowWindow().

◆ WmMinMax_2

◆ WmMinMax_3

◆ WmMinMax_4

const struct message WmMinMax_4[]
static
Initial value:
= {
{ 0 }
}

Definition at line 15423 of file msg.c.

Referenced by test_ShowWindow().

◆ WmModalDialogSeq

const struct message WmModalDialogSeq[]
static

Definition at line 1805 of file msg.c.

Referenced by test_messages().

◆ WmModalDialogSeq_2

const struct message WmModalDialogSeq_2[]
static
Initial value:
= {
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_CHANGEUISTATE, sent|optional },
{ WM_UPDATEUISTATE, sent|optional },
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ WM_CHANGEUISTATE, sent|optional },
{ WM_UPDATEUISTATE, sent|optional },
{ EVENT_SYSTEM_DIALOGEND, winevent_hook|wparam|lparam, 0, 0 },
{ 0x0090, sent|optional },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 1891 of file msg.c.

Referenced by test_dialog_messages().

◆ WmMouseHoverSeq

const struct message WmMouseHoverSeq[]
static
Initial value:

Definition at line 14821 of file msg.c.

Referenced by test_TrackMouseEvent().

◆ WmMouseLLHookSeq

const struct message WmMouseLLHookSeq[]
static
Initial value:
= {
{ 0 }
}

Definition at line 11980 of file msg.c.

Referenced by test_winevents().

◆ WmMove_mouse

◆ WmMove_mouse2

const struct message WmMove_mouse2[]
static
Initial value:

Definition at line 6206 of file msg.c.

Referenced by test_setwindowpos().

◆ WmNotifySeq

const struct message WmNotifySeq[]
static
Initial value:
= {
{ WM_NOTIFY, sent|wparam|lparam, 0x1234, 0xdeadbeef },
{ 0 }
}

Definition at line 14757 of file msg.c.

Referenced by test_notify_message().

◆ WmOptionalPaint

const struct message WmOptionalPaint[]
static
Initial value:

Definition at line 5363 of file msg.c.

Referenced by test_messages().

◆ WmPaint

const struct message WmPaint[]
static
Initial value:
= {
{ WM_PAINT, sent },
{ 0 }
}

Definition at line 8403 of file msg.c.

Referenced by test_paint_messages(), and test_PeekMessage().

◆ WmParentErasePaint

◆ WmParentOnlyNcPaint

const struct message WmParentOnlyNcPaint[]
static
Initial value:

Definition at line 8474 of file msg.c.

Referenced by test_paint_messages().

◆ WmParentOnlyPaint

const struct message WmParentOnlyPaint[]
static
Initial value:
= {
{ 0 }
}

Definition at line 8408 of file msg.c.

Referenced by test_paint_messages().

◆ WmParentPaint

const struct message WmParentPaint[]
static
Initial value:
= {
{ WM_PAINT, sent },
{ 0 }
}

Definition at line 8438 of file msg.c.

Referenced by test_paint_messages().

◆ WmParentPaintNc

const struct message WmParentPaintNc[]
static
Initial value:

Definition at line 8444 of file msg.c.

Referenced by test_paint_messages().

◆ WmQuitDialogSeq

const struct message WmQuitDialogSeq[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, 0, 0 },
{ WM_CHANGEUISTATE, sent|optional },
{ EVENT_SYSTEM_DIALOGEND, winevent_hook|wparam|lparam, 0, 0 },
{ 0x0090, sent|optional },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 14641 of file msg.c.

Referenced by test_quit_message().

◆ WmResizingChildWithMoveWindowSeq

const struct message WmResizingChildWithMoveWindowSeq[]
static
Initial value:

Definition at line 1680 of file msg.c.

Referenced by test_messages().

◆ WmRestore_1

const struct message WmRestore_1[]
static
Initial value:

Definition at line 15224 of file msg.c.

Referenced by test_ShowWindow().

◆ WmRestore_2

◆ WmRestore_3

const struct message WmRestore_3[]
static
Initial value:

Definition at line 15256 of file msg.c.

Referenced by test_ShowWindow().

◆ WmRestore_4

◆ WmRestore_5

◆ WmRestoreActiveMinimizedOverlappedSeq

const struct message WmRestoreActiveMinimizedOverlappedSeq[]
static

Definition at line 17898 of file msg.c.

Referenced by test_defwinproc().

◆ WmRestoreMDIchildInvisibleSeq

◆ WmRestoreMDIchildVisibleSeq

◆ WmRestoreMDIchildVisibleSeq_2

const struct message WmRestoreMDIchildVisibleSeq_2[]
static

◆ WmRestoreMinimizedOverlappedSeq

const struct message WmRestoreMinimizedOverlappedSeq[]
static

Definition at line 17852 of file msg.c.

Referenced by test_defwinproc().

◆ WmRestoreMinimizedSeq

const struct message WmRestoreMinimizedSeq[]
static

Definition at line 20467 of file msg.c.

Referenced by test_restore_messages().

◆ WmSetCheckIgnoredSeq

const struct message WmSetCheckIgnoredSeq[]
static
Initial value:
=
{
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6784 of file msg.c.

Referenced by test_button_messages().

◆ WmSetCheckStaticSeq

const struct message WmSetCheckStaticSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6790 of file msg.c.

Referenced by test_button_messages().

◆ WmSetFocus_1

◆ WmSetFocus_2

const struct message WmSetFocus_2[]
static
Initial value:
= {
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ 0 }
}

Definition at line 19613 of file msg.c.

Referenced by test_SetFocus().

◆ WmSetFocus_3

const struct message WmSetFocus_3[]
static
Initial value:
= {
{ 0 }
}

Definition at line 19620 of file msg.c.

Referenced by test_SetFocus().

◆ WmSetFocusButtonSeq

const struct message WmSetFocusButtonSeq[]
static
Initial value:

Definition at line 6457 of file msg.c.

Referenced by test_button_messages().

◆ WMSetFocusComboBoxSeq

◆ WmSetFocusOwnerdrawSeq

const struct message WmSetFocusOwnerdrawSeq[]
static
Initial value:

Definition at line 6510 of file msg.c.

Referenced by test_button_messages().

◆ WmSetFocusStaticSeq

◆ WmSetFontButtonSeq

const struct message WmSetFontButtonSeq[]
static
Initial value:

Definition at line 6609 of file msg.c.

Referenced by test_button_messages().

◆ WmSetFontOwnerdrawSeq

const struct message WmSetFontOwnerdrawSeq[]
static
Initial value:

Definition at line 6617 of file msg.c.

Referenced by test_button_messages().

◆ WmSetFontStaticSeq

const struct message WmSetFontStaticSeq[]
static
Initial value:

Definition at line 6626 of file msg.c.

Referenced by test_button_messages().

◆ WmSetFontStaticSeq2

const struct message WmSetFontStaticSeq2[]
static
Initial value:

Definition at line 7749 of file msg.c.

Referenced by test_static_messages().

◆ WmSetIcon_1

const struct message WmSetIcon_1[]
static
Initial value:
= {
{ WM_SETICON, sent },
{ 0x00AE, sent|defwinproc|optional },
{ 0 }
}

Definition at line 5314 of file msg.c.

Referenced by test_messages().

◆ WmSetIcon_2

const struct message WmSetIcon_2[]
static
Initial value:
= {
{ WM_SETICON, sent },
{ 0 }
}

Definition at line 5323 of file msg.c.

Referenced by test_messages().

◆ WmSetLayeredStyle

const struct message WmSetLayeredStyle[]
static
Initial value:
= {
{ WM_STYLECHANGING, sent },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ WM_STYLECHANGED, sent },
{ 0 }
}

Definition at line 19821 of file msg.c.

Referenced by test_layered_window().

◆ WmSetLayeredStyle2

◆ WmSetMenuNonVisibleNoSizeChangeSeq

const struct message WmSetMenuNonVisibleNoSizeChangeSeq[]
static

◆ WmSetMenuNonVisibleSizeChangeSeq

const struct message WmSetMenuNonVisibleSizeChangeSeq[]
static

◆ WmSetMenuVisibleNoSizeChangeSeq

◆ WmSetMenuVisibleSizeChangeSeq

const struct message WmSetMenuVisibleSizeChangeSeq[]
static

◆ WmSetParentSeq_1

const struct message WmSetParentSeq_1[]
static
Initial value:

Definition at line 18912 of file msg.c.

Referenced by test_SetParent().

◆ WmSetParentSeq_2

const struct message WmSetParentSeq_2[]
static
Initial value:
= {
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_PARENTCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 18924 of file msg.c.

Referenced by test_SetParent().

◆ WmSetParentStyle

const struct message WmSetParentStyle[]
static
Initial value:
= {
{ WM_STYLECHANGING, sent|parent },
{ WM_STYLECHANGED, sent|parent },
{ 0 }
}

Definition at line 8481 of file msg.c.

Referenced by test_paint_messages().

◆ WmSetPosComboSeq

◆ WmSetRedrawFalseSeq

const struct message WmSetRedrawFalseSeq[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 2004 of file msg.c.

Referenced by test_WM_SETREDRAW().

◆ WmSetRedrawTrueSeq

const struct message WmSetRedrawTrueSeq[]
static
Initial value:
=
{
{ 0 }
}

Definition at line 2010 of file msg.c.

Referenced by test_WM_SETREDRAW().

◆ WmSetScrollRangeHSeq_empty

const struct message WmSetScrollRangeHSeq_empty[]
static
Initial value:
=
{
{ EVENT_OBJECT_VALUECHANGE, winevent_hook|wparam|lparam, OBJID_HSCROLL, 0 },
{ 0 }
}
#define OBJID_HSCROLL
Definition: winable.h:21

Definition at line 2065 of file msg.c.

Referenced by test_hv_scroll_2().

◆ WmSetScrollRangeHV_NC_Seq

const struct message WmSetScrollRangeHV_NC_Seq[]
static
Initial value:

Definition at line 2087 of file msg.c.

Referenced by test_hv_scroll_1(), and test_hv_scroll_2().

◆ WmSetScrollRangeHVSeq

◆ WmSetScrollRangeSeq

const struct message WmSetScrollRangeSeq[]
static
Initial value:
=
{
{ SBM_SETSCROLLINFO, sent },
{ 0 }
}

Definition at line 2056 of file msg.c.

Referenced by test_scroll_messages().

◆ WmSetScrollRangeVSeq_empty

const struct message WmSetScrollRangeVSeq_empty[]
static
Initial value:
=
{
{ EVENT_OBJECT_VALUECHANGE, winevent_hook|wparam|lparam, OBJID_VSCROLL, 0 },
{ 0 }
}
#define OBJID_VSCROLL
Definition: winable.h:20

Definition at line 2070 of file msg.c.

Referenced by test_hv_scroll_2().

◆ WmSetStateButtonSeq

const struct message WmSetStateButtonSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6711 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStateOwnerdrawSeq

const struct message WmSetStateOwnerdrawSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6736 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStateStaticSeq

const struct message WmSetStateStaticSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}

Definition at line 6719 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStateUserSeq

const struct message WmSetStateUserSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ 0 }
}
#define BN_HILITE
Definition: winuser.h:1958

Definition at line 6727 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStyleButtonSeq

const struct message WmSetStyleButtonSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}

Definition at line 6667 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStyleOwnerdrawSeq

const struct message WmSetStyleOwnerdrawSeq[]
static
Initial value:

Definition at line 6699 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStyleStaticSeq

const struct message WmSetStyleStaticSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_APP, sent|wparam|lparam, 0, 0 },
{ WM_PAINT, sent },
{ 0 }
}

Definition at line 6677 of file msg.c.

Referenced by test_button_messages().

◆ WmSetStyleUserSeq

const struct message WmSetStyleUserSeq[]
static
Initial value:

Definition at line 6687 of file msg.c.

Referenced by test_button_messages().

◆ WmSetTextButtonSeq

const struct message WmSetTextButtonSeq[]
static
Initial value:

Definition at line 6634 of file msg.c.

Referenced by test_button_messages().

◆ WmSetTextGroupSeq

const struct message WmSetTextGroupSeq[]
static
Initial value:

Definition at line 6652 of file msg.c.

Referenced by test_button_messages().

◆ WmSetTextInvisibleSeq

const struct message WmSetTextInvisibleSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_NAMECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 6661 of file msg.c.

Referenced by test_button_messages().

◆ WmSetTextStaticSeq

const struct message WmSetTextStaticSeq[]
static
Initial value:
=
{
{ EVENT_OBJECT_NAMECHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 6644 of file msg.c.

Referenced by test_button_messages().

◆ WmSetWindowRgn

◆ WmSetWindowRgn_clear

◆ WmSetWindowRgn_no_redraw

◆ WmShiftF10Seq

const struct message WmShiftF10Seq[]
static

Definition at line 10543 of file msg.c.

Referenced by test_accelerators().

◆ WmShiftMouseButton

const struct message WmShiftMouseButton[]
static

◆ WmShiftVkN

const struct message WmShiftVkN[]
static
Initial value:
= {
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 1 },
{ WM_CHAR, wparam|lparam, 'N', 1 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xc0000001 },
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
{ WM_KEYUP, wparam|lparam, VK_SHIFT, 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, VK_SHIFT, 0xc0000001 },
{ 0 }
}

Definition at line 10275 of file msg.c.

Referenced by test_accelerators().

◆ WmShow

◆ WmShowChildInvisibleParentSeq_1

◆ WmShowChildInvisibleParentSeq_1r

const struct message WmShowChildInvisibleParentSeq_1r[]
static
Initial value:
= {
{ 0 }
}

Definition at line 1552 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmShowChildInvisibleParentSeq_2

◆ WmShowChildInvisibleParentSeq_2r

const struct message WmShowChildInvisibleParentSeq_2r[]
static
Initial value:
= {
{ 0 }
}

Definition at line 1570 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmShowChildInvisibleParentSeq_3

const struct message WmShowChildInvisibleParentSeq_3[]
static

◆ WmShowChildInvisibleParentSeq_3r

const struct message WmShowChildInvisibleParentSeq_3r[]
static
Initial value:
= {
{ 0 }
}

Definition at line 1590 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmShowChildInvisibleParentSeq_4

◆ WmShowChildInvisibleParentSeq_4r

const struct message WmShowChildInvisibleParentSeq_4r[]
static
Initial value:
= {
{ 0 }
}

Definition at line 1610 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmShowChildInvisibleParentSeq_5

const struct message WmShowChildInvisibleParentSeq_5[]
static
Initial value:
= {
{ 0 }
}

Definition at line 1615 of file msg.c.

Referenced by invisible_parent_tests().

◆ WmShowChildInvisibleParentSeq_6

◆ WmShowChildSeq

◆ WmShowChildSeq_2

const struct message WmShowChildSeq_2[]
static

◆ WmShowChildSeq_3

◆ WmShowChildSeq_4

const struct message WmShowChildSeq_4[]
static
Initial value:

Definition at line 1531 of file msg.c.

Referenced by test_messages().

◆ WmShowCustomDialogSeq

◆ WmShowMaximized_1

const struct message WmShowMaximized_1[]
static
Initial value:

Definition at line 15427 of file msg.c.

Referenced by test_ShowWindow().

◆ WmShowMaximized_2

const struct message WmShowMaximized_2[]
static
Initial value:

Definition at line 15448 of file msg.c.

Referenced by test_ShowWindow().

◆ WmShowMaximized_3

◆ WmShowMaxOverlappedSeq

const struct message WmShowMaxOverlappedSeq[]
static

Definition at line 521 of file msg.c.

Referenced by test_messages().

◆ WmShowMaxPopupResizedSeq

const struct message WmShowMaxPopupResizedSeq[]
static

Definition at line 804 of file msg.c.

Referenced by test_showwindow().

◆ WmShowMaxPopupSeq

const struct message WmShowMaxPopupSeq[]
static

Definition at line 836 of file msg.c.

Referenced by test_showwindow().

◆ WmShowMDIclientSeq

◆ WmShowMinimized_1

const struct message WmShowMinimized_1[]
static
Initial value:

Definition at line 15326 of file msg.c.

Referenced by test_ShowWindow().

◆ WmShowMinNoActivate

const struct message WmShowMinNoActivate[]
static
Initial value:

Definition at line 15388 of file msg.c.

Referenced by test_ShowWindow().

◆ WmShowMinOverlappedSeq

const struct message WmShowMinOverlappedSeq[]
static

Definition at line 645 of file msg.c.

Referenced by test_messages().

◆ WmShowNA_1

◆ WmShowNA_2

◆ WmSHOWNAChildInvisParInvis

const struct message WmSHOWNAChildInvisParInvis[]
static
Initial value:
= {
{ 0 }
}

Definition at line 2117 of file msg.c.

Referenced by test_showwindow().

◆ WmSHOWNAChildInvisParVis

◆ WmSHOWNAChildVisParInvis

const struct message WmSHOWNAChildVisParInvis[]
static
Initial value:
= {
{ 0 }
}

Definition at line 2121 of file msg.c.

Referenced by test_showwindow().

◆ WmSHOWNAChildVisParVis

const struct message WmSHOWNAChildVisParVis[]
static
Initial value:

Definition at line 2125 of file msg.c.

Referenced by test_showwindow().

◆ WmSHOWNATopInvisible

◆ WmSHOWNATopVisible

◆ WmShowNoActivate_1

◆ WmShowNoActivate_2

const struct message WmShowNoActivate_2[]
static
Initial value:
= {
{ EVENT_OBJECT_REORDER, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|optional, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|wine_only, 0, 0 },
{ EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|wine_only, 0, 0 },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|wine_only, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|wine_only, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 15182 of file msg.c.

Referenced by test_ShowWindow().

◆ WmShowNoActivateActiveMinimizedOverlappedSeq

const struct message WmShowNoActivateActiveMinimizedOverlappedSeq[]
static

Definition at line 1041 of file msg.c.

Referenced by test_showwindow().

◆ WmShowNoActivateMinimizedOverlappedSeq

const struct message WmShowNoActivateMinimizedOverlappedSeq[]
static

Definition at line 959 of file msg.c.

Referenced by test_showwindow().

◆ WmShowNormal

const struct message WmShowNormal[]
static
Initial value:

Definition at line 15146 of file msg.c.

Referenced by test_ShowWindow().

◆ WmShowOverlappedSeq

const struct message WmShowOverlappedSeq[]
static

Definition at line 476 of file msg.c.

Referenced by test_messages().

◆ WmShowPopupExtremeLocationSeq

const struct message WmShowPopupExtremeLocationSeq[]
static

Definition at line 1138 of file msg.c.

Referenced by test_messages().

◆ WmShowPopupFirstDrawSeq_1

const struct message WmShowPopupFirstDrawSeq_1[]
static

Definition at line 1179 of file msg.c.

Referenced by test_messages().

◆ WmShowPopupFirstDrawSeq_2

const struct message WmShowPopupFirstDrawSeq_2[]
static

Definition at line 1215 of file msg.c.

Referenced by test_messages().

◆ WmShowRestoreActiveMinimizedOverlappedSeq

const struct message WmShowRestoreActiveMinimizedOverlappedSeq[]
static

Definition at line 1000 of file msg.c.

Referenced by test_showwindow().

◆ WmShowRestoreMaxOverlappedSeq

◆ WmShowRestoreMinimizedOverlappedSeq

const struct message WmShowRestoreMinimizedOverlappedSeq[]
static

Definition at line 920 of file msg.c.

Referenced by test_showwindow().

◆ WmShowRestoreMinOverlappedSeq

const struct message WmShowRestoreMinOverlappedSeq[]
static

Definition at line 588 of file msg.c.

Referenced by test_messages().

◆ WmShowVisiblePopupSeq_2

const struct message WmShowVisiblePopupSeq_2[]
static
Initial value:

Definition at line 1110 of file msg.c.

Referenced by test_messages().

◆ WmShowVisiblePopupSeq_3

◆ WmShowVisMaxPopupSeq

◆ WmStopQuitSeq

const struct message WmStopQuitSeq[]
static
Initial value:

Definition at line 14656 of file msg.c.

Referenced by test_quit_message().

◆ WmSwitchChild

const struct message WmSwitchChild[]
static

Definition at line 337 of file msg.c.

Referenced by test_mdi_messages().

◆ WmSwitchNotMaximizedChild

◆ WmSWP_FrameChanged_clip

◆ WmSWP_FrameChanged_noclip

◆ WmSWP_FrameChangedDeferErase

◆ WmSWP_HideOverlappedSeq

◆ WmSWP_MoveSeq

const struct message WmSWP_MoveSeq[]
static

◆ WmSWP_ResizeNoZOrder

◆ WmSWP_ResizePopupSeq

◆ WmSWP_ResizeSeq

◆ WmSWP_ShowOverlappedSeq

const struct message WmSWP_ShowOverlappedSeq[]
static

Definition at line 203 of file msg.c.

Referenced by test_messages().

◆ WmTrackPopupMenu

const struct message WmTrackPopupMenu[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_INITMENU, sent|lparam, 0, 0 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0x0093, sent|optional },
{ 0x0094, sent|optional },
{ 0x0094, sent|optional },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_SYSTEM_MENUPOPUPSTART, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_MENUPOPUPEND, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_UNINITMENUPOPUP, sent|lparam, 0, 0 },
{ WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 2222 of file msg.c.

Referenced by test_TrackPopupMenu().

◆ WmTrackPopupMenuAbort

const struct message WmTrackPopupMenuAbort[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_INITMENU, sent|lparam, 0, 0 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0x0093, sent|optional },
{ 0x0094, sent|optional },
{ 0x0094, sent|optional },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_SYSTEM_MENUPOPUPSTART, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_MENUPOPUPEND, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_UNINITMENUPOPUP, sent|lparam, 0, 0 },
{ WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 2308 of file msg.c.

Referenced by test_TrackPopupMenu().

◆ WmTrackPopupMenuCapture

const struct message WmTrackPopupMenuCapture[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_INITMENU, sent|lparam, 0, 0 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0x0093, sent|optional },
{ 0x0094, sent|optional },
{ 0x0094, sent|optional },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|optional, 0, 0 },
{ EVENT_SYSTEM_MENUPOPUPSTART, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_MENUPOPUPEND, winevent_hook|wparam|lparam|msg_todo, OBJID_CLIENT, 0 },
{ EVENT_OBJECT_HIDE, winevent_hook|wparam|lparam, 0, 0 },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_UNINITMENUPOPUP, sent|lparam, 0, 0 },
{ WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0 }
}

Definition at line 2255 of file msg.c.

Referenced by test_TrackPopupMenu().

◆ WmTrackPopupMenuEmpty

const struct message WmTrackPopupMenuEmpty[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_INITMENU, sent|lparam, 0, 0 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ 0x0093, sent|optional },
{ 0x0094, sent|optional },
{ 0x0094, sent|optional },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_OBJECT_DESTROY, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ WM_UNINITMENUPOPUP, sent|lparam, 0, 0 },
{ 0 }
}

Definition at line 2286 of file msg.c.

Referenced by test_TrackPopupMenuEmpty().

◆ WmTrackPopupMenuEsc

const struct message WmTrackPopupMenuEsc[]
static
Initial value:
= {
{ 0 }
}

Definition at line 2251 of file msg.c.

Referenced by test_TrackPopupMenu().

◆ WmTrackPopupMenuMinimizeWindow

const struct message WmTrackPopupMenuMinimizeWindow[]
static

Definition at line 2170 of file msg.c.

Referenced by test_TrackPopupMenu().

◆ WmUser

const struct message WmUser[]
static
Initial value:
= {
{ WM_USER, sent },
{ 0 }
}

Definition at line 13140 of file msg.c.

Referenced by test_PeekMessage(), and test_SendMessageTimeout().

◆ WmUserKeyUpSkippedSeq

const struct message WmUserKeyUpSkippedSeq[]
static
Initial value:
=
{
{ WM_USER, sent },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xc0000001 },
{ 0 }
}

Definition at line 13823 of file msg.c.

Referenced by test_PeekMessage().

◆ WmVkAppsSeq

const struct message WmVkAppsSeq[]
static
Initial value:

Definition at line 10502 of file msg.c.

Referenced by test_accelerators().

◆ WmVkF10Seq

const struct message WmVkF10Seq[]
static
Initial value:
= {
{ WM_SYSKEYDOWN, sent|wparam|lparam, VK_F10, 0x00000001 },
{ WM_SYSKEYUP, wparam|lparam, VK_F10, 0xc0000001 },
{ WM_SYSKEYUP, sent|wparam|lparam, VK_F10, 0xc0000001 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam|msg_todo, 0, 0 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 1 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam|msg_todo, 0, 0, },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam|msg_todo, OBJID_SYSMENU, 0 },
{ WM_SYSKEYUP, wparam|lparam, VK_F10, 0xc0000001 },
{ WM_SYSKEYUP, sent|wparam|lparam, VK_F10, 0xc0000001 },
{ 0 }
}

Definition at line 10513 of file msg.c.

Referenced by test_accelerators().

◆ WmVkN

const struct message WmVkN[]
static
Initial value:
= {
{ WM_KEYDOWN, wparam|lparam, 'N', 1 },
{ WM_KEYDOWN, sent|wparam|lparam, 'N', 1 },
{ WM_CHAR, wparam|lparam, 'n', 1 },
{ HCBT_KEYSKIPPED, hook|wparam|lparam|optional, 'N', 0xc0000001 },
{ WM_KEYUP, wparam|lparam, 'N', 0xc0000001 },
{ WM_KEYUP, sent|wparam|lparam, 'N', 0xc0000001 },
{ 0 }
}

Definition at line 10264 of file msg.c.

Referenced by test_accelerators().

◆ WmWinEventAlertSeq

const struct message WmWinEventAlertSeq[]
static
Initial value:
= {
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, OBJID_ALERT, 0 },
{ 0 }
}

Definition at line 11953 of file msg.c.

Referenced by test_winevents().

◆ WmWinEventAlertSeq_2

const struct message WmWinEventAlertSeq_2[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_WINDOW, 2 },
{ EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, OBJID_ALERT, 2 },
{ 0 }
}
#define OBJID_WINDOW
Definition: winable.h:15

Definition at line 11957 of file msg.c.

Referenced by test_winevents().

◆ WmWinEventCaretSeq

const struct message WmWinEventCaretSeq[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ EVENT_OBJECT_NAMECHANGE, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ 0 }
}

Definition at line 11940 of file msg.c.

Referenced by test_winevents().

◆ WmWinEventCaretSeq_2

const struct message WmWinEventCaretSeq_2[]
static
Initial value:
= {
{ EVENT_OBJECT_CREATE, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ EVENT_OBJECT_NAMECHANGE, winevent_hook|wparam|lparam, OBJID_CARET, 0 },
{ 0 }
}

Definition at line 11947 of file msg.c.

Referenced by test_winevents().

◆ WmWinEventsSeq

const struct message WmWinEventsSeq[]
static
Initial value:
= {
{ EVENT_SYSTEM_SOUND, winevent_hook|wparam|lparam, OBJID_WINDOW, 0 },
{ EVENT_SYSTEM_ALERT, winevent_hook|wparam|lparam, OBJID_SYSMENU, 1 },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, OBJID_TITLEBAR, 2 },
{ EVENT_SYSTEM_MENUSTART, winevent_hook|wparam|lparam, OBJID_MENU, 3 },
{ EVENT_SYSTEM_MENUEND, winevent_hook|wparam|lparam, OBJID_CLIENT, 4 },
{ EVENT_SYSTEM_MENUPOPUPSTART, winevent_hook|wparam|lparam, OBJID_VSCROLL, 5 },
{ EVENT_SYSTEM_MENUPOPUPEND, winevent_hook|wparam|lparam, OBJID_HSCROLL, 6 },
{ EVENT_SYSTEM_CAPTURESTART, winevent_hook|wparam|lparam, OBJID_SIZEGRIP, 7 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, OBJID_CARET, 8 },
{ EVENT_SYSTEM_MOVESIZEEND, winevent_hook|wparam|lparam, OBJID_ALERT, 10 },
{ EVENT_SYSTEM_CONTEXTHELPSTART, winevent_hook|wparam|lparam, OBJID_SOUND, 11 },
{ EVENT_SYSTEM_CONTEXTHELPEND, winevent_hook|wparam|lparam, OBJID_QUERYCLASSNAMEIDX, 12 },
{ EVENT_SYSTEM_DRAGDROPSTART, winevent_hook|wparam|lparam, OBJID_NATIVEOM, 13 },
{ EVENT_SYSTEM_DRAGDROPEND, winevent_hook|wparam|lparam, OBJID_WINDOW, 0 },
{ EVENT_SYSTEM_DIALOGSTART, winevent_hook|wparam|lparam, OBJID_SYSMENU, 1 },
{ EVENT_SYSTEM_DIALOGEND, winevent_hook|wparam|lparam, OBJID_TITLEBAR, 2 },
{ EVENT_SYSTEM_SCROLLINGSTART, winevent_hook|wparam|lparam, OBJID_MENU, 3 },
{ EVENT_SYSTEM_SCROLLINGEND, winevent_hook|wparam|lparam, OBJID_CLIENT, 4 },
{ EVENT_SYSTEM_SWITCHSTART, winevent_hook|wparam|lparam, OBJID_VSCROLL, 5 },
{ EVENT_SYSTEM_SWITCHEND, winevent_hook|wparam|lparam, OBJID_HSCROLL, 6 },
{ EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, OBJID_SIZEGRIP, 7 },
{ EVENT_SYSTEM_MINIMIZEEND, winevent_hook|wparam|lparam, OBJID_CARET, 8 },
{ 0 }
}
#define OBJID_TITLEBAR
Definition: winable.h:17
#define OBJID_MENU
Definition: winable.h:18
#define OBJID_SOUND
Definition: winable.h:26
#define OBJID_SIZEGRIP
Definition: winable.h:22

Definition at line 11913 of file msg.c.

Referenced by test_winevents().

◆ WmZOrder

◆ WPARAM

◆ wszAnsi

const WCHAR wszAnsi[] = {'U',0}
static

Definition at line 11460 of file msg.c.

Referenced by MsgConversionProcW().

◆ wszUnicode

const WCHAR wszUnicode[] = {'U','n','i','c','o','d','e',0}
static

Definition at line 11459 of file msg.c.

Referenced by MsgConversionProcW(), and test_message_conversion().