ReactOS  0.4.15-dev-3299-gbe8e5fc
win.c File Reference
#include "precomp.h"
Include dependency graph for win.c:

Go to the source code of this file.

Classes

struct  wm_gettext_override_data
 
struct  create_window_thread_params
 
struct  dialog_param
 
struct  dlg_parent_param
 
struct  parentdc_stat
 
struct  parentdc_test
 
struct  window_attributes
 
struct  smresult_thread_data
 
struct  set_foreground_thread_params
 

Macros

#define SPI_GETDESKWALLPAPER   0x0073
 
#define WM_SYSTIMER   0x0118
 
#define LONG_PTR   INT_PTR
 
#define ULONG_PTR   UINT_PTR
 
#define COUNTOF(arr)   (sizeof(arr)/sizeof(arr[0]))
 
#define check_wnd_state(a, b, c, d)   check_wnd_state_(__FILE__,__LINE__,a,b,c,d)
 
#define check_active_state(a, b, c)   check_active_state_(__FILE__,__LINE__,a,b,c)
 
#define check_z_order(hwnd, next, prev, owner, topmost)
 
#define TEST_MOUSEACTIVATE(A, B)
 
#define SHOWSYSMETRIC(SM)   trace(#SM "=%d\n", GetSystemMetrics(SM))
 
#define parentdc_field_ok(t, w, r, f, got)
 
#define parentdc_todo_field_ok(t, w, r, f, got)
 
#define parentdc_rect_ok(t, w, r, got)
 
#define parentdc_win_ok(t, w, got)
 
#define parentdc_ok(t, got)
 
#define nothing_todo   {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}
 
#define expect_menu(window, menu)
 
#define expect_style(window, style)   ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE))
 
#define expect_ex_style(window, ex_style)   ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE))
 
#define expect_gle_broken_9x(gle)
 
#define NUMBER_OF_THICK_CHILD_TESTS   16
 
#define SET_FOREGROUND_STEAL_1   0x01
 
#define SET_FOREGROUND_SET_1   0x02
 
#define SET_FOREGROUND_STEAL_2   0x04
 
#define SET_FOREGROUND_SET_2   0x08
 
#define SET_FOREGROUND_INJECT   0x10
 

Functions

void dump_region (HRGN hrgn)
 
static HWND (WINAPI *pGetAncestor)(HWND
 
static BOOL (WINAPI *pGetWindowInfo)(HWND
 
static WINDOWINFO *static UINT (WINAPI *pGetWindowModuleFileNameA)(HWND
 
static HMONITOR (WINAPI *pMonitorFromPoint)(POINT
 
static int (WINAPI *pGetWindowRgnBox)(HWND
 
static DWORD (WINAPI *pSetLayout)(HDC hdc
 
static void dump_minmax_info (const MINMAXINFO *minmax)
 
static void flush_events (BOOL remove_messages)
 
static BOOL wait_for_event (HANDLE event, int timeout)
 
static void check_parents (HWND hwnd, HWND ga_parent, HWND gwl_parent, HWND get_parent, HWND gw_owner, HWND ga_root, HWND ga_root_owner)
 
static void check_wnd_state_ (const char *file, int line, HWND active, HWND foreground, HWND focus, HWND capture)
 
static void check_active_state_ (const char *file, int line, HWND active, HWND foreground, HWND focus)
 
static BOOL ignore_message (UINT message)
 
static BOOL CALLBACK EnumChildProc (HWND hwndChild, LPARAM lParam)
 
static BOOL CALLBACK EnumChildProc1 (HWND hwndChild, LPARAM lParam)
 
static HWND create_tool_window (LONG style, HWND parent)
 
static void test_parent_owner (void)
 
static BOOL CALLBACK enum_proc (HWND hwnd, LPARAM lParam)
 
static DWORD CALLBACK enum_thread (void *arg)
 
static void test_enum_thread_windows (void)
 
static LRESULT WINAPI main_window_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI main_window_procW (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI tool_window_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static BOOL RegisterWindowClasses (void)
 
static void verify_window_info (const char *hook, HWND hwnd, const WINDOWINFO *info)
 
static void FixedAdjustWindowRectEx (RECT *rc, LONG style, BOOL menu, LONG exstyle)
 
static void wine_AdjustWindowRectEx (RECT *rect, LONG style, BOOL menu, LONG exStyle)
 
static void test_nonclient_area (HWND hwnd)
 
static LRESULT CALLBACK cbt_hook_proc (int nCode, WPARAM wParam, LPARAM lParam)
 
static void test_shell_window (void)
 
static void test_MDI_create (HWND parent, HWND mdi_client, INT_PTR first_id)
 
static void test_MDI_child_stack (HWND mdi_client)
 
static void MDI_ChildGetMinMaxInfo (HWND client, HWND hwnd, MINMAXINFO *lpMinMax)
 
static LRESULT WINAPI mdi_child_wnd_proc_1 (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI mdi_child_wnd_proc_2 (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI mdi_main_wnd_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static BOOL mdi_RegisterWindowClasses (void)
 
static void test_mdi (void)
 
static void test_icons (void)
 
static LRESULT WINAPI nccalcsize_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_SetWindowPos (HWND hwnd, HWND hwnd2)
 
static void test_SetMenu (HWND parent)
 
static void test_window_tree (HWND parent, const DWORD *style, const int *order, int total)
 
static void test_children_zorder (HWND parent)
 
static void check_z_order_debug (HWND hwnd, HWND next, HWND prev, HWND owner, BOOL topmost, const char *file, int line)
 
static void test_popup_zorder (HWND hwnd_D, HWND hwnd_E, DWORD style)
 
static void test_vis_rgn (HWND hwnd)
 
static LRESULT WINAPI set_focus_on_activate_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void test_SetFocus (HWND hwnd)
 
static void test_SetActiveWindow (HWND hwnd)
 
static DWORD WINAPI create_window_thread (void *param)
 
static void test_SetForegroundWindow (HWND hwnd)
 
static LRESULT WINAPI button_hook_proc (HWND button, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_capture_1 (void)
 
static void test_capture_2 (void)
 
static void test_capture_3 (HWND hwnd1, HWND hwnd2)
 
static LRESULT CALLBACK test_capture_4_proc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_capture_4 (void)
 
static BOOL peek_message (MSG *msg)
 
static void test_keyboard_input (HWND hwnd)
 
static BOOL wait_for_message (MSG *msg)
 
static void test_mouse_input (HWND hwnd)
 
static void test_validatergn (HWND hwnd)
 
static void nccalchelper (HWND hwnd, INT x, INT y, RECT *prc)
 
static void test_nccalcscroll (HWND parent)
 
static void test_SetParent (void)
 
static LRESULT WINAPI StyleCheckProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void register_style_check_class (void)
 
static void check_window_style (DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyleOut, DWORD dwExStyleOut)
 
static void test_window_styles (void)
 
static HWND root_dialog (HWND hwnd)
 
static INT_PTR WINAPI empty_dlg_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR WINAPI empty_dlg_proc3 (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR WINAPI empty_dlg_proc2 (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void check_dialog_style (DWORD style_in, DWORD ex_style_in, DWORD style_out, DWORD ex_style_out)
 
static void test_dialog_styles (void)
 
static INT_PTR WINAPI parent_dlg_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR WINAPI reparent_dlg_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR WINAPI reparent_owned_dlg_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI reparent_dialog_owner_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI post_quit_dialog_owner_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI destroy_dialog_owner_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_dialog_parent (void)
 
static void test_scrollwindow (HWND hwnd)
 
static void test_scrollvalidate (HWND parent)
 
static void test_scroll (void)
 
static void test_scrolldc (HWND parent)
 
static void test_params (void)
 
static void test_AWRwindow (LPCSTR class, LONG style, LONG exStyle, BOOL menu)
 
static BOOL AWR_init (void)
 
static void test_AWR_window_size (BOOL menu)
 
static void test_AWR_flags (void)
 
static void test_AdjustWindowRect (void)
 
static LRESULT WINAPI redraw_window_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_redrawnow (void)
 
static LRESULT WINAPI parentdc_window_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void zero_parentdc_stat (struct parentdc_stat *t)
 
static void zero_parentdc_test (struct parentdc_test *t)
 
static void test_csparentdc (void)
 
static LRESULT WINAPI def_window_procA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI def_window_procW (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_IsWindowUnicode (void)
 
static LRESULT CALLBACK minmax_wnd_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static LRESULT CALLBACK winsizes_wnd_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void test_CreateWindow (void)
 
static int check_error (DWORD actual, DWORD expected)
 
static void test_SetWindowLong (void)
 
static LRESULT WINAPI check_style_wnd_proc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void test_set_window_style (void)
 
static void test_ShowWindow (void)
 
static DWORD CALLBACK gettext_msg_thread (LPVOID arg)
 
static DWORD CALLBACK settext_msg_thread (LPVOID arg)
 
static void test_gettext (void)
 
static void test_GetUpdateRect (void)
 
static LRESULT CALLBACK TestExposedRegion_WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void test_Expose (void)
 
static LRESULT CALLBACK TestNCRedraw_WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static void run_NCRedrawLoop (UINT flags)
 
static void test_NCRedraw (void)
 
static void test_GetWindowModuleFileName (void)
 
static void test_hwnd_message (void)
 
static void test_layered_window (void)
 
static LRESULT CALLBACK fullscreen_wnd_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void test_fullscreen (void)
 
static LRESULT WINAPI test_thick_child_size_winproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_thick_child_size (HWND parentWindow)
 
static void test_handles (HWND full_hwnd)
 
static void test_winregion (void)
 
static void test_rtl_layout (void)
 
static void test_FlashWindow (void)
 
static void test_FlashWindowEx (void)
 
static void test_FindWindowEx (void)
 
static void test_GetLastActivePopup (void)
 
static LRESULT WINAPI my_httrasparent_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static LRESULT WINAPI my_window_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void create_window_tree (HWND parent, HWND *window, int size)
 
static void get_window_attributes (HWND hwnd, struct window_attributes *attrs)
 
static int window_to_index (HWND hwnd, HWND *window, int size)
 
static void test_child_window_from_point (void)
 
static void simulate_click (int x, int y)
 
static LRESULT WINAPI static_hook_proc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
 
static void window_from_point_proc (HWND parent)
 
static void test_window_from_point (const char *argv0)
 
static void test_map_points (void)
 
static void test_update_region (void)
 
static void test_window_without_child_style (void)
 
static LRESULT WINAPI smresult_wndproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static DWORD WINAPI smresult_thread_proc (void *param)
 
static void test_smresult (void)
 
static void test_GetMessagePos (void)
 
static DWORD WINAPI set_foreground_thread (void *params)
 
static void test_activateapp (HWND window1)
 
static LRESULT WINAPI winproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI winproc_convA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI winproc_convW (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static void test_winproc_handles (const char *argv0)
 
static void test_winproc_limit (void)
 
static void test_deferwindowpos (void)
 
 START_TEST (win)
 

Variables

static UINT
 
static WINDOWINFO *static LPSTR
 
static COLORREF BYTE DWORD *static COLORREF
 
static COLORREF BYTE DWORD *static BYTE
 
static COLORREF BYTE DWORD *static DWORD
 
static HDC
 
static const UPDATELAYEREDWINDOWINFO *static LPMONITORINFO
 
static LPRECT
 
static BOOL bInvert
 
static DWORD layout
 
static HRGN hrgn
 
static BOOL test_lbuttondown_flag
 
static DWORD num_gettext_msgs
 
static DWORD num_settext_msgs
 
static HWND hwndMessage
 
static HWND hwndMain
 
static HWND hwndMain2
 
static HHOOK hhook
 
static BOOL app_activated
 
static BOOL app_deactivated
 
static const charszAWRClass = "Winsize"
 
static HMENU hmenu
 
static DWORD our_pid
 
static BOOL is_win9x = FALSE
 
static struct wm_gettext_override_data g_wm_gettext_override
 
static const WCHAR mainclassW [] = {'M','a','i','n','W','i','n','d','o','w','C','l','a','s','s','W',0}
 
static char mdi_lParam_test_message [] = "just a test string"
 
static WNDPROC old_button_proc
 
static ATOM atomStyleCheckClass
 
static LRESULT expected_id
 
static int redrawComplete
 
static int WMPAINT_count
 
static int expected_cx
 
static int expected_cy
 
static RECT expected_rect
 
static RECT broken_rect
 
static MONITORINFO mi
 
static BOOL test_thick_child_got_minmax
 
static const chartest_thick_child_name
 
static LONG test_thick_child_style
 
static LONG test_thick_child_exStyle
 
static WNDPROC def_static_proc
 
static BOOL got_hittest
 
static const WCHAR textW [] = {'t','e','x','t',0}
 

Macro Definition Documentation

◆ check_active_state

#define check_active_state (   a,
  b,
  c 
)    check_active_state_(__FILE__,__LINE__,a,b,c)

Definition at line 159 of file win.c.

◆ check_wnd_state

#define check_wnd_state (   a,
  b,
  c,
  d 
)    check_wnd_state_(__FILE__,__LINE__,a,b,c,d)

Definition at line 143 of file win.c.

◆ check_z_order

#define check_z_order (   hwnd,
  next,
  prev,
  owner,
  topmost 
)
Value:
check_z_order_debug((hwnd), (next), (prev), (owner), (topmost), \
__FILE__, __LINE__)
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner, BOOL topmost, const char *file, int line)
Definition: win.c:2795
static unsigned __int64 next
Definition: rand_nt.c:6

Definition at line 2791 of file win.c.

◆ COUNTOF

#define COUNTOF (   arr)    (sizeof(arr)/sizeof(arr[0]))

Definition at line 71 of file win.c.

◆ expect_ex_style

#define expect_ex_style (   window,
  ex_style 
)    ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE))

◆ expect_gle_broken_9x

#define expect_gle_broken_9x (   gle)
Value:
ok(GetLastError() == gle ||\
broken(GetLastError() == 0xdeadbeef),\
"IsMenu set error %d\n", GetLastError())
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57

◆ expect_menu

#define expect_menu (   window,
  menu 
)
Value:
SetLastError(0xdeadbeef); \
res = (GetMenu(window) == (HMENU)menu); \
ok(res, "GetMenu error %d\n", GetLastError())
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define SetLastError(x)
Definition: compat.h:611
static IHTMLWindow2 * window
Definition: events.c:77
GLuint res
Definition: glext.h:9613
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60

◆ expect_style

#define expect_style (   window,
  style 
)    ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE))

◆ LONG_PTR

Definition at line 33 of file win.c.

◆ nothing_todo

#define nothing_todo   {{0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}

◆ NUMBER_OF_THICK_CHILD_TESTS

#define NUMBER_OF_THICK_CHILD_TESTS   16

Definition at line 7609 of file win.c.

◆ parentdc_field_ok

#define parentdc_field_ok (   t,
  w,
  r,
  f,
  got 
)
Value:
ok (t.w.r.f==got.w.r.f, "window " #w ", rect " #r ", field " #f \
": expected %d, got %d\n", \
t.w.r.f, got.w.r.f)
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
GLfloat f
Definition: glext.h:7540
#define ok(value,...)
Definition: atltest.h:57

Definition at line 5485 of file win.c.

◆ parentdc_ok

#define parentdc_ok (   t,
  got 
)
Value:
parentdc_win_ok(t, child1, got); \
parentdc_win_ok(t, child2, got);
#define parentdc_win_ok(t, w, got)
Definition: win.c:5500
int main(int argc, char *argv[])
Definition: atactl.cpp:1685
GLdouble GLdouble t
Definition: gl.h:2047

Definition at line 5505 of file win.c.

◆ parentdc_rect_ok

#define parentdc_rect_ok (   t,
  w,
  r,
  got 
)
Value:
parentdc_todo_field_ok(t, w, r, top, got); \
parentdc_todo_field_ok(t, w, r, right, got); \
parentdc_todo_field_ok(t, w, r, bottom, got);
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define parentdc_todo_field_ok(t, w, r, f, got)
Definition: win.c:5490
GLdouble GLdouble t
Definition: gl.h:2047
GLint GLint bottom
Definition: glext.h:7726
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859

Definition at line 5494 of file win.c.

◆ parentdc_todo_field_ok

#define parentdc_todo_field_ok (   t,
  w,
  r,
  f,
  got 
)
Value:
todo_wine_if (t.w##_todo.r.f) \
parentdc_field_ok(t, w, r, f, got);
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
#define todo_wine_if(is_todo)
Definition: test.h:165
GLfloat f
Definition: glext.h:7540

Definition at line 5490 of file win.c.

◆ parentdc_win_ok

#define parentdc_win_ok (   t,
  w,
  got 
)
Value:
parentdc_rect_ok(t, w, clip, got); \
parentdc_rect_ok(t, w, paint, got);
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble t
Definition: gl.h:2047
#define parentdc_rect_ok(t, w, r, got)
Definition: win.c:5494
static FILE * client
Definition: client.c:41

Definition at line 5500 of file win.c.

◆ SET_FOREGROUND_INJECT

#define SET_FOREGROUND_INJECT   0x10

Definition at line 9011 of file win.c.

◆ SET_FOREGROUND_SET_1

#define SET_FOREGROUND_SET_1   0x02

Definition at line 9008 of file win.c.

◆ SET_FOREGROUND_SET_2

#define SET_FOREGROUND_SET_2   0x08

Definition at line 9010 of file win.c.

◆ SET_FOREGROUND_STEAL_1

#define SET_FOREGROUND_STEAL_1   0x01

Definition at line 9007 of file win.c.

◆ SET_FOREGROUND_STEAL_2

#define SET_FOREGROUND_STEAL_2   0x04

Definition at line 9009 of file win.c.

◆ SHOWSYSMETRIC

#define SHOWSYSMETRIC (   SM)    trace(#SM "=%d\n", GetSystemMetrics(SM))

Definition at line 5343 of file win.c.

◆ SPI_GETDESKWALLPAPER

#define SPI_GETDESKWALLPAPER   0x0073

Definition at line 26 of file win.c.

◆ TEST_MOUSEACTIVATE

#define TEST_MOUSEACTIVATE (   A,
  B 
)
Value:
ok(res == B, "WM_MOUSEACTIVATE for %s returned %ld\n", #A, res);
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: ehthrow.cxx:53
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELRESULT(l, h)
Definition: winuser.h:3986
UINT_PTR WPARAM
Definition: windef.h:207
Definition: ehthrow.cxx:92
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_MOUSEACTIVATE
Definition: winuser.h:1620
GLuint res
Definition: glext.h:9613

◆ ULONG_PTR

Definition at line 34 of file win.c.

◆ WM_SYSTIMER

#define WM_SYSTIMER   0x0118

Definition at line 30 of file win.c.

Function Documentation

◆ AWR_init()

static BOOL AWR_init ( void  )
static

Definition at line 5262 of file win.c.

5263 {
5264  WNDCLASSA class;
5265 
5266  class.style = CS_HREDRAW | CS_VREDRAW;
5267  class.lpfnWndProc = DefWindowProcA;
5268  class.cbClsExtra = 0;
5269  class.cbWndExtra = 0;
5270  class.hInstance = 0;
5271  class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION);
5272  class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
5273  class.hbrBackground = 0;
5274  class.lpszMenuName = 0;
5275  class.lpszClassName = szAWRClass;
5276 
5277  if (!RegisterClassA(&class)) {
5278  ok(FALSE, "RegisterClass failed\n");
5279  return FALSE;
5280  }
5281 
5282  hmenu = CreateMenu();
5283  if (!hmenu)
5284  return FALSE;
5285  ok(hmenu != 0, "Failed to create menu\n");
5286  ok(AppendMenuA(hmenu, MF_STRING, 1, "Test!"), "Failed to create menu item\n");
5287 
5288  return TRUE;
5289 }
HMENU WINAPI CreateMenu(void)
Definition: menu.c:837
static HMENU hmenu
Definition: win.c:66
#define TRUE
Definition: types.h:120
#define MF_STRING
Definition: winuser.h:138
#define CS_HREDRAW
Definition: winuser.h:648
#define IDI_APPLICATION
Definition: winuser.h:699
HICON WINAPI LoadIconA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2029
#define FALSE
Definition: types.h:117
const char * LPCSTR
Definition: xmlstorage.h:183
#define CS_VREDRAW
Definition: winuser.h:653
BOOL WINAPI AppendMenuA(_In_ HMENU, _In_ UINT, _In_ UINT_PTR, _In_opt_ LPCSTR)
static const char * szAWRClass
Definition: win.c:65
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3139
#define ok(value,...)
Definition: atltest.h:57
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)

Referenced by test_AdjustWindowRect().

◆ BOOL()

static BOOL ( WINAPI pGetWindowInfo)
static

Referenced by test_shell_window().

◆ button_hook_proc()

static LRESULT WINAPI button_hook_proc ( HWND  button,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 3291 of file win.c.

3292 {
3293  LRESULT ret;
3294  USHORT key_state;
3295 
3296  key_state = GetKeyState(VK_LBUTTON);
3297  ok(!(key_state & 0x8000), "VK_LBUTTON should not be pressed, state %04x\n", key_state);
3298 
3300 
3301  if (msg == WM_LBUTTONDOWN)
3302  {
3303  HWND hwnd, capture;
3304 
3306 
3307  hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
3308  assert(hwnd);
3309  trace("hwnd %p\n", hwnd);
3310 
3312 
3314 
3316 
3318 
3319  hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
3320  assert(hwnd);
3321  trace("hwnd %p\n", hwnd);
3322 
3324 
3325  /* button wnd proc should release capture on WM_KILLFOCUS if it does
3326  * match internal button state.
3327  */
3330 
3332  check_wnd_state(hwnd, hwnd, hwnd, 0);
3333 
3334  capture = SetCapture(hwnd);
3335  ok(capture == 0, "SetCapture() = %p\n", capture);
3336 
3338 
3340 
3341  check_wnd_state(button, 0, button, 0);
3342  }
3343 
3344  return ret;
3345 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define WM_LBUTTONDOWN
Definition: winuser.h:1759
#define VK_LBUTTON
Definition: winuser.h:2166
#define check_wnd_state(a, b, c, d)
Definition: win.c:143
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD button
Definition: button.c:166
#define assert(x)
Definition: debug.h:53
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define SW_SHOW
Definition: winuser.h:769
SHORT WINAPI GetKeyState(_In_ int)
#define WM_KILLFOCUS
Definition: winuser.h:1597
#define trace
Definition: atltest.h:70
int ret
HWND WINAPI SetCapture(_In_ HWND hWnd)
unsigned short USHORT
Definition: pedump.c:61
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
#define msg(x)
Definition: auth_time.c:54
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)
static WNDPROC old_button_proc
Definition: win.c:3289
LONG_PTR LRESULT
Definition: windef.h:209
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by test_capture_1().

◆ cbt_hook_proc()

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

Definition at line 1118 of file win.c.

1119 {
1120  static const char *CBT_code_name[10] = {
1121  "HCBT_MOVESIZE",
1122  "HCBT_MINMAX",
1123  "HCBT_QS",
1124  "HCBT_CREATEWND",
1125  "HCBT_DESTROYWND",
1126  "HCBT_ACTIVATE",
1127  "HCBT_CLICKSKIPPED",
1128  "HCBT_KEYSKIPPED",
1129  "HCBT_SYSCOMMAND",
1130  "HCBT_SETFOCUS" };
1131  const char *code_name = (nCode >= 0 && nCode <= HCBT_SETFOCUS) ? CBT_code_name[nCode] : "Unknown";
1132  HWND hwnd = (HWND)wParam;
1133 
1134  switch (nCode)
1135  {
1136  case HCBT_CREATEWND:
1137  {
1138  static const RECT rc_null;
1139  RECT rc;
1140  LONG style;
1141  CBT_CREATEWNDA *createwnd = (CBT_CREATEWNDA *)lParam;
1142  ok(createwnd->hwndInsertAfter == HWND_TOP, "hwndInsertAfter should be always HWND_TOP\n");
1143 
1144  if (pGetWindowInfo)
1145  {
1146  WINDOWINFO info;
1147  info.cbSize = sizeof(WINDOWINFO);
1148  ok(pGetWindowInfo(hwnd, &info), "GetWindowInfo should not fail\n");
1149  verify_window_info(code_name, hwnd, &info);
1150  }
1151 
1152  /* WS_VISIBLE should be turned off yet */
1153  style = createwnd->lpcs->style & ~WS_VISIBLE;
1155  "style of hwnd and style in the CREATESTRUCT do not match: %08x != %08x\n",
1157 
1158  if (0)
1159  {
1160  /* Uncomment this once the test succeeds in all cases */
1161  if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
1162  {
1164  "wrong result from GetParent %p: message window %p\n",
1166  }
1167  else
1168  ok(!GetParent(hwnd), "GetParent should return 0 at this point\n");
1169 
1170  ok(!GetWindow(hwnd, GW_OWNER), "GW_OWNER should be set to 0 at this point\n");
1171  }
1172  if (0)
1173  {
1174  /* while NT assigns GW_HWNDFIRST/LAST some values at this point,
1175  * Win9x still has them set to 0.
1176  */
1177  ok(GetWindow(hwnd, GW_HWNDFIRST) != 0, "GW_HWNDFIRST should not be set to 0 at this point\n");
1178  ok(GetWindow(hwnd, GW_HWNDLAST) != 0, "GW_HWNDLAST should not be set to 0 at this point\n");
1179  }
1180  ok(!GetWindow(hwnd, GW_HWNDPREV), "GW_HWNDPREV should be set to 0 at this point\n");
1181  ok(!GetWindow(hwnd, GW_HWNDNEXT), "GW_HWNDNEXT should be set to 0 at this point\n");
1182 
1183  if (0)
1184  {
1185  /* Uncomment this once the test succeeds in all cases */
1186  if (pGetAncestor)
1187  {
1188  ok(pGetAncestor(hwnd, GA_PARENT) == hwndMessage, "GA_PARENT should be set to hwndMessage at this point\n");
1189  ok(pGetAncestor(hwnd, GA_ROOT) == hwnd,
1190  "GA_ROOT is set to %p, expected %p\n", pGetAncestor(hwnd, GA_ROOT), hwnd);
1191 
1192  if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
1193  ok(pGetAncestor(hwnd, GA_ROOTOWNER) == hwndMessage,
1194  "GA_ROOTOWNER should be set to hwndMessage at this point\n");
1195  else
1196  ok(pGetAncestor(hwnd, GA_ROOTOWNER) == hwnd,
1197  "GA_ROOTOWNER is set to %p, expected %p\n", pGetAncestor(hwnd, GA_ROOTOWNER), hwnd);
1198  }
1199 
1200  ok(GetWindowRect(hwnd, &rc), "GetWindowRect failed\n");
1201  ok(EqualRect(&rc, &rc_null), "window rect should be set to 0 HCBT_CREATEWND\n");
1202  ok(GetClientRect(hwnd, &rc), "GetClientRect failed\n");
1203  ok(EqualRect(&rc, &rc_null), "client rect should be set to 0 on HCBT_CREATEWND\n");
1204  }
1205  break;
1206  }
1207  case HCBT_MOVESIZE:
1208  case HCBT_MINMAX:
1209  case HCBT_ACTIVATE:
1210  if (pGetWindowInfo && IsWindow(hwnd))
1211  {
1212  WINDOWINFO info;
1213 
1214  /* Win98 actually does check the info.cbSize and doesn't allow
1215  * it to be anything except sizeof(WINDOWINFO), while Win95, Win2k,
1216  * WinXP do not check it at all.
1217  */
1218  info.cbSize = sizeof(WINDOWINFO);
1219  ok(pGetWindowInfo(hwnd, &info), "GetWindowInfo should not fail\n");
1220  verify_window_info(code_name, hwnd, &info);
1221  }
1222  break;
1223  /* window state is undefined */
1224  case HCBT_SETFOCUS:
1225  case HCBT_DESTROYWND:
1226  break;
1227  default:
1228  break;
1229  }
1230 
1231  return CallNextHookEx(hhook, nCode, wParam, lParam);
1232 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define GA_ROOT
Definition: winuser.h:2765
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LPCREATESTRUCTA lpcs
Definition: winuser.h:2946
#define HCBT_CREATEWND
Definition: winuser.h:58
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define HWND_TOP
Definition: winuser.h:1193
#define WS_CHILD
Definition: pedump.c:617
#define HCBT_SETFOCUS
Definition: winuser.h:64
#define GA_ROOTOWNER
Definition: winuser.h:2766
WPARAM wParam
Definition: combotst.c:138
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
long LONG
Definition: pedump.c:60
#define HCBT_DESTROYWND
Definition: winuser.h:59
#define GA_PARENT
Definition: winuser.h:2764
static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *info)
Definition: win.c:944
static HWND hwndMessage
Definition: win.c:60
#define GW_HWNDLAST
Definition: winuser.h:760
struct _test_info info[]
Definition: SetCursorPos.c:19
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define GW_HWNDFIRST
Definition: winuser.h:759
struct tagWINDOWINFO WINDOWINFO
#define HCBT_MINMAX
Definition: winuser.h:56
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
LRESULT WINAPI CallNextHookEx(_In_opt_ HHOOK, _In_ int, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define ok(value,...)
Definition: atltest.h:57
HWND hwndInsertAfter
Definition: winuser.h:2947
#define WS_POPUP
Definition: pedump.c:616
#define GW_OWNER
Definition: winuser.h:761
static HHOOK hhook
Definition: win.c:62
#define HCBT_MOVESIZE
Definition: winuser.h:55
#define HCBT_ACTIVATE
Definition: winuser.h:60
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
LPARAM lParam
Definition: combotst.c:139
#define GW_HWNDPREV
Definition: winuser.h:757
static HWND(WINAPI *pGetAncestor)(HWND

Referenced by START_TEST().

◆ check_active_state_()

static void check_active_state_ ( const char file,
int  line,
HWND  active,
HWND  foreground,
HWND  focus 
)
static

Definition at line 160 of file win.c.

162 {
163  ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow());
164  /* only check foreground if it belongs to the current thread */
165  /* foreground can be moved to a different app pretty much at any time */
166  if (foreground && GetForegroundWindow() &&
169  ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow());
170  ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus());
171 }
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
Definition: parser.c:48
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define disable_success_count
Definition: test.h:172
#define NULL
Definition: types.h:112
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
HWND WINAPI GetFocus(void)
Definition: window.c:1909
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ check_dialog_style()

static void check_dialog_style ( DWORD  style_in,
DWORD  ex_style_in,
DWORD  style_out,
DWORD  ex_style_out 
)
static

Definition at line 4470 of file win.c.

4471 {
4472  struct
4473  {
4474  DLGTEMPLATE dt;
4475  WORD menu_name;
4476  WORD class_id;
4477  WORD class_atom;
4478  WCHAR caption[1];
4479  } dlg_data;
4480  DWORD style, ex_style;
4481  HWND hwnd, grand_parent = 0, parent = 0;
4482  struct dialog_param param;
4483  LRESULT id, ret;
4484 
4485  if (style_in & WS_CHILD)
4486  {
4488  0, 0, 0, 0, NULL, NULL, NULL, NULL);
4489  ok(grand_parent != 0, "grand_parent creation failed\n");
4490  }
4491 
4492  parent = CreateWindowExA(0, "static", NULL, style_in,
4493  0, 0, 0, 0, grand_parent, NULL, NULL, NULL);
4494  ok(parent != 0, "parent creation failed, style %#x\n", style_in);
4495 
4496  dlg_data.dt.style = style_in;
4497  dlg_data.dt.dwExtendedStyle = ex_style_in;
4498  dlg_data.dt.cdit = 0;
4499  dlg_data.dt.x = 0;
4500  dlg_data.dt.y = 0;
4501  dlg_data.dt.cx = 100;
4502  dlg_data.dt.cy = 100;
4503  dlg_data.menu_name = 0;
4504  dlg_data.class_id = 0;
4505  dlg_data.class_atom = 0;
4506  dlg_data.caption[0] = 0;
4507 
4509  ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in);
4510 
4511  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4512  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4513  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x1111, 0);
4514  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4515  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4516  ok(id == MAKELONG(0x1111,DC_HASDEFID), "expected (0x1111,DC_HASDEFID), got %08lx\n", id);
4517 
4518  flush_events( TRUE );
4519 
4521  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4522  ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
4523  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4524 
4525  ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
4526 
4527  /* try setting the styles explicitly */
4528  SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in);
4530  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4531  ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
4532  /* WS_EX_WINDOWEDGE can't always be changed */
4533  if (ex_style_in & WS_EX_DLGMODALFRAME)
4534  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4535  else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE))
4536  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4537  else
4538  ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
4539  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4540 
4541  SetWindowLongA(hwnd, GWL_STYLE, style_in);
4543  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4544  /* WS_CLIPSIBLINGS can't be reset on top-level windows */
4545  if ((style_in & (WS_CHILD | WS_POPUP)) == WS_CHILD) style_out = style_in;
4546  else style_out = style_in | WS_CLIPSIBLINGS;
4547  ok(style == style_out, "expected style %#x, got %#x\n", style_out, style);
4548  /* WS_EX_WINDOWEDGE can't always be changed */
4549  if (ex_style_in & WS_EX_DLGMODALFRAME)
4550  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4551  else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE))
4552  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4553  else
4554  ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
4555  /* FIXME: Remove the condition below once Wine is fixed */
4556  todo_wine_if (ex_style != ex_style_out)
4557  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4558 
4560 
4561  param.parent = parent;
4562  param.grand_parent = grand_parent;
4563  param.dlg_data = &dlg_data.dt;
4565 
4566  ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
4567  if (grand_parent)
4568  ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in);
4569 
4572 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_THICKFRAME
Definition: pedump.c:630
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD style
Definition: winuser.h:3035
#define WS_DLGFRAME
Definition: pedump.c:626
#define DM_SETDEFID
Definition: winuser.h:2082
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
#define DM_GETDEFID
Definition: winuser.h:2081
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define DC_HASDEFID
Definition: winuser.h:2585
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI IsWindowEnabled(_In_ HWND)
DWORD dwExtendedStyle
Definition: winuser.h:3036
#define todo_wine_if(is_todo)
Definition: test.h:165
r parent
Definition: btrfs.c:2944
__wchar_t WCHAR
Definition: xmlstorage.h:180
static INT_PTR WINAPI empty_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:4338
GLfloat param
Definition: glext.h:5796
HWND WINAPI CreateDialogIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND grand_parent
Definition: win.c:4383
INT_PTR WINAPI DialogBoxIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
int ret
short x
Definition: winuser.h:3038
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
short y
Definition: winuser.h:3039
WORD cdit
Definition: winuser.h:3037
#define GWL_STYLE
Definition: winuser.h:846
#define DS_3DLOOK
Definition: winuser.h:367
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
short cy
Definition: winuser.h:3041
DLGTEMPLATE * dlg_data
Definition: win.c:4384
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 WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
GLenum GLuint id
Definition: glext.h:5579
LONG_PTR LRESULT
Definition: windef.h:209
short cx
Definition: winuser.h:3040
Arabic default style
Definition: afstyles.h:93
static void flush_events(BOOL remove_messages)
Definition: win.c:84
#define WS_EX_STATICEDGE
Definition: winuser.h:403
static INT_PTR WINAPI empty_dlg_proc2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:4387

Referenced by test_dialog_styles().

◆ check_error()

static int check_error ( DWORD  actual,
DWORD  expected 
)
static

Definition at line 6298 of file win.c.

6299 {
6300  static int sets_last_error = -1;
6301  if (sets_last_error == -1)
6302  sets_last_error = (actual != 0xdeadbeef);
6303  return (!sets_last_error && (actual == 0xdeadbeef)) || (actual == expected);
6304 }
BOOL expected
Definition: store.c:2063

Referenced by test_SetWindowLong().

◆ check_parents()

static void check_parents ( HWND  hwnd,
HWND  ga_parent,
HWND  gwl_parent,
HWND  get_parent,
HWND  gw_owner,
HWND  ga_root,
HWND  ga_root_owner 
)
static

Definition at line 118 of file win.c.

120 {
121  HWND res;
122 
123  if (pGetAncestor)
124  {
125  res = pGetAncestor( hwnd, GA_PARENT );
126  ok( res == ga_parent, "Wrong result for GA_PARENT %p expected %p\n", res, ga_parent );
127  }
129  ok( res == gwl_parent, "Wrong result for GWL_HWNDPARENT %p expected %p\n", res, gwl_parent );
130  res = GetParent( hwnd );
131  ok( res == get_parent, "Wrong result for GetParent %p expected %p\n", res, get_parent );
132  res = GetWindow( hwnd, GW_OWNER );
133  ok( res == gw_owner, "Wrong result for GW_OWNER %p expected %p\n", res, gw_owner );
134  if (pGetAncestor)
135  {
136  res = pGetAncestor( hwnd, GA_ROOT );
137  ok( res == ga_root, "Wrong result for GA_ROOT %p expected %p\n", res, ga_root );
138  res = pGetAncestor( hwnd, GA_ROOTOWNER );
139  ok( res == ga_root_owner, "Wrong result for GA_ROOTOWNER %p expected %p\n", res, ga_root_owner );
140  }
141 }
#define GA_ROOT
Definition: winuser.h:2765
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GA_ROOTOWNER
Definition: winuser.h:2766
#define GA_PARENT
Definition: winuser.h:2764
#define GetWindowLongPtrA
Definition: winuser.h:4804
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
HWND WINAPI GetParent(_In_ HWND)
#define ok(value,...)
Definition: atltest.h:57
#define GW_OWNER
Definition: winuser.h:761
GLuint res
Definition: glext.h:9613
static HWND(WINAPI *pGetAncestor)(HWND
#define GWLP_HWNDPARENT
Definition: winuser.h:852

Referenced by parent_dlg_proc(), test_dialog_parent(), test_parent_owner(), and test_SetParent().

◆ check_style_wnd_proc()

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

Definition at line 6349 of file win.c.

6350 {
6352  const STYLESTRUCT *got = (STYLESTRUCT *)lParam;
6353 
6354  if (message == WM_STYLECHANGING && wParam == GWL_STYLE)
6355  {
6356  ok(got->styleOld == expected[0].styleOld, "expected old style %#x, got %#x\n",
6357  expected[0].styleOld, got->styleOld);
6358  ok(got->styleNew == expected[0].styleNew, "expected new style %#x, got %#x\n",
6359  expected[0].styleNew, got->styleNew);
6360  }
6361  else if (message == WM_STYLECHANGED && wParam == GWL_STYLE)
6362  {
6363  ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n",
6364  expected[1].styleOld, got->styleOld);
6365  ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n",
6366  expected[1].styleNew, got->styleNew);
6367  }
6368 
6370 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
WPARAM wParam
Definition: combotst.c:138
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtrA
Definition: winuser.h:4804
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
DWORD styleNew
Definition: winuser.h:3669
DWORD styleOld
Definition: winuser.h:3668
LPARAM lParam
Definition: combotst.c:139
BOOL expected
Definition: store.c:2063

Referenced by test_set_window_style().

◆ check_window_style()

static void check_window_style ( DWORD  dwStyleIn,
DWORD  dwExStyleIn,
DWORD  dwStyleOut,
DWORD  dwExStyleOut 
)
static

Definition at line 4206 of file win.c.

4207 {
4208  DWORD dwActualStyle;
4209  DWORD dwActualExStyle;
4210  STYLESTRUCT ss;
4211  HWND hwnd;
4212  HWND hwndParent = NULL;
4213 
4214  ss.styleNew = dwStyleIn;
4215  ss.styleOld = dwExStyleIn;
4216 
4217  if (dwStyleIn & WS_CHILD)
4218  {
4220  WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
4221  }
4222 
4224  dwStyleIn, 0, 0, 0, 0, hwndParent, NULL, NULL, &ss);
4225  assert(hwnd);
4226 
4227  flush_events( TRUE );
4228 
4229  dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
4230  dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4231  ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
4232  ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
4233 
4234  /* try setting the styles explicitly */
4235  SetWindowLongA( hwnd, GWL_EXSTYLE, dwExStyleIn );
4236  dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
4237  dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4238  /* WS_EX_WINDOWEDGE can't always be changed */
4239  if (dwExStyleIn & WS_EX_DLGMODALFRAME)
4240  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4241  else if ((dwActualStyle & (WS_DLGFRAME | WS_THICKFRAME)) && !(dwExStyleIn & WS_EX_STATICEDGE))
4242  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4243  else
4244  dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
4245  ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
4246  ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
4247 
4248  SetWindowLongA( hwnd, GWL_STYLE, dwStyleIn );
4249  dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
4250  dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4251  /* WS_CLIPSIBLINGS can't be reset on top-level windows */
4252  if ((dwStyleIn & (WS_CHILD|WS_POPUP)) == WS_CHILD) dwStyleOut = dwStyleIn;
4253  else dwStyleOut = dwStyleIn | WS_CLIPSIBLINGS;
4254  /* WS_EX_WINDOWEDGE can't always be changed */
4255  if (dwExStyleIn & WS_EX_DLGMODALFRAME)
4256  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4257  else if ((dwActualStyle & (WS_DLGFRAME | WS_THICKFRAME)) && !(dwExStyleIn & WS_EX_STATICEDGE))
4258  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4259  else
4260  dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
4261  ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
4262  /* FIXME: Remove the condition below once Wine is fixed */
4263  todo_wine_if (dwActualExStyle != dwExStyleOut)
4264  ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
4265 
4268 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_THICKFRAME
Definition: pedump.c:630
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define TRUE
Definition: types.h:120
#define WS_DLGFRAME
Definition: pedump.c:626
#define assert(x)
Definition: debug.h:53
#define GWL_EXSTYLE
Definition: winuser.h:845
static ATOM atomStyleCheckClass
Definition: win.c:4184
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
static HWND hwndParent
Definition: cryptui.c:300
const char * LPCSTR
Definition: xmlstorage.h:183
#define todo_wine_if(is_todo)
Definition: test.h:165
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
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 WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define ss
Definition: i386-dis.c:434
static void flush_events(BOOL remove_messages)
Definition: win.c:84
#define WS_EX_STATICEDGE
Definition: winuser.h:403
#define MAKEINTATOM(i)
Definition: winbase.h:1445

Referenced by test_window_styles().

◆ check_wnd_state_()

static void check_wnd_state_ ( const char file,
int  line,
HWND  active,
HWND  foreground,
HWND  focus,
HWND  capture 
)
static

Definition at line 144 of file win.c.

146 {
147  ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow());
148  /* only check foreground if it belongs to the current thread */
149  /* foreground can be moved to a different app pretty much at any time */
150  if (foreground && GetForegroundWindow() &&
153  ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow());
154  ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus());
155  ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture());
156 }
HWND WINAPI GetCapture(void)
Definition: message.c:2880
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
Definition: parser.c:48
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define disable_success_count
Definition: test.h:172
#define NULL
Definition: types.h:112
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
HWND WINAPI GetFocus(void)
Definition: window.c:1909
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ check_z_order_debug()

static void check_z_order_debug ( HWND  hwnd,
HWND  next,
HWND  prev,
HWND  owner,
BOOL  topmost,
const char file,
int  line 
)
static

Definition at line 2795 of file win.c.

2797 {
2798  HWND test;
2799  DWORD ex_style;
2800 
2802  /* skip foreign windows */
2803  while (test && test != next &&
2806  GetWindow(test, GW_OWNER) == next))
2807  {
2808  /*trace("skipping next %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
2810  }
2811  ok_(file, line)(next == test, "%p: expected next %p, got %p\n", hwnd, next, test);
2812 
2814  /* skip foreign windows */
2815  while (test && test != prev &&
2818  GetWindow(test, GW_OWNER) == hwnd))
2819  {
2820  /*trace("skipping prev %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
2822  }
2823  ok_(file, line)(prev == test, "%p: expected prev %p, got %p\n", hwnd, prev, test);
2824 
2826  ok_(file, line)(owner == test, "%p: expected owner %p, got %p\n", hwnd, owner, test);
2827 
2828  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
2829  ok_(file, line)(!(ex_style & WS_EX_TOPMOST) == !topmost, "%p: expected %stopmost\n",
2830  hwnd, topmost ? "" : "NOT ");
2831 }
#define GW_HWNDNEXT
Definition: winuser.h:756
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GWL_EXSTYLE
Definition: winuser.h:845
#define test
Definition: rosglue.h:37
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
Definition: parser.c:48
#define GetWindowLongPtrA
Definition: winuser.h:4804
#define UlongToHandle(ul)
Definition: basetsd.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define WS_EX_TOPMOST
Definition: pedump.c:647
static DWORD our_pid
Definition: win.c:67
static unsigned __int64 next
Definition: rand_nt.c:6
#define NULL
Definition: types.h:112
#define GW_OWNER
Definition: winuser.h:761
#define GWLP_HINSTANCE
Definition: winuser.h:850
#define GW_HWNDPREV
Definition: winuser.h:757
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ create_tool_window()

static HWND create_tool_window ( LONG  style,
HWND  parent 
)
static

Definition at line 201 of file win.c.

202 {
203  HWND ret = CreateWindowExA(0, "ToolWindowClass", "Tool window 1", style,
204  0, 0, 100, 100, parent, 0, 0, NULL );
205  ok( ret != 0, "Creation failed\n" );
206  return ret;
207 }
r parent
Definition: btrfs.c:2944
int ret
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
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)
Arabic default style
Definition: afstyles.h:93

Referenced by test_parent_owner(), and test_SetWindowPos().

◆ create_window_thread()

static DWORD WINAPI create_window_thread ( void param)
static

Definition at line 3146 of file win.c.

3147 {
3149  DWORD res;
3150  BOOL ret;
3151 
3152  p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
3153 
3154  ret = SetEvent(p->window_created);
3155  ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
3156 
3157  res = WaitForSingleObject(p->test_finished, INFINITE);
3158  ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
3159 
3160  DestroyWindow(p->window);
3161  return 0;
3162 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI DestroyWindow(_In_ HWND)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
unsigned int BOOL
Definition: ntddk_ex.h:94
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4291
#define WAIT_OBJECT_0
Definition: winbase.h:403
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
GLuint res
Definition: glext.h:9613
GLfloat GLfloat p
Definition: glext.h:8902
#define INFINITE
Definition: serial.h:102
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by test_SetForegroundWindow().

◆ create_window_tree()

static void create_window_tree ( HWND  parent,
HWND window,
int  size 
)
static

Definition at line 8088 of file win.c.

8089 {
8090  static const DWORD style[] = { 0, WS_VISIBLE, WS_DISABLED, WS_VISIBLE | WS_DISABLED };
8091  int i, pos;
8092 
8093  memset(window, 0, size * sizeof(window[0]));
8094 
8095  pos = 0;
8096  for (i = 0; i < sizeof(style)/sizeof(style[0]); i++)
8097  {
8098  assert(pos < size);
8099  window[pos] = CreateWindowExA(0, "my_window", NULL, style[i] | WS_CHILD,
8100  0, 0, 100, 100, parent, 0, 0, NULL);
8101  ok(window[pos] != 0, "CreateWindowEx failed\n");
8102  pos++;
8103  assert(pos < size);
8105  0, 0, 100, 100, parent, 0, 0, NULL);
8106  ok(window[pos] != 0, "CreateWindowEx failed\n");
8107  pos++;
8108 
8109  assert(pos < size);
8110  window[pos] = CreateWindowExA(0, "my_httrasparent", NULL, style[i] | WS_CHILD,
8111  0, 0, 100, 100, parent, 0, 0, NULL);
8112  ok(window[pos] != 0, "CreateWindowEx failed\n");
8113  pos++;
8114  assert(pos < size);
8115  window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "my_httrasparent", NULL, style[i] | WS_CHILD,
8116  0, 0, 100, 100, parent, 0, 0, NULL);
8117  ok(window[pos] != 0, "CreateWindowEx failed\n");
8118  pos++;
8119 
8120  assert(pos < size);
8121  window[pos] = CreateWindowExA(0, "my_button", NULL, style[i] | WS_CHILD | BS_GROUPBOX,
8122  0, 0, 100, 100, parent, 0, 0, NULL);
8123  ok(window[pos] != 0, "CreateWindowEx failed\n");
8124  pos++;
8125  assert(pos < size);
8127  0, 0, 100, 100, parent, 0, 0, NULL);
8128  ok(window[pos] != 0, "CreateWindowEx failed\n");
8129  pos++;
8130  assert(pos < size);
8131  window[pos] = CreateWindowExA(0, "my_button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON,
8132  0, 0, 100, 100, parent, 0, 0, NULL);
8133  ok(window[pos] != 0, "CreateWindowEx failed\n");
8134  pos++;
8135  assert(pos < size);
8137  0, 0, 100, 100, parent, 0, 0, NULL);
8138  ok(window[pos] != 0, "CreateWindowEx failed\n");
8139  pos++;
8140 
8141  assert(pos < size);
8142  window[pos] = CreateWindowExA(0, "Button", NULL, style[i] | WS_CHILD | BS_GROUPBOX,
8143  0, 0, 100, 100, parent, 0, 0, NULL);
8144  ok(window[pos] != 0, "CreateWindowEx failed\n");
8145  pos++;
8146  assert(pos < size);
8148  0, 0, 100, 100, parent, 0, 0, NULL);
8149  ok(window[pos] != 0, "CreateWindowEx failed\n");
8150  pos++;
8151  assert(pos < size);
8152  window[pos] = CreateWindowExA(0, "Button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON,
8153  0, 0, 100, 100, parent, 0, 0, NULL);
8154  ok(window[pos] != 0, "CreateWindowEx failed\n");
8155  pos++;
8156  assert(pos < size);
8158  0, 0, 100, 100, parent, 0, 0, NULL);
8159  ok(window[pos] != 0, "CreateWindowEx failed\n");
8160  pos++;
8161 
8162  assert(pos < size);
8163  window[pos] = CreateWindowExA(0, "Static", NULL, style[i] | WS_CHILD,
8164  0, 0, 100, 100, parent, 0, 0, NULL);
8165  ok(window[pos] != 0, "CreateWindowEx failed\n");
8166  pos++;
8167  assert(pos < size);
8169  0, 0, 100, 100, parent, 0, 0, NULL);
8170  ok(window[pos] != 0, "CreateWindowEx failed\n");
8171  pos++;
8172  }
8173 }
#define WS_DISABLED
Definition: pedump.c:621
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define assert(x)
Definition: debug.h:53
#define WS_CHILD
Definition: pedump.c:617
#define BS_GROUPBOX
Definition: pedump.c:658
GLsizeiptr size
Definition: glext.h:5919
r parent
Definition: btrfs.c:2944
unsigned long DWORD
Definition: ntddk_ex.h:95
static IHTMLWindow2 * window
Definition: events.c:77
#define BS_PUSHBUTTON
Definition: pedump.c:651
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
#define ok(value,...)
Definition: atltest.h:57
#define NULL
Definition: types.h:112
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)
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_child_window_from_point().

◆ def_window_procA()

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

Definition at line 5664 of file win.c.

5665 {
5666  return DefWindowProcA(hwnd, msg, wparam, lparam);
5667 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by test_IsWindowUnicode().

◆ def_window_procW()

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

Definition at line 5669 of file win.c.

5670 {
5671  return DefWindowProcW(hwnd, msg, wparam, lparam);
5672 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define msg(x)
Definition: auth_time.c:54
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by test_IsWindowUnicode().

◆ destroy_dialog_owner_proc()

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

Definition at line 4735 of file win.c.

4736 {
4737  if (msg == WM_ENTERIDLE) {
4738  HWND dialog = (HWND)lparam;
4740  }
4741  return DefWindowProcA( hwnd, msg, wparam, lparam );
4742 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI DestroyWindow(_In_ HWND)
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define WM_ENTERIDLE
Definition: winuser.h:1732
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HWND dialog
Definition: gui.c:33
#define msg(x)
Definition: auth_time.c:54
static HWND(WINAPI *pGetAncestor)(HWND
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by test_dialog_parent().

◆ dump_minmax_info()

static void dump_minmax_info ( const MINMAXINFO minmax)
static

Definition at line 73 of file win.c.

74 {
75  trace("Reserved=%d,%d MaxSize=%d,%d MaxPos=%d,%d MinTrack=%d,%d MaxTrack=%d,%d\n",
76  minmax->ptReserved.x, minmax->ptReserved.y,
77  minmax->ptMaxSize.x, minmax->ptMaxSize.y,
78  minmax->ptMaxPosition.x, minmax->ptMaxPosition.y,
79  minmax->ptMinTrackSize.x, minmax->ptMinTrackSize.y,
80  minmax->ptMaxTrackSize.x, minmax->ptMaxTrackSize.y);
81 }
POINT ptMinTrackSize
Definition: winuser.h:3606
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3603
POINT ptMaxSize
Definition: winuser.h:3604
long x
Definition: polytest.cpp:48
#define trace
Definition: atltest.h:70
POINT ptMaxPosition
Definition: winuser.h:3605
POINT ptMaxTrackSize
Definition: winuser.h:3607

Referenced by mdi_child_wnd_proc_1(), mdi_child_wnd_proc_2(), and test_thick_child_size_winproc().

◆ dump_region()

void dump_region ( HRGN  hrgn)

Definition at line 7694 of file msg.c.

7695 {
7696  DWORD i, size;
7697  RGNDATA *data = NULL;
7698  RECT *rect;
7699 
7700  if (!hrgn)
7701  {
7702  printf( "null region\n" );
7703  return;
7704  }
7705  if (!(size = GetRegionData( hrgn, 0, NULL ))) return;
7706  if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return;
7707  GetRegionData( hrgn, size, data );
7708  printf("%d rects:", data->rdh.nCount );
7709  for (i = 0, rect = (RECT *)data->Buffer; i < data->rdh.nCount; i++, rect++)
7710  printf( " %s", wine_dbgstr_rect( rect ));
7711  printf("\n");
7712  HeapFree( GetProcessHeap(), 0, data );
7713 }
& rect
Definition: startmenu.cpp:1413
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
const char * wine_dbgstr_rect(const RECT *rect)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HRGN hrgn
Definition: win.c:55
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
#define NULL
Definition: types.h:112
DWORD WINAPI GetRegionData(_In_ HRGN hrgn, _In_ DWORD nCount, _Out_writes_bytes_to_opt_(nCount, return) LPRGNDATA lpRgnData)
#define HeapFree(x, y, z)
Definition: compat.h:594
#define printf
Definition: config.h:203

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

◆ DWORD()

static DWORD ( WINAPI pSetLayout)
static

◆ empty_dlg_proc()

static INT_PTR WINAPI empty_dlg_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 4338 of file win.c.

4339 {
4340  return 0;
4341 }

Referenced by check_dialog_style(), and test_dialog_parent().

◆ empty_dlg_proc2()

static INT_PTR WINAPI empty_dlg_proc2 ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 4387 of file win.c.

4388 {
4389  if (msg == WM_INITDIALOG)
4390  {
4392  struct dialog_param *param = (struct dialog_param *)lparam;
4393  BOOL parent_is_child;
4394  HWND disabled_hwnd;
4395  LRESULT id, ret;
4396 
4397  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4398  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4399  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x2222, 0);
4400  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4401  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4402  ok(id == MAKELONG(0x2222,DC_HASDEFID), "expected (0x2222,DC_HASDEFID), got %08lx\n", id);
4403 
4404  expected_id = MAKELONG(0x2222,DC_HASDEFID);
4405 
4406  parent_is_child = (GetWindowLongA(param->parent, GWL_STYLE) & (WS_POPUP | WS_CHILD)) == WS_CHILD;
4407 
4408  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4409  if (parent_is_child)
4410  {
4411  ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
4412  disabled_hwnd = param->grand_parent;
4413  }
4414  else
4415  {
4416  ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
4417  disabled_hwnd = param->parent;
4418  }
4419 
4420  if (param->grand_parent)
4421  {
4422  if (parent_is_child)
4423  ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
4424  else
4425  ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
4426  }
4427 
4428  DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0);
4429  ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style);
4430 
4431  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4432  ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
4433  if (param->grand_parent)
4434  ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
4435 
4437  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4438  ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
4439  if (param->grand_parent)
4440  ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
4441 
4442  param->dlg_data->style |= WS_CHILD;
4444  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4445 
4446  param->dlg_data->style |= DS_CONTROL;
4448  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4449 
4450  param->dlg_data->dwExtendedStyle |= WS_EX_CONTROLPARENT;
4453  param->dlg_data->style &= ~DS_CONTROL;
4455  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4456 
4459  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4460 
4461  param->dlg_data->style |= DS_CONTROL;
4463  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4464 
4465  EndDialog(hwnd, 0);
4466  }
4467  return 0;
4468 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDOK
Definition: winuser.h:824
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DM_SETDEFID
Definition: winuser.h:2082
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
static INT_PTR WINAPI empty_dlg_proc3(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:4345
#define DM_GETDEFID
Definition: winuser.h:2081
static LRESULT expected_id
Definition: win.c:4343
#define WS_EX_CONTROLPARENT
Definition: winuser.h:387
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define DC_HASDEFID
Definition: winuser.h:2585
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define MAKELONG(a, b)
Definition: typedefs.h:249
BOOL WINAPI IsWindowEnabled(_In_ HWND)
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
INT_PTR WINAPI DialogBoxIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
int ret
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define GWL_STYLE
Definition: winuser.h:846
#define DS_CONTROL
Definition: winuser.h:372
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
#define msg(x)
Definition: auth_time.c:54
GLenum GLuint id
Definition: glext.h:5579
LONG_PTR LRESULT
Definition: windef.h:209
Arabic default style
Definition: afstyles.h:93
#define WM_INITDIALOG
Definition: winuser.h:1722

Referenced by check_dialog_style().

◆ empty_dlg_proc3()

static INT_PTR WINAPI empty_dlg_proc3 ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 4345 of file win.c.

4346 {
4347  if (msg == WM_INITDIALOG)
4348  {
4350  LRESULT id, ret;
4351 
4352  id = DefDlgProcA(parent, DM_GETDEFID, 0, 0);
4353  if (!id || root_dialog(hwnd) == hwnd)
4354  parent = 0;
4355 
4356  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4357  if (!parent)
4358  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4359  else
4360  ok(id == expected_id, "expected %08lx, got %08lx\n", expected_id, id);
4361 
4362  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x3333, 0);
4363  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4364  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4365  ok(id == MAKELONG(0x3333,DC_HASDEFID), "expected (0x3333,DC_HASDEFID), got %08lx\n", id);
4366 
4367  if (parent)
4368  {
4369  id = DefDlgProcA(parent, DM_GETDEFID, 0, 0);
4370  ok(id == MAKELONG(0x3333,DC_HASDEFID), "expected (0x3333,DC_HASDEFID), got %08lx\n", id);
4371 
4372  expected_id = MAKELONG(0x3333,DC_HASDEFID);
4373  }
4374 
4375  EndDialog(hwnd, 0);
4376  }
4377 
4378  return 0;
4379 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDOK
Definition: winuser.h:824
static HWND root_dialog(HWND hwnd)
Definition: win.c:4318
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DM_SETDEFID
Definition: winuser.h:2082
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define DM_GETDEFID
Definition: winuser.h:2081
static LRESULT expected_id
Definition: win.c:4343
#define DC_HASDEFID
Definition: winuser.h:2585
#define MAKELONG(a, b)
Definition: typedefs.h:249
r parent
Definition: btrfs.c:2944
int ret
HWND WINAPI GetParent(_In_ HWND)
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
GLenum GLuint id
Definition: glext.h:5579
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_INITDIALOG
Definition: winuser.h:1722

Referenced by empty_dlg_proc2().

◆ enum_proc()

static BOOL CALLBACK enum_proc ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 671 of file win.c.

672 {
673  (*(LPINT)lParam)++;
674  if (*(LPINT)lParam > 2) return FALSE;
675  return TRUE;
676 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LPARAM lParam
Definition: combotst.c:139
int * LPINT
Definition: windef.h:178

Referenced by enum_thread().

◆ enum_thread()

static DWORD CALLBACK enum_thread ( void arg)
static

Definition at line 677 of file win.c.

678 {
679  INT count;
680  HWND hwnd[3];
681  BOOL ret;
682  MSG msg;
683 
684  if (pGetGUIThreadInfo)
685  {
687  info.cbSize = sizeof(info);
688  ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info );
689  ok( ret || broken(!ret), /* win9x */
690  "GetGUIThreadInfo failed without message queue\n" );
691  SetLastError( 0xdeadbeef );
692  info.cbSize = sizeof(info) + 1;
693  ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info );
694  ok( !ret, "GetGUIThreadInfo succeeded with wrong size\n" );
696  broken(GetLastError() == 0xdeadbeef), /* win9x */
697  "wrong error %u\n", GetLastError() );
698  }
699 
700  PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */
701 
702  count = 0;
704  ok( ret, "EnumThreadWindows should have returned TRUE\n" );
705  ok( count == 0, "count should be 0 got %d\n", count );
706 
707  hwnd[0] = CreateWindowExA(0, "ToolWindowClass", "Tool window 1", WS_POPUP,
708  0, 0, 100, 100, 0, 0, 0, NULL );
709  count = 0;
711  ok( ret, "EnumThreadWindows should have returned TRUE\n" );
712  if (count != 2) /* Vista gives us two windows for the price of one */
713  {
714  ok( count == 1, "count should be 1 got %d\n", count );
715  hwnd[2] = CreateWindowExA(0, "ToolWindowClass", "Tool window 2", WS_POPUP,
716  0, 0, 100, 100, 0, 0, 0, NULL );
717  }
718  else hwnd[2] = 0;
719 
720  hwnd[1] = CreateWindowExA(0, "ToolWindowClass", "Tool window 3", WS_POPUP,
721  0, 0, 100, 100, 0, 0, 0, NULL );
722  count = 0;
724  ok( !ret, "EnumThreadWindows should have returned FALSE\n" );
725  ok( count == 3, "count should be 3 got %d\n", count );
726 
727  if (hwnd[2]) DestroyWindow(hwnd[2]);
728  DestroyWindow(hwnd[1]);
729  DestroyWindow(hwnd[0]);
730  return 0;
731 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
GLuint GLuint GLsizei count
Definition: gl.h:1545
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI EnumThreadWindows(_In_ DWORD, _In_ WNDENUMPROC, _In_ LPARAM)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
BOOL WINAPI DestroyWindow(_In_ HWND)
int32_t INT
Definition: typedefs.h:58
#define PM_NOREMOVE
Definition: winuser.h:1181
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG_PTR LPARAM
Definition: windef.h:208
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
#define SetLastError(x)
Definition: compat.h:611
struct _test_info info[]
Definition: SetCursorPos.c:19
int ret
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define NULL
Definition: types.h:112
#define msg(x)
Definition: auth_time.c:54
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)
static BOOL CALLBACK enum_proc(HWND hwnd, LPARAM lParam)
Definition: win.c:671

Referenced by test_enum_thread_windows().

◆ EnumChildProc()

static BOOL CALLBACK EnumChildProc ( HWND  hwndChild,
LPARAM  lParam 
)
static

Definition at line 185 of file win.c.

186 {
187  (*(LPINT)lParam)++;
188  trace("EnumChildProc on %p\n", hwndChild);
189  if (*(LPINT)lParam > 1) return FALSE;
190  return TRUE;
191 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define trace
Definition: atltest.h:70
LPARAM lParam
Definition: combotst.c:139
int * LPINT
Definition: windef.h:178

Referenced by test_parent_owner().

◆ EnumChildProc1()

static BOOL CALLBACK EnumChildProc1 ( HWND  hwndChild,
LPARAM  lParam 
)
static

Definition at line 194 of file win.c.

195 {
196  trace("EnumChildProc1 on %p\n", hwndChild);
197  if ((HWND)lParam == hwndChild) return FALSE;
198  return TRUE;
199 }
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define trace
Definition: atltest.h:70
LPARAM lParam
Definition: combotst.c:139

Referenced by test_parent_owner().

◆ FixedAdjustWindowRectEx()

static void FixedAdjustWindowRectEx ( RECT rc,
LONG  style,
BOOL  menu,
LONG  exstyle 
)
static

Definition at line 994 of file win.c.

995 {
996  AdjustWindowRectEx(rc, style, menu, exstyle);
997  /* AdjustWindowRectEx does not include scroll bars */
998  if (style & WS_VSCROLL)
999  {
1000  if(exstyle & WS_EX_LEFTSCROLLBAR)
1002  else
1004  }
1005  if (style & WS_HSCROLL)
1007 }
#define SM_CYHSCROLL
Definition: winuser.h:952
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define WS_EX_LEFTSCROLLBAR
Definition: winuser.h:392
int WINAPI GetSystemMetrics(_In_ int)
#define WS_HSCROLL
Definition: pedump.c:628
#define WS_VSCROLL
Definition: pedump.c:627
#define SM_CXVSCROLL
Definition: winuser.h:951
LONG bottom
Definition: windef.h:309
Arabic default style
Definition: afstyles.h:93

Referenced by test_nonclient_area().

◆ flush_events()

static void flush_events ( BOOL  remove_messages)
static

Definition at line 84 of file win.c.

85 {
86  MSG msg;
87  int diff = 200;
88  int min_timeout = 100;
89  DWORD time = GetTickCount() + diff;
90 
91  while (diff > 0)
92  {
93  if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
94  if (remove_messages)
95  while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
96  diff = time - GetTickCount();
97  min_timeout = 50;
98  }
99 }
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
__u16 time
Definition: mkdosfs.c:366
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define FALSE
Definition: types.h:117
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WAIT_TIMEOUT
Definition: dderror.h:14
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
#define QS_ALLINPUT
Definition: winuser.h:874
#define NULL
Definition: types.h:112
#define msg(x)
Definition: auth_time.c:54
#define PM_REMOVE
Definition: winuser.h:1182

Referenced by check_dialog_style(), check_window_style(), main_window_procA(), run_NCRedrawLoop(), test_csparentdc(), test_GetMessagePos(), test_GetUpdateRect(), test_keyboard_input(), test_mouse_input(), test_scrolldc(), test_scrollwindow(), test_SetActiveWindow(), test_SetForegroundWindow(), test_SetWindowPos(), test_window_from_point(), test_window_without_child_style(), and window_from_point_proc().

◆ fullscreen_wnd_proc()

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

Definition at line 7340 of file win.c.

7341 {
7342  switch (msg)
7343  {
7344  case WM_NCCREATE:
7345  {
7346  CREATESTRUCTA *cs = (CREATESTRUCTA *)lp;
7347  ok(cs->x == mi.rcMonitor.left && cs->y == mi.rcMonitor.top &&
7348  cs->cx == mi.rcMonitor.right && cs->cy == mi.rcMonitor.bottom,
7349  "expected %s, got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&mi.rcMonitor),
7350  cs->x, cs->y, cs->cx, cs->cy);
7351  break;
7352  }
7353  case WM_GETMINMAXINFO:
7354  {
7355  MINMAXINFO *minmax = (MINMAXINFO *)lp;
7356  ok(minmax->ptMaxPosition.x <= mi.rcMonitor.left, "%d <= %d\n", minmax->ptMaxPosition.x, mi.rcMonitor.left);
7357  ok(minmax->ptMaxPosition.y <= mi.rcMonitor.top, "%d <= %d\n", minmax->ptMaxPosition.y, mi.rcMonitor.top);
7358  ok(minmax->ptMaxSize.x >= mi.rcMonitor.right, "%d >= %d\n", minmax->ptMaxSize.x, mi.rcMonitor.right);
7359  ok(minmax->ptMaxSize.y >= mi.rcMonitor.bottom, "%d >= %d\n", minmax->ptMaxSize.y, mi.rcMonitor.bottom);
7360  break;
7361  }
7362  }
7363  return DefWindowProcA(hwnd, msg, wp, lp);
7364 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
POINT ptMaxSize
Definition: winuser.h:3604
long x
Definition: polytest.cpp:48
LONG top
Definition: windef.h:307
static MONITORINFO mi
Definition: win.c:7338
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
RECT rcMonitor
Definition: winuser.h:3761
#define WM_NCCREATE
Definition: winuser.h:1666
uint32_t cs
Definition: isohybrid.c:75
const char * wine_dbgstr_rect(const RECT *rect)
POINT ptMaxPosition
Definition: winuser.h:3605
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
LONG bottom
Definition: windef.h:309
#define WM_GETMINMAXINFO
Definition: winuser.h:1623

Referenced by test_fullscreen().

◆ get_window_attributes()

static void get_window_attributes ( HWND  hwnd,
struct window_attributes attrs 
)
static

Definition at line 8181 of file win.c.

8182 {
8183  DWORD style, ex_style, hittest;
8184 
8186  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
8187  attrs->class_name[0] = 0;
8188  GetClassNameA(hwnd, attrs->class_name, sizeof(attrs->class_name));
8189  hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, 0);
8190 
8191  attrs->is_visible = (style & WS_VISIBLE) != 0;
8192  attrs->is_enabled = (style & WS_DISABLED) == 0;
8193  attrs->is_groupbox = !lstrcmpiA(attrs->class_name, "Button") && (style & BS_TYPEMASK) == BS_GROUPBOX;
8194  attrs->is_httransparent = hittest == HTTRANSPARENT;
8195  attrs->is_extransparent = (ex_style & WS_EX_TRANSPARENT) != 0;
8196 }
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HTTRANSPARENT
Definition: winuser.h:2449
int WINAPI GetClassNameA(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPSTR lpClassName, _In_ int nMaxCount)
int WINAPI lstrcmpiA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:42
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WS_EX_TRANSPARENT
Definition: pedump.c:649
#define GWL_EXSTYLE
Definition: winuser.h:845
BOOL is_enabled
Definition: win.c:8178
#define WM_NCHITTEST
Definition: winuser.h:1669
#define BS_GROUPBOX
Definition: pedump.c:658
BOOL is_httransparent
Definition: win.c:8178
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL is_extransparent
Definition: win.c:8178
#define GWL_STYLE
Definition: winuser.h:846
char class_name[128]
Definition: win.c:8177
#define BS_TYPEMASK
Definition: winuser.h:270
BOOL is_groupbox
Definition: win.c:8178
BOOL is_visible
Definition: win.c:8178
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by test_child_window_from_point().

◆ gettext_msg_thread()

static DWORD CALLBACK gettext_msg_thread ( LPVOID  arg)
static

Definition at line 6577 of file win.c.

6578 {
6579  HWND hwnd = arg;
6580  char buf[32];
6581  INT buf_len;
6582 
6583  /* test GetWindowTextA */
6584  num_gettext_msgs = 0;
6585  memset( buf, 0, sizeof(buf) );
6586  buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
6587  ok( buf_len != 0, "expected a nonempty window text\n" );
6588  ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
6589  ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
6590 
6591  return 0;
6592 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static DWORD num_gettext_msgs
Definition: win.c:58
int WINAPI GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
Definition: window.c:1330
void * arg
Definition: msvc.h:10
int32_t INT
Definition: typedefs.h:58
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define ok(value,...)
Definition: atltest.h:57
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_gettext().

◆ HMONITOR()

static HMONITOR ( WINAPI pMonitorFromPoint)
static

◆ HWND()

◆ ignore_message()

static BOOL ignore_message ( UINT  message)
static

Definition at line 173 of file win.c.

174 {
175  /* these are always ignored */
176  return (message >= 0xc000 ||
177  message == WM_GETICON ||
178  message == WM_GETOBJECT ||
179  message == WM_TIMER ||
180  message == WM_SYSTIMER ||
181  message == WM_TIMECHANGE ||
183 }
Definition: tftpd.h:59
#define WM_SYSTIMER
Definition: win.c:30
#define WM_TIMER
Definition: winuser.h:1725
#define WM_DEVICECHANGE
Definition: winuser.h:1794
#define WM_TIMECHANGE
Definition: winuser.h:1617

Referenced by peek_message(), and test_mouse_input().

◆ int()

static int ( WINAPI pGetWindowRgnBox)
static

◆ main_window_procA()

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

Definition at line 749 of file win.c.

750 {
751  switch (msg)
752  {
753  case WM_GETMINMAXINFO:
754  {
755  SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0x20031021);
756  break;
757  }
759  {
760  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
761  if (!(winpos->flags & SWP_NOMOVE))
762  {
763  ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x);
764  ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y);
765  }
766  /* Win9x does not fixup cx/xy for WM_WINDOWPOSCHANGING */
767  if (!(winpos->flags & SWP_NOSIZE) && !is_win9x)
768  {
769  ok((winpos->cx >= 0 && winpos->cx <= 32767) ||
770  winpos->cx == 32768, /* win7 doesn't truncate */
771  "bad winpos->cx %d\n", winpos->cx);
772  ok((winpos->cy >= 0 && winpos->cy <= 32767) ||
773  winpos->cy == 40000, /* win7 doesn't truncate */
774  "bad winpos->cy %d\n", winpos->cy);
775  }
776  break;
777  }
778  case WM_WINDOWPOSCHANGED:
780  {
781  RECT rc1, rc2;
782  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
783  ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x);
784  ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y);
785 
786  ok((winpos->cx >= 0 && winpos->cx <= 32767) ||
787  winpos->cx == 32768, /* win7 doesn't truncate */
788  "bad winpos->cx %d\n", winpos->cx);
789  ok((winpos->cy >= 0 && winpos->cy <= 32767) ||
790  winpos->cy == 40000, /* win7 doesn't truncate */
791  "bad winpos->cy %d\n", winpos->cy);
792 
793  GetWindowRect(hwnd, &rc1);
794  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
795  /* note: winpos coordinates are relative to parent */
797  if (0)
798  {
799  /* Uncomment this once the test succeeds in all cases */
800  ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
802 
805  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
806  ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
808  }
809  break;
810  }
811  case WM_NCCREATE:
812  {
813  BOOL got_getminmaxinfo = GetWindowLongPtrA(hwnd, GWLP_USERDATA) == 0x20031021;
815 
816  if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
817  ok(got_getminmaxinfo, "main: WM_GETMINMAXINFO should have been received before WM_NCCREATE\n");
818  else
819  ok(!got_getminmaxinfo, "main: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE\n");
820  break;
821  }
822  case WM_COMMAND:
824  {
826  flush_events( FALSE );
827  }
828  break;
829  case WM_GETTEXT:
831  if (g_wm_gettext_override.enabled)
832  {
833  char *text = (char*)lparam;
834  ok(g_wm_gettext_override.buff == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buff, text);
835  ok(*text == 0, "expected empty string buffer %x\n", *text);
836  return 0;
837  }
838  break;
839  case WM_SETTEXT:
841  break;
842  case WM_ACTIVATEAPP:
843  if (wparam) app_activated = TRUE;
844  else app_deactivated = TRUE;
845  break;
846  }
847 
848  return DefWindowProcA(hwnd, msg, wparam, lparam);
849 }
#define WS_THICKFRAME
Definition: pedump.c:630
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static DWORD num_gettext_msgs
Definition: win.c:58
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
static BOOL app_deactivated
Definition: win.c:63
#define TRUE
Definition: types.h:120
static BOOL test_lbuttondown_flag
Definition: win.c:57
const WCHAR * text
Definition: package.c:1827
#define WM_NCCALCSIZE
Definition: winuser.h:1668
#define WM_GETTEXT
Definition: winuser.h:1601
static struct wm_gettext_override_data g_wm_gettext_override
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
static BOOL app_activated
Definition: win.c:63
#define WM_NCCREATE
Definition: winuser.h:1666
static BOOL is_win9x
Definition: win.c:69
uint32_t cs
Definition: isohybrid.c:75
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3570
#define SW_SHOW
Definition: winuser.h:769
#define WM_SETTEXT
Definition: winuser.h:1600
static DWORD num_settext_msgs
Definition: win.c:59
#define GetWindowLongPtrA
Definition: winuser.h:4804
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1644
const char * wine_dbgstr_rect(const RECT *rect)
#define disable_success_count
Definition: test.h:172
#define SetWindowLongPtrA
Definition: winuser.h:5321
#define WM_COMMAND
Definition: winuser.h:1723
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SWP_NOSIZE
Definition: winuser.h:1231
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define WM_ACTIVATEAPP
Definition: winuser.h:1615
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1645
#define msg(x)
Definition: auth_time.c:54
#define SWP_NOMOVE
Definition: winuser.h:1230
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static const WCHAR rc2[]
Definition: oid.c:1216
static void flush_events(BOOL remove_messages)
Definition: win.c:84
#define WM_GETMINMAXINFO
Definition: winuser.h:1623
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by RegisterWindowClasses(), and test_SetWindowLong().

◆ main_window_procW()

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

Definition at line 851 of file win.c.

852 {
853  switch (msg)
854  {
855  case WM_GETTEXT:
857  if (g_wm_gettext_override.enabled)
858  {
859  WCHAR *text = (WCHAR*)lparam;
860  ok(g_wm_gettext_override.buffW == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buffW, text);
861  ok(*text == 0, "expected empty string buffer %x\n", *text);
862  return 0;
863  }
864  break;
865  }
866 
867  return DefWindowProcA(hwnd, msg, wparam, lparam);
868 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static DWORD num_gettext_msgs
Definition: win.c:58
const WCHAR * text
Definition: package.c:1827
#define WM_GETTEXT
Definition: winuser.h:1601
static struct wm_gettext_override_data g_wm_gettext_override
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
__wchar_t WCHAR
Definition: xmlstorage.h:180
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by RegisterWindowClasses().

◆ mdi_child_wnd_proc_1()

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

Definition at line 1808 of file win.c.

1809 {
1810  switch (msg)
1811  {
1812  case WM_NCCREATE:
1813  case WM_CREATE:
1814  {
1816  MDICREATESTRUCTA *mdi_cs = cs->lpCreateParams;
1817 
1818  ok(cs->dwExStyle & WS_EX_MDICHILD, "WS_EX_MDICHILD should be set\n");
1819  ok(mdi_cs->lParam == (LPARAM)mdi_lParam_test_message, "wrong mdi_cs->lParam\n");
1820 
1821  ok(!lstrcmpA(cs->lpszClass, "MDI_child_Class_1"), "wrong class name\n");
1822  ok(!lstrcmpA(cs->lpszClass, mdi_cs->szClass), "class name does not match\n");
1823  ok(!lstrcmpA(cs->lpszName, "MDI child"), "wrong title\n");
1824  ok(!lstrcmpA(cs->lpszName, mdi_cs->szTitle), "title does not match\n");
1825  ok(cs->hInstance == mdi_cs->hOwner, "%p != %p\n", cs->hInstance, mdi_cs->hOwner);
1826 
1827  /* MDICREATESTRUCT should have original values */
1828  ok(mdi_cs->style == 0 || mdi_cs->style == 0x7fffffff || mdi_cs->style == 0xffffffff || mdi_cs->style == WS_MAXIMIZE,
1829  "mdi_cs->style does not match (%08x)\n", mdi_cs->style);
1830  ok(mdi_cs->x == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->x);
1831  ok(mdi_cs->y == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->y);
1832  ok(mdi_cs->cx == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->cx);
1833  ok(mdi_cs->cy == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->cy);
1834 
1835  /* CREATESTRUCT should have fixed values */
1836  ok(cs->x != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->x);
1837  ok(cs->y != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->y);
1838 
1839  /* cx/cy == CW_USEDEFAULT are translated to NOT zero values */
1840  ok(cs->cx != CW_USEDEFAULT && cs->cx != 0, "%d == CW_USEDEFAULT\n", cs->cx);
1841  ok(cs->cy != CW_USEDEFAULT && cs->cy != 0, "%d == CW_USEDEFAULT\n", cs->cy);
1842 
1843  ok(!(cs->style & WS_POPUP), "WS_POPUP is not allowed\n");
1844 
1845  if (GetWindowLongA(cs->hwndParent, GWL_STYLE) & MDIS_ALLCHILDSTYLES)
1846  {
1847  LONG style = mdi_cs->style | WS_CHILD | WS_CLIPSIBLINGS;
1848  ok(cs->style == style,
1849  "cs->style does not match (%08x)\n", cs->style);
1850  }
1851  else
1852  {
1853  LONG style = mdi_cs->style;
1854  style &= ~WS_POPUP;
1857  ok(cs->style == style,
1858  "cs->style does not match (%08x)\n", cs->style);
1859  }
1860  break;
1861  }
1862 
1863  case WM_GETMINMAXINFO:
1864  {
1866  RECT rc;
1867  MINMAXINFO *minmax = (MINMAXINFO *)lparam;
1868  MINMAXINFO my_minmax;
1869  LONG style, exstyle;
1870 
1872  exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
1873 
1874  GetClientRect(client, &rc);
1875 
1876  GetClientRect(client, &rc);
1877  if ((style & WS_CAPTION) == WS_CAPTION)
1878  style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
1879  AdjustWindowRectEx(&rc, style, 0, exstyle);
1880  trace("MDI child: calculated max window size = (%d x %d)\n", rc.right-rc.left, rc.bottom-rc.top);
1881  dump_minmax_info( minmax );
1882 
1883  ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
1884  minmax->ptMaxSize.x, rc.right - rc.left);
1885  ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
1886  minmax->ptMaxSize.y, rc.bottom - rc.top);
1887 
1889 
1890  trace("DefMDIChildProc returned:\n");
1891  dump_minmax_info( minmax );
1892 
1893  MDI_ChildGetMinMaxInfo(client, hwnd, &my_minmax);
1894  ok(minmax->ptMaxSize.x == my_minmax.ptMaxSize.x, "default width of maximized child %d != %d\n",
1895  minmax->ptMaxSize.x, my_minmax.ptMaxSize.x);
1896  ok(minmax->ptMaxSize.y == my_minmax.ptMaxSize.y, "default height of maximized child %d != %d\n",
1897  minmax->ptMaxSize.y, my_minmax.ptMaxSize.y);
1898 
1899  return 1;
1900  }
1901 
1902  case WM_MDIACTIVATE:
1903  {
1904  HWND active, client = GetParent(hwnd);
1905  /*trace("%p WM_MDIACTIVATE %08x %08lx\n", hwnd, wparam, lparam);*/
1906  active = (HWND)SendMessageA(client, WM_MDIGETACTIVE, 0, 0);
1907  if (hwnd == (HWND)lparam) /* if we are being activated */
1908  ok (active == (HWND)lparam, "new active %p != active %p\n", (HWND)lparam, active);
1909  else
1910  ok (active == (HWND)wparam, "old active %p != active %p\n", (HWND)wparam, active);
1911  break;
1912  }
1913  }
1914  return DefMDIChildProcA(hwnd, msg, wparam, lparam);
1915 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_THICKFRAME
Definition: pedump.c:630
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DefMDIChildProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
long y
Definition: polytest.cpp:48
POINT ptMaxSize
Definition: winuser.h:3604
long x
Definition: polytest.cpp:48
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG top
Definition: windef.h:307
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define GWL_EXSTYLE
Definition: winuser.h:845
static void dump_minmax_info(const MINMAXINFO *minmax)
Definition: win.c:73
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define WM_NCCREATE
Definition: winuser.h:1666
uint32_t cs
Definition: isohybrid.c:75
#define WS_EX_MDICHILD
Definition: winuser.h:394
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static char mdi_lParam_test_message[]
Definition: win.c:1366
#define CW_USEDEFAULT
Definition: winuser.h:225
static void MDI_ChildGetMinMaxInfo(HWND client, HWND hwnd, MINMAXINFO *lpMinMax)
Definition: win.c:1789
LONG_PTR LPARAM
Definition: windef.h:208
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_CAPTION
Definition: pedump.c:624
#define trace
Definition: atltest.h:70
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
static FILE * client
Definition: client.c:41
#define WM_MDIGETACTIVE
Definition: winuser.h:1804
#define WM_MDIACTIVATE
Definition: winuser.h:1797
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
#define WS_BORDER
Definition: pedump.c:625
#define WS_MINIMIZEBOX
Definition: pedump.c:631
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1591
LONG bottom
Definition: windef.h:309
Arabic default style
Definition: afstyles.h:93
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_SYSMENU
Definition: pedump.c:629
#define WM_GETMINMAXINFO
Definition: winuser.h:1623
static HWND(WINAPI *pGetAncestor)(HWND
static UINT WPARAM wparam
Definition: combo.c:716
#define WS_MAXIMIZE
Definition: pedump.c:623

Referenced by mdi_RegisterWindowClasses().

◆ mdi_child_wnd_proc_2()

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

Definition at line 1917 of file win.c.

1918 {
1919  switch (msg)
1920  {
1921  case WM_NCCREATE:
1922  case WM_CREATE:
1923  {
1925 
1926  trace("%s: x %d, y %d, cx %d, cy %d\n", (msg == WM_NCCREATE) ? "WM_NCCREATE" : "WM_CREATE",
1927  cs->x, cs->y, cs->cx, cs->cy);
1928 
1929  ok(!(cs->dwExStyle & WS_EX_MDICHILD), "WS_EX_MDICHILD should not be set\n");
1930  ok(cs->lpCreateParams == mdi_lParam_test_message, "wrong cs->lpCreateParams\n");
1931 
1932  ok(!lstrcmpA(cs->lpszClass, "MDI_child_Class_2"), "wrong class name\n");
1933  ok(!lstrcmpA(cs->lpszName, "MDI child"), "wrong title\n");
1934 
1935  /* CREATESTRUCT should have fixed values */
1936  /* For some reason Win9x doesn't translate cs->x from CW_USEDEFAULT,
1937  while NT does. */
1938  /*ok(cs->x != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->x);*/
1939  ok(cs->y != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->y);
1940 
1941  /* cx/cy == CW_USEDEFAULT are translated to 0 */
1942  /* For some reason Win98 doesn't translate cs->cx from CW_USEDEFAULT,
1943  while Win95, Win2k, WinXP do. */
1944  /*ok(cs->cx == 0, "%d != 0\n", cs->cx);*/
1945  ok(cs->cy == 0, "%d != 0\n", cs->cy);
1946  break;
1947  }
1948 
1949  case WM_GETMINMAXINFO:
1950  {
1952  RECT rc;
1953  MINMAXINFO *minmax = (MINMAXINFO *)lparam;
1954  LONG style, exstyle;
1955 
1957  exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
1958 
1959  GetClientRect(parent, &rc);
1960  trace("WM_GETMINMAXINFO: parent %p client size = (%d x %d)\n", parent, rc.right, rc.bottom);
1961 
1962  GetClientRect(parent, &rc);
1963  if ((style & WS_CAPTION) == WS_CAPTION)
1964  style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
1965  AdjustWindowRectEx(&rc, style, 0, exstyle);
1966  dump_minmax_info( minmax );
1967 
1968  ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
1969  minmax->ptMaxSize.x, rc.right - rc.left);
1970  ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
1971  minmax->ptMaxSize.y, rc.bottom - rc.top);
1972  break;
1973  }
1974 
1975  case WM_WINDOWPOSCHANGED:
1976  {
1977  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
1978  RECT rc1, rc2;
1979 
1980  GetWindowRect(hwnd, &rc1);
1981  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
1982  /* note: winpos coordinates are relative to parent */
1984  ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s pos=%s\n",
1986  GetWindowRect(hwnd, &rc1);
1987  GetClientRect(hwnd, &rc2);
1989  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
1990  ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s client=%s\n",
1992  }
1993  /* fall through */
1994  case WM_WINDOWPOSCHANGING:
1995  {
1996  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
1997  WINDOWPOS my_winpos = *winpos;
1998 
1999  trace("%s: %p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2000  (msg == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED",
2001  winpos->hwnd, winpos->hwndInsertAfter,
2002  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2003 
2005 
2006  ok(!memcmp(&my_winpos, winpos, sizeof(WINDOWPOS)),
2007  "DefWindowProc should not change WINDOWPOS: %p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2008  winpos->hwnd, winpos->hwndInsertAfter,
2009  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2010 
2011  return 1;
2012  }
2013  }
2014  return DefWindowProcA(hwnd, msg, wparam, lparam);
2015 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
long y
Definition: polytest.cpp:48
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
POINT ptMaxSize
Definition: winuser.h:3604
long x
Definition: polytest.cpp:48
#define WM_NCCALCSIZE
Definition: winuser.h:1668
LONG top
Definition: windef.h:307
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
HWND hwndInsertAfter
Definition: winuser.h:3565
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define GWL_EXSTYLE
Definition: winuser.h:845
static void dump_minmax_info(const MINMAXINFO *minmax)
Definition: win.c:73
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define WM_NCCREATE
Definition: winuser.h:1666
uint32_t cs
Definition: isohybrid.c:75
#define WS_EX_MDICHILD
Definition: winuser.h:394
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
long LONG
Definition: pedump.c:60
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
static char mdi_lParam_test_message[]
Definition: win.c:1366
#define CW_USEDEFAULT
Definition: winuser.h:225
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3570
#define WS_CAPTION
Definition: pedump.c:624
#define trace
Definition: atltest.h:70
r parent
Definition: btrfs.c:2944
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1644
const char * wine_dbgstr_rect(const RECT *rect)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define WS_BORDER
Definition: pedump.c:625
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define ok(value,...)
Definition: atltest.h:57
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1645
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1591
LONG bottom
Definition: windef.h:309
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static const WCHAR rc2[]
Definition: oid.c:1216
HWND hwnd
Definition: winuser.h:3564
Arabic default style
Definition: afstyles.h:93
#define WM_GETMINMAXINFO
Definition: winuser.h:1623
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by mdi_RegisterWindowClasses().

◆ MDI_ChildGetMinMaxInfo()

static void MDI_ChildGetMinMaxInfo ( HWND  client,
HWND  hwnd,
MINMAXINFO lpMinMax 
)
static

Definition at line 1789 of file win.c.

1790 {
1791  RECT rect;
1792 
1793  GetClientRect( client, &rect );
1796 
1797  rect.right -= rect.left;
1798  rect.bottom -= rect.top;
1799  lpMinMax->ptMaxSize.x = rect.right;
1800  lpMinMax->ptMaxSize.y = rect.bottom;
1801 
1802  lpMinMax->ptMaxPosition.x = rect.left;
1803  lpMinMax->ptMaxPosition.y = rect.top;
1804 
1805  trace("max rect %s\n", wine_dbgstr_rect(&rect));
1806 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
POINT ptMaxSize
Definition: winuser.h:3604
long x
Definition: polytest.cpp:48
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define GWL_EXSTYLE
Definition: winuser.h:845
& rect
Definition: startmenu.cpp:1413
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define trace
Definition: atltest.h:70
const char * wine_dbgstr_rect(const RECT *rect)
static FILE * client
Definition: client.c:41
POINT ptMaxPosition
Definition: winuser.h:3605
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

Referenced by mdi_child_wnd_proc_1().

◆ mdi_main_wnd_procA()

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

Definition at line 2017 of file win.c.

2018 {
2019  static HWND mdi_client;
2020 
2021  switch (msg)
2022  {
2023  case WM_CREATE:
2024  return 1;
2025 
2026  case WM_WINDOWPOSCHANGED:
2027  {
2028  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
2029  RECT rc1, rc2;
2030 
2031  GetWindowRect(hwnd, &rc1);
2032  trace("window: %s\n", wine_dbgstr_rect(&rc1));
2033  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
2034  /* note: winpos coordinates are relative to parent */
2036  trace("pos: %s\n", wine_dbgstr_rect(&rc2));
2037  ok(EqualRect(&rc1, &rc2), "rects do not match\n");
2038 
2039  GetWindowRect(hwnd, &rc1);
2040  GetClientRect(hwnd, &rc2);
2042  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
2043  ok(EqualRect(&rc1, &rc2), "rects do not match\n");
2044  }
2045  /* fall through */
2046  case WM_WINDOWPOSCHANGING:
2047  {
2048  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
2049  WINDOWPOS my_winpos = *winpos;
2050 
2051  trace("%s\n", (msg == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
2052  trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2053  winpos->hwnd, winpos->hwndInsertAfter,
2054  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2055 
2057 
2058  trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2059  winpos->hwnd, winpos->hwndInsertAfter,
2060  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2061 
2062  ok(!memcmp(&my_winpos, winpos, sizeof(WINDOWPOS)),
2063  "DefWindowProc should not change WINDOWPOS values\n");
2064 
2065  return 1;
2066  }
2067 
2068  case WM_CLOSE:
2069  PostQuitMessage(0);
2070  break;
2071  }
2073 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WM_NCCALCSIZE
Definition: winuser.h:1668
LRESULT WINAPI DefFrameProcA(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndInsertAfter
Definition: winuser.h:3565
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3570
#define trace
Definition: atltest.h:70
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1644
#define WM_CLOSE
Definition: winuser.h:1604
const char * wine_dbgstr_rect(const RECT *rect)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static HWND mdi_client
Definition: msg.c:3638
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define ok(value,...)
Definition: atltest.h:57
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1645
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1591
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static const WCHAR rc2[]
Definition: oid.c:1216
HWND hwnd
Definition: winuser.h:3564
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by mdi_RegisterWindowClasses().

◆ mdi_RegisterWindowClasses()

static BOOL mdi_RegisterWindowClasses ( void  )
static

Definition at line 2075 of file win.c.

2076 {
2077  WNDCLASSA cls;
2078 
2079  cls.style = 0;
2081  cls.cbClsExtra = 0;
2082  cls.cbWndExtra = 0;
2083  cls.hInstance = GetModuleHandleA(0);
2084  cls.hIcon = 0;
2085  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
2087  cls.lpszMenuName = NULL;
2088  cls.lpszClassName = "MDI_parent_Class";
2089  if(!RegisterClassA(&cls)) return FALSE;
2090 
2092  cls.lpszClassName = "MDI_child_Class_1";
2093  if(!RegisterClassA(&cls)) return FALSE;
2094 
2096  cls.lpszClassName = "MDI_child_Class_2";
2097  if(!RegisterClassA(&cls)) return FALSE;
2098 
2099  return TRUE;
2100 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRUE
Definition: types.h:120
int cbClsExtra
Definition: winuser.h:3141
LPCSTR lpszMenuName
Definition: winuser.h:3147
#define WHITE_BRUSH
Definition: wingdi.h:902
HBRUSH hbrBackground
Definition: winuser.h:3146
int cbWndExtra
Definition: winuser.h:3142
#define FALSE
Definition: types.h:117
HCURSOR hCursor
Definition: winuser.h:3145
const char * LPCSTR
Definition: xmlstorage.h:183
static LRESULT WINAPI mdi_child_wnd_proc_1(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:1808
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
LPCSTR lpszClassName
Definition: winuser.h:3148
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3139
HINSTANCE hInstance
Definition: winuser.h:3143
#define NULL
Definition: types.h:112
static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:1917
WNDPROC lpfnWndProc
Definition: winuser.h:3140
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:2017
HICON hIcon
Definition: winuser.h:3144

Referenced by test_mdi().

◆ minmax_wnd_proc()

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

Definition at line 5793 of file win.c.

5794 {
5795  MINMAXINFO *minmax;
5796 
5797  if (msg != WM_GETMINMAXINFO)
5798  return DefWindowProcA(hwnd, msg, wp, lp);
5799 
5800  minmax = (MINMAXINFO *)lp;
5801 
5803  {
5804  minmax->ptReserved.x = 0;
5805  minmax->ptReserved.y = 0;
5806  minmax->ptMaxSize.x = 400;
5807  minmax->ptMaxSize.y = 400;
5808  minmax->ptMaxPosition.x = 300;
5809  minmax->ptMaxPosition.y = 300;
5810  minmax->ptMaxTrackSize.x = 200;
5811  minmax->ptMaxTrackSize.y = 200;
5812  minmax->ptMinTrackSize.x = 100;
5813  minmax->ptMinTrackSize.y = 100;
5814  }
5815  else
5816  DefWindowProcA(hwnd, msg, wp, lp);
5817  return 1;
5818 }
POINT ptMinTrackSize
Definition: winuser.h:3606
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3603
POINT ptMaxSize
Definition: winuser.h:3604
long x
Definition: polytest.cpp:48
#define WS_CHILD
Definition: pedump.c:617
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
POINT ptMaxPosition
Definition: winuser.h:3605
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:846
#define msg(x)
Definition: auth_time.c:54
POINT ptMaxTrackSize
Definition: winuser.h:3607
#define WM_GETMINMAXINFO
Definition: winuser.h:1623

Referenced by test_CreateWindow().

◆ my_httrasparent_proc()

static LRESULT WINAPI my_httrasparent_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 8077 of file win.c.

8078 {
8079  if (msg == WM_NCHITTEST) return HTTRANSPARENT;
8080  return DefWindowProcA(hwnd, msg, wp, lp);
8081 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HTTRANSPARENT
Definition: winuser.h:2449
#define WM_NCHITTEST
Definition: winuser.h:1669
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54

Referenced by test_child_window_from_point().

◆ my_window_proc()

static LRESULT WINAPI my_window_proc ( HWND  hwnd,
UINT  msg,
WPARAM  wp,
LPARAM  lp 
)
static

Definition at line 8083 of file win.c.

8084 {
8085  return DefWindowProcA(hwnd, msg, wp, lp);
8086 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54

Referenced by test_child_window_from_point().

◆ nccalchelper()

static void nccalchelper ( HWND  hwnd,
INT  x,
INT  y,
RECT prc 
)
static

Definition at line 3921 of file win.c.

3922 {
3923  RECT rc;
3924  MoveWindow( hwnd, 0, 0, x, y, 0);
3925  GetWindowRect( hwnd, prc);
3926  rc = *prc;
3928  trace("window rect is %s, nccalc rect is %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(prc));
3929 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define WM_NCCALCSIZE
Definition: winuser.h:1668
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG_PTR LPARAM
Definition: windef.h:208
#define trace
Definition: atltest.h:70
const char * wine_dbgstr_rect(const RECT *rect)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
_Out_ LPRECT prc
Definition: ntgdi.h:1658

Referenced by test_nccalcscroll().

◆ nccalcsize_proc()