ReactOS  0.4.13-dev-479-gec9c8fd
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 158 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:2790
static unsigned __int64 next
Definition: rand_nt.c:6

Definition at line 2786 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:1059
#define ok(value,...)
#define broken(x)
Definition: _sntprintf.h:21

◆ 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:1059
#define SetLastError(x)
Definition: compat.h:409
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 7602 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
#define ok(value,...)
GLfloat f
Definition: glext.h:7540

Definition at line 5478 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:5493
int main(int argc, char *argv[])
Definition: atactl.cpp:1685
GLdouble GLdouble t
Definition: gl.h:2047

Definition at line 5498 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:5483
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 5487 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:155
GLfloat f
Definition: glext.h:7540

Definition at line 5483 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:5487
static FILE * client
Definition: client.c:41
static LRESULT paint(HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
Definition: theme_combo.c:154

Definition at line 5493 of file win.c.

◆ SET_FOREGROUND_INJECT

#define SET_FOREGROUND_INJECT   0x10

Definition at line 9004 of file win.c.

◆ SET_FOREGROUND_SET_1

#define SET_FOREGROUND_SET_1   0x02

Definition at line 9001 of file win.c.

◆ SET_FOREGROUND_SET_2

#define SET_FOREGROUND_SET_2   0x08

Definition at line 9003 of file win.c.

◆ SET_FOREGROUND_STEAL_1

#define SET_FOREGROUND_STEAL_1   0x01

Definition at line 9000 of file win.c.

◆ SET_FOREGROUND_STEAL_2

#define SET_FOREGROUND_STEAL_2   0x04

Definition at line 9002 of file win.c.

◆ SHOWSYSMETRIC

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

Definition at line 5336 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
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MAKELRESULT(l, h)
Definition: winuser.h:3917
UINT_PTR WPARAM
Definition: windef.h:207
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_MOUSEACTIVATE
Definition: winuser.h:1619
Definition: ttei1.cpp:12
#define B(row, col)
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 5255 of file win.c.

5256 {
5257  WNDCLASSA class;
5258 
5259  class.style = CS_HREDRAW | CS_VREDRAW;
5260  class.lpfnWndProc = DefWindowProcA;
5261  class.cbClsExtra = 0;
5262  class.cbWndExtra = 0;
5263  class.hInstance = 0;
5264  class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION);
5265  class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
5266  class.hbrBackground = 0;
5267  class.lpszMenuName = 0;
5268  class.lpszClassName = szAWRClass;
5269 
5270  if (!RegisterClassA(&class)) {
5271  ok(FALSE, "RegisterClass failed\n");
5272  return FALSE;
5273  }
5274 
5275  hmenu = CreateMenu();
5276  if (!hmenu)
5277  return FALSE;
5278  ok(hmenu != 0, "Failed to create menu\n");
5279  ok(AppendMenuA(hmenu, MF_STRING, 1, "Test!"), "Failed to create menu item\n");
5280 
5281  return TRUE;
5282 }
HMENU WINAPI CreateMenu(void)
Definition: menu.c:837
#define TRUE
Definition: types.h:120
static HMENU hmenu
Definition: win.c:66
#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 ok(value,...)
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:3116
#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 3284 of file win.c.

3285 {
3286  LRESULT ret;
3287  USHORT key_state;
3288 
3289  key_state = GetKeyState(VK_LBUTTON);
3290  ok(!(key_state & 0x8000), "VK_LBUTTON should not be pressed, state %04x\n", key_state);
3291 
3293 
3294  if (msg == WM_LBUTTONDOWN)
3295  {
3296  HWND hwnd, capture;
3297 
3298  check_wnd_state(button, button, button, button);
3299 
3300  hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
3301  assert(hwnd);
3302  trace("hwnd %p\n", hwnd);
3303 
3304  check_wnd_state(button, button, button, button);
3305 
3307 
3308  check_wnd_state(button, button, button, button);
3309 
3311 
3312  hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
3313  assert(hwnd);
3314  trace("hwnd %p\n", hwnd);
3315 
3316  check_wnd_state(button, button, button, button);
3317 
3318  /* button wnd proc should release capture on WM_KILLFOCUS if it does
3319  * match internal button state.
3320  */
3321  SendMessageA(button, WM_KILLFOCUS, 0, 0);
3322  check_wnd_state(button, button, button, 0);
3323 
3325  check_wnd_state(hwnd, hwnd, hwnd, 0);
3326 
3327  capture = SetCapture(hwnd);
3328  ok(capture == 0, "SetCapture() = %p\n", capture);
3329 
3331 
3333 
3334  check_wnd_state(button, 0, button, 0);
3335  }
3336 
3337  return ret;
3338 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define trace(...)
Definition: kmt_test.h:217
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define VK_LBUTTON
Definition: winuser.h:2144
#define check_wnd_state(a, b, c, d)
Definition: win.c:143
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#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 ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
SHORT WINAPI GetKeyState(_In_ int)
#define WM_KILLFOCUS
Definition: winuser.h:1596
int ret
HWND WINAPI SetCapture(_In_ HWND hWnd)
unsigned short USHORT
Definition: pedump.c:61
#define WS_POPUP
Definition: pedump.c:616
#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:3282
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 1113 of file win.c.

1114 {
1115  static const char *CBT_code_name[10] = {
1116  "HCBT_MOVESIZE",
1117  "HCBT_MINMAX",
1118  "HCBT_QS",
1119  "HCBT_CREATEWND",
1120  "HCBT_DESTROYWND",
1121  "HCBT_ACTIVATE",
1122  "HCBT_CLICKSKIPPED",
1123  "HCBT_KEYSKIPPED",
1124  "HCBT_SYSCOMMAND",
1125  "HCBT_SETFOCUS" };
1126  const char *code_name = (nCode >= 0 && nCode <= HCBT_SETFOCUS) ? CBT_code_name[nCode] : "Unknown";
1127  HWND hwnd = (HWND)wParam;
1128 
1129  switch (nCode)
1130  {
1131  case HCBT_CREATEWND:
1132  {
1133  static const RECT rc_null;
1134  RECT rc;
1135  LONG style;
1136  CBT_CREATEWNDA *createwnd = (CBT_CREATEWNDA *)lParam;
1137  ok(createwnd->hwndInsertAfter == HWND_TOP, "hwndInsertAfter should be always HWND_TOP\n");
1138 
1139  if (pGetWindowInfo)
1140  {
1141  WINDOWINFO info;
1142  info.cbSize = sizeof(WINDOWINFO);
1143  ok(pGetWindowInfo(hwnd, &info), "GetWindowInfo should not fail\n");
1144  verify_window_info(code_name, hwnd, &info);
1145  }
1146 
1147  /* WS_VISIBLE should be turned off yet */
1148  style = createwnd->lpcs->style & ~WS_VISIBLE;
1150  "style of hwnd and style in the CREATESTRUCT do not match: %08x != %08x\n",
1152 
1153  if (0)
1154  {
1155  /* Uncomment this once the test succeeds in all cases */
1156  if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
1157  {
1159  "wrong result from GetParent %p: message window %p\n",
1161  }
1162  else
1163  ok(!GetParent(hwnd), "GetParent should return 0 at this point\n");
1164 
1165  ok(!GetWindow(hwnd, GW_OWNER), "GW_OWNER should be set to 0 at this point\n");
1166  }
1167  if (0)
1168  {
1169  /* while NT assigns GW_HWNDFIRST/LAST some values at this point,
1170  * Win9x still has them set to 0.
1171  */
1172  ok(GetWindow(hwnd, GW_HWNDFIRST) != 0, "GW_HWNDFIRST should not be set to 0 at this point\n");
1173  ok(GetWindow(hwnd, GW_HWNDLAST) != 0, "GW_HWNDLAST should not be set to 0 at this point\n");
1174  }
1175  ok(!GetWindow(hwnd, GW_HWNDPREV), "GW_HWNDPREV should be set to 0 at this point\n");
1176  ok(!GetWindow(hwnd, GW_HWNDNEXT), "GW_HWNDNEXT should be set to 0 at this point\n");
1177 
1178  if (0)
1179  {
1180  /* Uncomment this once the test succeeds in all cases */
1181  if (pGetAncestor)
1182  {
1183  ok(pGetAncestor(hwnd, GA_PARENT) == hwndMessage, "GA_PARENT should be set to hwndMessage at this point\n");
1184  ok(pGetAncestor(hwnd, GA_ROOT) == hwnd,
1185  "GA_ROOT is set to %p, expected %p\n", pGetAncestor(hwnd, GA_ROOT), hwnd);
1186 
1187  if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD)
1188  ok(pGetAncestor(hwnd, GA_ROOTOWNER) == hwndMessage,
1189  "GA_ROOTOWNER should be set to hwndMessage at this point\n");
1190  else
1191  ok(pGetAncestor(hwnd, GA_ROOTOWNER) == hwnd,
1192  "GA_ROOTOWNER is set to %p, expected %p\n", pGetAncestor(hwnd, GA_ROOTOWNER), hwnd);
1193  }
1194 
1195  ok(GetWindowRect(hwnd, &rc), "GetWindowRect failed\n");
1196  ok(EqualRect(&rc, &rc_null), "window rect should be set to 0 HCBT_CREATEWND\n");
1197  ok(GetClientRect(hwnd, &rc), "GetClientRect failed\n");
1198  ok(EqualRect(&rc, &rc_null), "client rect should be set to 0 on HCBT_CREATEWND\n");
1199  }
1200  break;
1201  }
1202  case HCBT_MOVESIZE:
1203  case HCBT_MINMAX:
1204  case HCBT_ACTIVATE:
1205  if (pGetWindowInfo && IsWindow(hwnd))
1206  {
1207  WINDOWINFO info;
1208 
1209  /* Win98 actually does check the info.cbSize and doesn't allow
1210  * it to be anything except sizeof(WINDOWINFO), while Win95, Win2k,
1211  * WinXP do not check it at all.
1212  */
1213  info.cbSize = sizeof(WINDOWINFO);
1214  ok(pGetWindowInfo(hwnd, &info), "GetWindowInfo should not fail\n");
1215  verify_window_info(code_name, hwnd, &info);
1216  }
1217  break;
1218  /* window state is undefined */
1219  case HCBT_SETFOCUS:
1220  case HCBT_DESTROYWND:
1221  break;
1222  default:
1223  break;
1224  }
1225 
1226  return CallNextHookEx(hhook, nCode, wParam, lParam);
1227 }
#define GW_HWNDNEXT
Definition: winuser.h:756
#define GA_ROOT
Definition: winuser.h:2743
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LPCREATESTRUCTA lpcs
Definition: winuser.h:2923
#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:2744
WPARAM wParam
Definition: combotst.c:138
struct _test_info info[]
Definition: SetCursorPos.c:19
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:2742
#define ok(value,...)
static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *info)
Definition: win.c:941
static HWND hwndMessage
Definition: win.c:60
#define GW_HWNDLAST
Definition: winuser.h:760
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)
HWND hwndInsertAfter
Definition: winuser.h:2924
#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 159 of file win.c.

161 {
162  ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow());
163  /* only check foreground if it belongs to the current thread */
164  /* foreground can be moved to a different app pretty much at any time */
165  if (foreground && GetForegroundWindow() &&
167  ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow());
168  ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus());
169 }
#define ok_(x1, x2)
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:420
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
HWND WINAPI GetFocus(void)
Definition: window.c:1875
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
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 4463 of file win.c.

4464 {
4465  struct
4466  {
4467  DLGTEMPLATE dt;
4468  WORD menu_name;
4469  WORD class_id;
4470  WORD class_atom;
4471  WCHAR caption[1];
4472  } dlg_data;
4473  DWORD style, ex_style;
4474  HWND hwnd, grand_parent = 0, parent = 0;
4475  struct dialog_param param;
4476  LRESULT id, ret;
4477 
4478  if (style_in & WS_CHILD)
4479  {
4481  0, 0, 0, 0, NULL, NULL, NULL, NULL);
4482  ok(grand_parent != 0, "grand_parent creation failed\n");
4483  }
4484 
4485  parent = CreateWindowExA(0, "static", NULL, style_in,
4486  0, 0, 0, 0, grand_parent, NULL, NULL, NULL);
4487  ok(parent != 0, "parent creation failed, style %#x\n", style_in);
4488 
4489  dlg_data.dt.style = style_in;
4490  dlg_data.dt.dwExtendedStyle = ex_style_in;
4491  dlg_data.dt.cdit = 0;
4492  dlg_data.dt.x = 0;
4493  dlg_data.dt.y = 0;
4494  dlg_data.dt.cx = 100;
4495  dlg_data.dt.cy = 100;
4496  dlg_data.menu_name = 0;
4497  dlg_data.class_id = 0;
4498  dlg_data.class_atom = 0;
4499  dlg_data.caption[0] = 0;
4500 
4502  ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in);
4503 
4504  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4505  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4506  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x1111, 0);
4507  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4508  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4509  ok(id == MAKELONG(0x1111,DC_HASDEFID), "expected (0x1111,DC_HASDEFID), got %08lx\n", id);
4510 
4511  flush_events( TRUE );
4512 
4514  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4515  ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
4516  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4517 
4518  ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
4519 
4520  /* try setting the styles explicitly */
4521  SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in);
4523  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4524  ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
4525  /* WS_EX_WINDOWEDGE can't always be changed */
4526  if (ex_style_in & WS_EX_DLGMODALFRAME)
4527  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4528  else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE))
4529  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4530  else
4531  ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
4532  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4533 
4534  SetWindowLongA(hwnd, GWL_STYLE, style_in);
4536  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4537  /* WS_CLIPSIBLINGS can't be reset on top-level windows */
4538  if ((style_in & (WS_CHILD | WS_POPUP)) == WS_CHILD) style_out = style_in;
4539  else style_out = style_in | WS_CLIPSIBLINGS;
4540  ok(style == style_out, "expected style %#x, got %#x\n", style_out, style);
4541  /* WS_EX_WINDOWEDGE can't always be changed */
4542  if (ex_style_in & WS_EX_DLGMODALFRAME)
4543  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4544  else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE))
4545  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4546  else
4547  ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
4548  /* FIXME: Remove the condition below once Wine is fixed */
4549  todo_wine_if (ex_style != ex_style_out)
4550  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4551 
4553 
4554  param.parent = parent;
4555  param.grand_parent = grand_parent;
4556  param.dlg_data = &dlg_data.dt;
4558 
4559  ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
4560  if (grand_parent)
4561  ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in);
4562 
4565 }
#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 IDOK
Definition: winuser.h:824
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD style
Definition: winuser.h:3012
#define WS_DLGFRAME
Definition: pedump.c:626
#define DM_SETDEFID
Definition: winuser.h:2060
#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:2059
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define DC_HASDEFID
Definition: winuser.h:2563
#define ok(value,...)
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
#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:3013
#define todo_wine_if(is_todo)
Definition: test.h:155
r parent
Definition: btrfs.c:2708
__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:4331
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:4376
INT_PTR WINAPI DialogBoxIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
int ret
short x
Definition: winuser.h:3015
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
short y
Definition: winuser.h:3016
WORD cdit
Definition: winuser.h:3014
#define GWL_STYLE
Definition: winuser.h:846
#define DS_3DLOOK
Definition: winuser.h:367
#define WS_POPUP
Definition: pedump.c:616
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
short cy
Definition: winuser.h:3018
DLGTEMPLATE * dlg_data
Definition: win.c:4377
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:3017
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:4380

Referenced by test_dialog_styles().

◆ check_error()

static int check_error ( DWORD  actual,
DWORD  expected 
)
static

Definition at line 6291 of file win.c.

6292 {
6293  static int sets_last_error = -1;
6294  if (sets_last_error == -1)
6295  sets_last_error = (actual != 0xdeadbeef);
6296  return (!sets_last_error && (actual == 0xdeadbeef)) || (actual == expected);
6297 }
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:2743
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GA_ROOTOWNER
Definition: winuser.h:2744
#define GA_PARENT
Definition: winuser.h:2742
#define ok(value,...)
#define GetWindowLongPtrA
Definition: winuser.h:4697
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
HWND WINAPI GetParent(_In_ HWND)
#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 6342 of file win.c.

6343 {
6345  const STYLESTRUCT *got = (STYLESTRUCT *)lParam;
6346 
6347  if (message == WM_STYLECHANGING && wParam == GWL_STYLE)
6348  {
6349  ok(got->styleOld == expected[0].styleOld, "expected old style %#x, got %#x\n",
6350  expected[0].styleOld, got->styleOld);
6351  ok(got->styleNew == expected[0].styleNew, "expected new style %#x, got %#x\n",
6352  expected[0].styleNew, got->styleNew);
6353  }
6354  else if (message == WM_STYLECHANGED && wParam == GWL_STYLE)
6355  {
6356  ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n",
6357  expected[1].styleOld, got->styleOld);
6358  ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n",
6359  expected[1].styleNew, got->styleNew);
6360  }
6361 
6363 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
WPARAM wParam
Definition: combotst.c:138
#define ok(value,...)
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtrA
Definition: winuser.h:4697
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:846
DWORD styleNew
Definition: winuser.h:3635
DWORD styleOld
Definition: winuser.h:3634
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 4199 of file win.c.

4200 {
4201  DWORD dwActualStyle;
4202  DWORD dwActualExStyle;
4203  STYLESTRUCT ss;
4204  HWND hwnd;
4205  HWND hwndParent = NULL;
4206 
4207  ss.styleNew = dwStyleIn;
4208  ss.styleOld = dwExStyleIn;
4209 
4210  if (dwStyleIn & WS_CHILD)
4211  {
4213  WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
4214  }
4215 
4217  dwStyleIn, 0, 0, 0, 0, hwndParent, NULL, NULL, &ss);
4218  assert(hwnd);
4219 
4220  flush_events( TRUE );
4221 
4222  dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
4223  dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4224  ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
4225  ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
4226 
4227  /* try setting the styles explicitly */
4228  SetWindowLongA( hwnd, GWL_EXSTYLE, dwExStyleIn );
4229  dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
4230  dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4231  /* WS_EX_WINDOWEDGE can't always be changed */
4232  if (dwExStyleIn & WS_EX_DLGMODALFRAME)
4233  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4234  else if ((dwActualStyle & (WS_DLGFRAME | WS_THICKFRAME)) && !(dwExStyleIn & WS_EX_STATICEDGE))
4235  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4236  else
4237  dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
4238  ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
4239  ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
4240 
4241  SetWindowLongA( hwnd, GWL_STYLE, dwStyleIn );
4242  dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE);
4243  dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
4244  /* WS_CLIPSIBLINGS can't be reset on top-level windows */
4245  if ((dwStyleIn & (WS_CHILD|WS_POPUP)) == WS_CHILD) dwStyleOut = dwStyleIn;
4246  else dwStyleOut = dwStyleIn | WS_CLIPSIBLINGS;
4247  /* WS_EX_WINDOWEDGE can't always be changed */
4248  if (dwExStyleIn & WS_EX_DLGMODALFRAME)
4249  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4250  else if ((dwActualStyle & (WS_DLGFRAME | WS_THICKFRAME)) && !(dwExStyleIn & WS_EX_STATICEDGE))
4251  dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE;
4252  else
4253  dwExStyleOut = dwExStyleIn & ~WS_EX_WINDOWEDGE;
4254  ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle);
4255  /* FIXME: Remove the condition below once Wine is fixed */
4256  todo_wine_if (dwActualExStyle != dwExStyleOut)
4257  ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle);
4258 
4261 }
#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:4177
#define WS_CHILD
Definition: pedump.c:617
BOOL WINAPI DestroyWindow(_In_ HWND)
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#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:155
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GWL_STYLE
Definition: winuser.h:846
#define WS_POPUP
Definition: pedump.c:616
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:432
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:1416

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() &&
152  ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow());
153  ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus());
154  ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture());
155 }
#define ok_(x1, x2)
HWND WINAPI GetCapture(void)
Definition: message.c:2879
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:420
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
HWND WINAPI GetFocus(void)
Definition: window.c:1875
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
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 2790 of file win.c.

2792 {
2793  HWND test;
2794  DWORD ex_style;
2795 
2797  /* skip foreign windows */
2798  while (test && test != next &&
2801  GetWindow(test, GW_OWNER) == next))
2802  {
2803  /*trace("skipping next %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
2805  }
2806  ok_(file, line)(next == test, "%p: expected next %p, got %p\n", hwnd, next, test);
2807 
2809  /* skip foreign windows */
2810  while (test && test != prev &&
2813  GetWindow(test, GW_OWNER) == hwnd))
2814  {
2815  /*trace("skipping prev %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
2817  }
2818  ok_(file, line)(prev == test, "%p: expected prev %p, got %p\n", hwnd, prev, test);
2819 
2821  ok_(file, line)(owner == test, "%p: expected owner %p, got %p\n", hwnd, owner, test);
2822 
2823  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
2824  ok_(file, line)(!(ex_style & WS_EX_TOPMOST) == !topmost, "%p: expected %stopmost\n",
2825  hwnd, topmost ? "" : "NOT ");
2826 }
#define GW_HWNDNEXT
Definition: winuser.h:756
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define ok_(x1, x2)
#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)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define GetWindowLongPtrA
Definition: winuser.h:4697
#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:819
#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 GW_OWNER
Definition: winuser.h:761
#define GWLP_HINSTANCE
Definition: winuser.h:850
#define GW_HWNDPREV
Definition: winuser.h:757
Definition: fci.c:126

◆ create_tool_window()

static HWND create_tool_window ( LONG  style,
HWND  parent 
)
static

Definition at line 199 of file win.c.

200 {
201  HWND ret = CreateWindowExA(0, "ToolWindowClass", "Tool window 1", style,
202  0, 0, 100, 100, parent, 0, 0, NULL );
203  ok( ret != 0, "Creation failed\n" );
204  return ret;
205 }
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
r parent
Definition: btrfs.c:2708
int ret
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 3139 of file win.c.

3140 {
3142  DWORD res;
3143  BOOL ret;
3144 
3145  p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
3146 
3147  ret = SetEvent(p->window_created);
3148  ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
3149 
3150  res = WaitForSingleObject(p->test_finished, INFINITE);
3151  ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
3152 
3153  DestroyWindow(p->window);
3154  return 0;
3155 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
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 ok(value,...)
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
smooth NULL
Definition: ftsmooth.c:416
#define WAIT_OBJECT_0
Definition: winbase.h:387
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define WS_POPUP
Definition: pedump.c:616
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 8081 of file win.c.

8082 {
8083  static const DWORD style[] = { 0, WS_VISIBLE, WS_DISABLED, WS_VISIBLE | WS_DISABLED };
8084  int i, pos;
8085 
8086  memset(window, 0, size * sizeof(window[0]));
8087 
8088  pos = 0;
8089  for (i = 0; i < sizeof(style)/sizeof(style[0]); i++)
8090  {
8091  assert(pos < size);
8092  window[pos] = CreateWindowExA(0, "my_window", NULL, style[i] | WS_CHILD,
8093  0, 0, 100, 100, parent, 0, 0, NULL);
8094  ok(window[pos] != 0, "CreateWindowEx failed\n");
8095  pos++;
8096  assert(pos < size);
8098  0, 0, 100, 100, parent, 0, 0, NULL);
8099  ok(window[pos] != 0, "CreateWindowEx failed\n");
8100  pos++;
8101 
8102  assert(pos < size);
8103  window[pos] = CreateWindowExA(0, "my_httrasparent", NULL, style[i] | WS_CHILD,
8104  0, 0, 100, 100, parent, 0, 0, NULL);
8105  ok(window[pos] != 0, "CreateWindowEx failed\n");
8106  pos++;
8107  assert(pos < size);
8108  window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "my_httrasparent", NULL, style[i] | WS_CHILD,
8109  0, 0, 100, 100, parent, 0, 0, NULL);
8110  ok(window[pos] != 0, "CreateWindowEx failed\n");
8111  pos++;
8112 
8113  assert(pos < size);
8114  window[pos] = CreateWindowExA(0, "my_button", NULL, style[i] | WS_CHILD | BS_GROUPBOX,
8115  0, 0, 100, 100, parent, 0, 0, NULL);
8116  ok(window[pos] != 0, "CreateWindowEx failed\n");
8117  pos++;
8118  assert(pos < size);
8120  0, 0, 100, 100, parent, 0, 0, NULL);
8121  ok(window[pos] != 0, "CreateWindowEx failed\n");
8122  pos++;
8123  assert(pos < size);
8124  window[pos] = CreateWindowExA(0, "my_button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON,
8125  0, 0, 100, 100, parent, 0, 0, NULL);
8126  ok(window[pos] != 0, "CreateWindowEx failed\n");
8127  pos++;
8128  assert(pos < size);
8130  0, 0, 100, 100, parent, 0, 0, NULL);
8131  ok(window[pos] != 0, "CreateWindowEx failed\n");
8132  pos++;
8133 
8134  assert(pos < size);
8135  window[pos] = CreateWindowExA(0, "Button", NULL, style[i] | WS_CHILD | BS_GROUPBOX,
8136  0, 0, 100, 100, parent, 0, 0, NULL);
8137  ok(window[pos] != 0, "CreateWindowEx failed\n");
8138  pos++;
8139  assert(pos < size);
8141  0, 0, 100, 100, parent, 0, 0, NULL);
8142  ok(window[pos] != 0, "CreateWindowEx failed\n");
8143  pos++;
8144  assert(pos < size);
8145  window[pos] = CreateWindowExA(0, "Button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON,
8146  0, 0, 100, 100, parent, 0, 0, NULL);
8147  ok(window[pos] != 0, "CreateWindowEx failed\n");
8148  pos++;
8149  assert(pos < size);
8151  0, 0, 100, 100, parent, 0, 0, NULL);
8152  ok(window[pos] != 0, "CreateWindowEx failed\n");
8153  pos++;
8154 
8155  assert(pos < size);
8156  window[pos] = CreateWindowExA(0, "Static", NULL, style[i] | WS_CHILD,
8157  0, 0, 100, 100, parent, 0, 0, NULL);
8158  ok(window[pos] != 0, "CreateWindowEx failed\n");
8159  pos++;
8160  assert(pos < size);
8162  0, 0, 100, 100, parent, 0, 0, NULL);
8163  ok(window[pos] != 0, "CreateWindowEx failed\n");
8164  pos++;
8165  }
8166 }
#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
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,...)
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
r parent
Definition: btrfs.c:2708
unsigned long DWORD
Definition: ntddk_ex.h:95
static IHTMLWindow2 * window
Definition: events.c:77
#define BS_PUSHBUTTON
Definition: pedump.c:651
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 5657 of file win.c.

5658 {
5659  return DefWindowProcA(hwnd, msg, wparam, lparam);
5660 }
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 5662 of file win.c.

5663 {
5664  return DefWindowProcW(hwnd, msg, wparam, lparam);
5665 }
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 4728 of file win.c.

4729 {
4730  if (msg == WM_ENTERIDLE) {
4731  HWND dialog = (HWND)lparam;
4733  }
4734  return DefWindowProcA( hwnd, msg, wparam, lparam );
4735 }
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:1725
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:3572
#define trace(...)
Definition: kmt_test.h:217
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3569
POINT ptMaxSize
Definition: winuser.h:3570
long x
Definition: polytest.cpp:48
POINT ptMaxPosition
Definition: winuser.h:3571
POINT ptMaxTrackSize
Definition: winuser.h:3573

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

7592 {
7593  DWORD i, size;
7594  RGNDATA *data = NULL;
7595  RECT *rect;
7596 
7597  if (!hrgn)
7598  {
7599  printf( "null region\n" );
7600  return;
7601  }
7602  if (!(size = GetRegionData( hrgn, 0, NULL ))) return;
7603  if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return;
7604  GetRegionData( hrgn, size, data );
7605  printf("%d rects:", data->rdh.nCount );
7606  for (i = 0, rect = (RECT *)data->Buffer; i < data->rdh.nCount; i++, rect++)
7607  printf( " %s", wine_dbgstr_rect( rect ));
7608  printf("\n");
7609  HeapFree( GetProcessHeap(), 0, data );
7610 }
& rect
Definition: startmenu.cpp:1413
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
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
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
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:394
#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 4331 of file win.c.

4332 {
4333  return 0;
4334 }

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 4380 of file win.c.

4381 {
4382  if (msg == WM_INITDIALOG)
4383  {
4385  struct dialog_param *param = (struct dialog_param *)lparam;
4386  BOOL parent_is_child;
4387  HWND disabled_hwnd;
4388  LRESULT id, ret;
4389 
4390  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4391  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4392  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x2222, 0);
4393  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4394  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4395  ok(id == MAKELONG(0x2222,DC_HASDEFID), "expected (0x2222,DC_HASDEFID), got %08lx\n", id);
4396 
4397  expected_id = MAKELONG(0x2222,DC_HASDEFID);
4398 
4399  parent_is_child = (GetWindowLongA(param->parent, GWL_STYLE) & (WS_POPUP | WS_CHILD)) == WS_CHILD;
4400 
4401  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4402  if (parent_is_child)
4403  {
4404  ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
4405  disabled_hwnd = param->grand_parent;
4406  }
4407  else
4408  {
4409  ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
4410  disabled_hwnd = param->parent;
4411  }
4412 
4413  if (param->grand_parent)
4414  {
4415  if (parent_is_child)
4416  ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
4417  else
4418  ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
4419  }
4420 
4421  DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0);
4422  ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style);
4423 
4424  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4425  ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
4426  if (param->grand_parent)
4427  ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
4428 
4430  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4431  ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
4432  if (param->grand_parent)
4433  ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
4434 
4435  param->dlg_data->style |= WS_CHILD;
4437  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4438 
4439  param->dlg_data->style |= DS_CONTROL;
4441  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4442 
4443  param->dlg_data->dwExtendedStyle |= WS_EX_CONTROLPARENT;
4446  param->dlg_data->style &= ~DS_CONTROL;
4448  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4449 
4452  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4453 
4454  param->dlg_data->style |= DS_CONTROL;
4456  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4457 
4458  EndDialog(hwnd, 0);
4459  }
4460  return 0;
4461 }
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:2060
#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:4338
#define DM_GETDEFID
Definition: winuser.h:2059
static LRESULT expected_id
Definition: win.c:4336
#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:2563
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ok(value,...)
#define MAKELONG(a, b)
Definition: typedefs.h:248
smooth NULL
Definition: ftsmooth.c:416
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:819
#define GWL_STYLE
Definition: winuser.h:846
#define DS_CONTROL
Definition: winuser.h:372
#define WS_POPUP
Definition: pedump.c:616
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:1715

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 4338 of file win.c.

4339 {
4340  if (msg == WM_INITDIALOG)
4341  {
4343  LRESULT id, ret;
4344 
4345  id = DefDlgProcA(parent, DM_GETDEFID, 0, 0);
4346  if (!id || root_dialog(hwnd) == hwnd)
4347  parent = 0;
4348 
4349  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4350  if (!parent)
4351  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4352  else
4353  ok(id == expected_id, "expected %08lx, got %08lx\n", expected_id, id);
4354 
4355  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x3333, 0);
4356  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4357  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4358  ok(id == MAKELONG(0x3333,DC_HASDEFID), "expected (0x3333,DC_HASDEFID), got %08lx\n", id);
4359 
4360  if (parent)
4361  {
4362  id = DefDlgProcA(parent, DM_GETDEFID, 0, 0);
4363  ok(id == MAKELONG(0x3333,DC_HASDEFID), "expected (0x3333,DC_HASDEFID), got %08lx\n", id);
4364 
4365  expected_id = MAKELONG(0x3333,DC_HASDEFID);
4366  }
4367 
4368  EndDialog(hwnd, 0);
4369  }
4370 
4371  return 0;
4372 }
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:4311
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DM_SETDEFID
Definition: winuser.h:2060
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define DM_GETDEFID
Definition: winuser.h:2059
static LRESULT expected_id
Definition: win.c:4336
#define DC_HASDEFID
Definition: winuser.h:2563
#define ok(value,...)
#define MAKELONG(a, b)
Definition: typedefs.h:248
r parent
Definition: btrfs.c:2708
int ret
HWND WINAPI GetParent(_In_ HWND)
#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:1715

Referenced by empty_dlg_proc2().

◆ enum_proc()

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

Definition at line 669 of file win.c.

670 {
671  (*(LPINT)lParam)++;
672  if (*(LPINT)lParam > 2) return FALSE;
673  return TRUE;
674 }
#define TRUE
Definition: types.h:120
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 675 of file win.c.

676 {
677  INT count;
678  HWND hwnd[3];
679  BOOL ret;
680  MSG msg;
681 
682  if (pGetGUIThreadInfo)
683  {
685  info.cbSize = sizeof(info);
686  ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info );
687  ok( ret || broken(!ret), /* win9x */
688  "GetGUIThreadInfo failed without message queue\n" );
689  SetLastError( 0xdeadbeef );
690  info.cbSize = sizeof(info) + 1;
691  ret = pGetGUIThreadInfo( GetCurrentThreadId(), &info );
692  ok( !ret, "GetGUIThreadInfo succeeded with wrong size\n" );
694  broken(GetLastError() == 0xdeadbeef), /* win9x */
695  "wrong error %u\n", GetLastError() );
696  }
697 
698  PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */
699 
700  count = 0;
702  ok( ret, "EnumThreadWindows should have returned TRUE\n" );
703  ok( count == 0, "count should be 0 got %d\n", count );
704 
705  hwnd[0] = CreateWindowExA(0, "ToolWindowClass", "Tool window 1", WS_POPUP,
706  0, 0, 100, 100, 0, 0, 0, NULL );
707  count = 0;
709  ok( ret, "EnumThreadWindows should have returned TRUE\n" );
710  if (count != 2) /* Vista gives us two windows for the price of one */
711  {
712  ok( count == 1, "count should be 1 got %d\n", count );
713  hwnd[2] = CreateWindowExA(0, "ToolWindowClass", "Tool window 2", WS_POPUP,
714  0, 0, 100, 100, 0, 0, 0, NULL );
715  }
716  else hwnd[2] = 0;
717 
718  hwnd[1] = CreateWindowExA(0, "ToolWindowClass", "Tool window 3", WS_POPUP,
719  0, 0, 100, 100, 0, 0, 0, NULL );
720  count = 0;
722  ok( !ret, "EnumThreadWindows should have returned FALSE\n" );
723  ok( count == 3, "count should be 3 got %d\n", count );
724 
725  if (hwnd[2]) DestroyWindow(hwnd[2]);
726  DestroyWindow(hwnd[1]);
727  DestroyWindow(hwnd[0]);
728  return 0;
729 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
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:1059
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:56
#define PM_NOREMOVE
Definition: winuser.h:1181
struct _test_info info[]
Definition: SetCursorPos.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:420
#define SetLastError(x)
Definition: compat.h:409
int ret
#define broken(x)
Definition: _sntprintf.h:21
#define WS_POPUP
Definition: pedump.c:616
#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:669

Referenced by test_enum_thread_windows().

◆ EnumChildProc()

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

Definition at line 183 of file win.c.

184 {
185  (*(LPINT)lParam)++;
186  trace("EnumChildProc on %p\n", hwndChild);
187  if (*(LPINT)lParam > 1) return FALSE;
188  return TRUE;
189 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
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 192 of file win.c.

193 {
194  trace("EnumChildProc1 on %p\n", hwndChild);
195  if ((HWND)lParam == hwndChild) return FALSE;
196  return TRUE;
197 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
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 989 of file win.c.

990 {
991  AdjustWindowRectEx(rc, style, menu, exstyle);
992  /* AdjustWindowRectEx does not include scroll bars */
993  if (style & WS_VSCROLL)
994  {
995  if(exstyle & WS_EX_LEFTSCROLLBAR)
997  else
999  }
1000  if (style & WS_HSCROLL)
1002 }
#define SM_CYHSCROLL
Definition: winuser.h:952
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#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:294
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:445
__u16 time
Definition: mkdosfs.c:366
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
smooth NULL
Definition: ftsmooth.c:416
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 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 7333 of file win.c.

7334 {
7335  switch (msg)
7336  {
7337  case WM_NCCREATE:
7338  {
7339  CREATESTRUCTA *cs = (CREATESTRUCTA *)lp;
7340  ok(cs->x == mi.rcMonitor.left && cs->y == mi.rcMonitor.top &&
7341  cs->cx == mi.rcMonitor.right && cs->cy == mi.rcMonitor.bottom,
7342  "expected %s, got (%d,%d)-(%d,%d)\n", wine_dbgstr_rect(&mi.rcMonitor),
7343  cs->x, cs->y, cs->cx, cs->cy);
7344  break;
7345  }
7346  case WM_GETMINMAXINFO:
7347  {
7348  MINMAXINFO *minmax = (MINMAXINFO *)lp;
7349  ok(minmax->ptMaxPosition.x <= mi.rcMonitor.left, "%d <= %d\n", minmax->ptMaxPosition.x, mi.rcMonitor.left);
7350  ok(minmax->ptMaxPosition.y <= mi.rcMonitor.top, "%d <= %d\n", minmax->ptMaxPosition.y, mi.rcMonitor.top);
7351  ok(minmax->ptMaxSize.x >= mi.rcMonitor.right, "%d >= %d\n", minmax->ptMaxSize.x, mi.rcMonitor.right);
7352  ok(minmax->ptMaxSize.y >= mi.rcMonitor.bottom, "%d >= %d\n", minmax->ptMaxSize.y, mi.rcMonitor.bottom);
7353  break;
7354  }
7355  }
7356  return DefWindowProcA(hwnd, msg, wp, lp);
7357 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
POINT ptMaxSize
Definition: winuser.h:3570
long x
Definition: polytest.cpp:48
LONG top
Definition: windef.h:292
static MONITORINFO mi
Definition: win.c:7331
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
RECT rcMonitor
Definition: winuser.h:3727
#define WM_NCCREATE
Definition: winuser.h:1665
uint32_t cs
Definition: isohybrid.c:75
#define ok(value,...)
const char * wine_dbgstr_rect(const RECT *rect)
POINT ptMaxPosition
Definition: winuser.h:3571
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define msg(x)
Definition: auth_time.c:54
LONG bottom
Definition: windef.h:294
#define WM_GETMINMAXINFO
Definition: winuser.h:1622

Referenced by test_fullscreen().

◆ get_window_attributes()

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

Definition at line 8174 of file win.c.

8175 {
8176  DWORD style, ex_style, hittest;
8177 
8179  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
8180  attrs->class_name[0] = 0;
8181  GetClassNameA(hwnd, attrs->class_name, sizeof(attrs->class_name));
8182  hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, 0);
8183 
8184  attrs->is_visible = (style & WS_VISIBLE) != 0;
8185  attrs->is_enabled = (style & WS_DISABLED) == 0;
8186  attrs->is_groupbox = !lstrcmpiA(attrs->class_name, "Button") && (style & BS_TYPEMASK) == BS_GROUPBOX;
8187  attrs->is_httransparent = hittest == HTTRANSPARENT;
8188  attrs->is_extransparent = (ex_style & WS_EX_TRANSPARENT) != 0;
8189 }
#define WS_DISABLED
Definition: pedump.c:621
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HTTRANSPARENT
Definition: winuser.h:2427
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:8171
#define WM_NCHITTEST
Definition: winuser.h:1668
#define BS_GROUPBOX
Definition: pedump.c:658
BOOL is_httransparent
Definition: win.c:8171
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL is_extransparent
Definition: win.c:8171
#define GWL_STYLE
Definition: winuser.h:846
char class_name[128]
Definition: win.c:8170
#define BS_TYPEMASK
Definition: winuser.h:270
BOOL is_groupbox
Definition: win.c:8171
BOOL is_visible
Definition: win.c:8171
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 6570 of file win.c.

6571 {
6572  HWND hwnd = arg;
6573  char buf[32];
6574  INT buf_len;
6575 
6576  /* test GetWindowTextA */
6577  num_gettext_msgs = 0;
6578  memset( buf, 0, sizeof(buf) );
6579  buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
6580  ok( buf_len != 0, "expected a nonempty window text\n" );
6581  ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
6582  ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
6583 
6584  return 0;
6585 }
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:1296
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void * arg
Definition: msvc.h:12
int32_t INT
Definition: typedefs.h:56
#define ok(value,...)
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 171 of file win.c.

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

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 747 of file win.c.

748 {
749  switch (msg)
750  {
751  case WM_GETMINMAXINFO:
752  {
753  SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0x20031021);
754  break;
755  }
757  {
758  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
759  if (!(winpos->flags & SWP_NOMOVE))
760  {
761  ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x);
762  ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y);
763  }
764  /* Win9x does not fixup cx/xy for WM_WINDOWPOSCHANGING */
765  if (!(winpos->flags & SWP_NOSIZE) && !is_win9x)
766  {
767  ok((winpos->cx >= 0 && winpos->cx <= 32767) ||
768  winpos->cx == 32768, /* win7 doesn't truncate */
769  "bad winpos->cx %d\n", winpos->cx);
770  ok((winpos->cy >= 0 && winpos->cy <= 32767) ||
771  winpos->cy == 40000, /* win7 doesn't truncate */
772  "bad winpos->cy %d\n", winpos->cy);
773  }
774  break;
775  }
776  case WM_WINDOWPOSCHANGED:
777  {
778  RECT rc1, rc2;
779  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
780  ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x);
781  ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y);
782 
783  ok((winpos->cx >= 0 && winpos->cx <= 32767) ||
784  winpos->cx == 32768, /* win7 doesn't truncate */
785  "bad winpos->cx %d\n", winpos->cx);
786  ok((winpos->cy >= 0 && winpos->cy <= 32767) ||
787  winpos->cy == 40000, /* win7 doesn't truncate */
788  "bad winpos->cy %d\n", winpos->cy);
789 
790  GetWindowRect(hwnd, &rc1);
791  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
792  /* note: winpos coordinates are relative to parent */
794  if (0)
795  {
796  /* Uncomment this once the test succeeds in all cases */
797  ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
799 
802  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
803  ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
805  }
806  break;
807  }
808  case WM_NCCREATE:
809  {
810  BOOL got_getminmaxinfo = GetWindowLongPtrA(hwnd, GWLP_USERDATA) == 0x20031021;
812 
813  if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
814  ok(got_getminmaxinfo, "main: WM_GETMINMAXINFO should have been received before WM_NCCREATE\n");
815  else
816  ok(!got_getminmaxinfo, "main: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE\n");
817  break;
818  }
819  case WM_COMMAND:
821  {
823  flush_events( FALSE );
824  }
825  break;
826  case WM_GETTEXT:
828  if (g_wm_gettext_override.enabled)
829  {
830  char *text = (char*)lparam;
831  ok(g_wm_gettext_override.buff == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buff, text);
832  ok(*text == 0, "expected empty string buffer %x\n", *text);
833  return 0;
834  }
835  break;
836  case WM_SETTEXT:
838  break;
839  case WM_ACTIVATEAPP:
840  if (wparam) app_activated = TRUE;
841  else app_deactivated = TRUE;
842  break;
843  }
844 
845  return DefWindowProcA(hwnd, msg, wparam, lparam);
846 }
#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
#define TRUE
Definition: types.h:120
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
static BOOL test_lbuttondown_flag
Definition: win.c:57
const WCHAR * text
Definition: package.c:1827
#define WM_NCCALCSIZE
Definition: winuser.h:1667
#define WM_GETTEXT
Definition: winuser.h:1600
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:1665
static BOOL is_win9x
Definition: win.c:69
uint32_t cs
Definition: isohybrid.c:75
unsigned int BOOL
Definition: ntddk_ex.h:94
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ok(value,...)
#define GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3536
#define SW_SHOW
Definition: winuser.h:769
#define WM_SETTEXT
Definition: winuser.h:1599
static DWORD num_settext_msgs
Definition: win.c:59
#define GetWindowLongPtrA
Definition: winuser.h:4697
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
const char * wine_dbgstr_rect(const RECT *rect)
#define SetWindowLongPtrA
Definition: winuser.h:5214
#define WM_COMMAND
Definition: winuser.h:1716
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SWP_NOSIZE
Definition: winuser.h:1230
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:1614
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define WS_POPUP
Definition: pedump.c:616
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define msg(x)
Definition: auth_time.c:54
#define SWP_NOMOVE
Definition: winuser.h:1229
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:1622
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 848 of file win.c.

849 {
850  switch (msg)
851  {
852  case WM_GETTEXT:
854  if (g_wm_gettext_override.enabled)
855  {
856  WCHAR *text = (WCHAR*)lparam;
857  ok(g_wm_gettext_override.buffW == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buffW, text);
858  ok(*text == 0, "expected empty string buffer %x\n", *text);
859  return 0;
860  }
861  break;
862  }
863 
864  return DefWindowProcA(hwnd, msg, wparam, lparam);
865 }
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:1600
static struct wm_gettext_override_data g_wm_gettext_override
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ok(value,...)
__wchar_t WCHAR
Definition: xmlstorage.h:180
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 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 1803 of file win.c.

1804 {
1805  switch (msg)
1806  {
1807  case WM_NCCREATE:
1808  case WM_CREATE:
1809  {
1811  MDICREATESTRUCTA *mdi_cs = cs->lpCreateParams;
1812 
1813  ok(cs->dwExStyle & WS_EX_MDICHILD, "WS_EX_MDICHILD should be set\n");
1814  ok(mdi_cs->lParam == (LPARAM)mdi_lParam_test_message, "wrong mdi_cs->lParam\n");
1815 
1816  ok(!lstrcmpA(cs->lpszClass, "MDI_child_Class_1"), "wrong class name\n");
1817  ok(!lstrcmpA(cs->lpszClass, mdi_cs->szClass), "class name does not match\n");
1818  ok(!lstrcmpA(cs->lpszName, "MDI child"), "wrong title\n");
1819  ok(!lstrcmpA(cs->lpszName, mdi_cs->szTitle), "title does not match\n");
1820  ok(cs->hInstance == mdi_cs->hOwner, "%p != %p\n", cs->hInstance, mdi_cs->hOwner);
1821 
1822  /* MDICREATESTRUCT should have original values */
1823  ok(mdi_cs->style == 0 || mdi_cs->style == 0x7fffffff || mdi_cs->style == 0xffffffff || mdi_cs->style == WS_MAXIMIZE,
1824  "mdi_cs->style does not match (%08x)\n", mdi_cs->style);
1825  ok(mdi_cs->x == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->x);
1826  ok(mdi_cs->y == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->y);
1827  ok(mdi_cs->cx == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->cx);
1828  ok(mdi_cs->cy == CW_USEDEFAULT, "%d != CW_USEDEFAULT\n", mdi_cs->cy);
1829 
1830  /* CREATESTRUCT should have fixed values */
1831  ok(cs->x != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->x);
1832  ok(cs->y != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->y);
1833 
1834  /* cx/cy == CW_USEDEFAULT are translated to NOT zero values */
1835  ok(cs->cx != CW_USEDEFAULT && cs->cx != 0, "%d == CW_USEDEFAULT\n", cs->cx);
1836  ok(cs->cy != CW_USEDEFAULT && cs->cy != 0, "%d == CW_USEDEFAULT\n", cs->cy);
1837 
1838  ok(!(cs->style & WS_POPUP), "WS_POPUP is not allowed\n");
1839 
1840  if (GetWindowLongA(cs->hwndParent, GWL_STYLE) & MDIS_ALLCHILDSTYLES)
1841  {
1842  LONG style = mdi_cs->style | WS_CHILD | WS_CLIPSIBLINGS;
1843  ok(cs->style == style,
1844  "cs->style does not match (%08x)\n", cs->style);
1845  }
1846  else
1847  {
1848  LONG style = mdi_cs->style;
1849  style &= ~WS_POPUP;
1852  ok(cs->style == style,
1853  "cs->style does not match (%08x)\n", cs->style);
1854  }
1855  break;
1856  }
1857 
1858  case WM_GETMINMAXINFO:
1859  {
1861  RECT rc;
1862  MINMAXINFO *minmax = (MINMAXINFO *)lparam;
1863  MINMAXINFO my_minmax;
1864  LONG style, exstyle;
1865 
1867  exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
1868 
1869  GetClientRect(client, &rc);
1870 
1871  GetClientRect(client, &rc);
1872  if ((style & WS_CAPTION) == WS_CAPTION)
1873  style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
1874  AdjustWindowRectEx(&rc, style, 0, exstyle);
1875  trace("MDI child: calculated max window size = (%d x %d)\n", rc.right-rc.left, rc.bottom-rc.top);
1876  dump_minmax_info( minmax );
1877 
1878  ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
1879  minmax->ptMaxSize.x, rc.right - rc.left);
1880  ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
1881  minmax->ptMaxSize.y, rc.bottom - rc.top);
1882 
1884 
1885  trace("DefMDIChildProc returned:\n");
1886  dump_minmax_info( minmax );
1887 
1888  MDI_ChildGetMinMaxInfo(client, hwnd, &my_minmax);
1889  ok(minmax->ptMaxSize.x == my_minmax.ptMaxSize.x, "default width of maximized child %d != %d\n",
1890  minmax->ptMaxSize.x, my_minmax.ptMaxSize.x);
1891  ok(minmax->ptMaxSize.y == my_minmax.ptMaxSize.y, "default height of maximized child %d != %d\n",
1892  minmax->ptMaxSize.y, my_minmax.ptMaxSize.y);
1893 
1894  return 1;
1895  }
1896 
1897  case WM_MDIACTIVATE:
1898  {
1899  HWND active, client = GetParent(hwnd);
1900  /*trace("%p WM_MDIACTIVATE %08x %08lx\n", hwnd, wparam, lparam);*/
1901  active = (HWND)SendMessageA(client, WM_MDIGETACTIVE, 0, 0);
1902  if (hwnd == (HWND)lparam) /* if we are being activated */
1903  ok (active == (HWND)lparam, "new active %p != active %p\n", (HWND)lparam, active);
1904  else
1905  ok (active == (HWND)wparam, "old active %p != active %p\n", (HWND)wparam, active);
1906  break;
1907  }
1908  }
1909  return DefMDIChildProcA(hwnd, msg, wparam, lparam);
1910 }
#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)
#define trace(...)
Definition: kmt_test.h:217
long y
Definition: polytest.cpp:48
POINT ptMaxSize
Definition: winuser.h:3570
long x
Definition: polytest.cpp:48
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG top
Definition: windef.h:292
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:291
LONG right
Definition: windef.h:293
#define WM_NCCREATE
Definition: winuser.h:1665
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:1361
#define ok(value,...)
#define CW_USEDEFAULT
Definition: winuser.h:225
static void MDI_ChildGetMinMaxInfo(HWND client, HWND hwnd, MINMAXINFO *lpMinMax)
Definition: win.c:1784
LONG_PTR LPARAM
Definition: windef.h:208
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_CAPTION
Definition: pedump.c:624
#define MDIS_ALLCHILDSTYLES
Definition: winuser.h:253
static FILE * client
Definition: client.c:41
#define WM_MDIGETACTIVE
Definition: winuser.h:1797
#define WM_MDIACTIVATE
Definition: winuser.h:1790
#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 WS_POPUP
Definition: pedump.c:616
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
LONG bottom
Definition: windef.h:294
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:1622
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 1912 of file win.c.

1913 {
1914  switch (msg)
1915  {
1916  case WM_NCCREATE:
1917  case WM_CREATE:
1918  {
1920 
1921  trace("%s: x %d, y %d, cx %d, cy %d\n", (msg == WM_NCCREATE) ? "WM_NCCREATE" : "WM_CREATE",
1922  cs->x, cs->y, cs->cx, cs->cy);
1923 
1924  ok(!(cs->dwExStyle & WS_EX_MDICHILD), "WS_EX_MDICHILD should not be set\n");
1925  ok(cs->lpCreateParams == mdi_lParam_test_message, "wrong cs->lpCreateParams\n");
1926 
1927  ok(!lstrcmpA(cs->lpszClass, "MDI_child_Class_2"), "wrong class name\n");
1928  ok(!lstrcmpA(cs->lpszName, "MDI child"), "wrong title\n");
1929 
1930  /* CREATESTRUCT should have fixed values */
1931  /* For some reason Win9x doesn't translate cs->x from CW_USEDEFAULT,
1932  while NT does. */
1933  /*ok(cs->x != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->x);*/
1934  ok(cs->y != CW_USEDEFAULT, "%d == CW_USEDEFAULT\n", cs->y);
1935 
1936  /* cx/cy == CW_USEDEFAULT are translated to 0 */
1937  /* For some reason Win98 doesn't translate cs->cx from CW_USEDEFAULT,
1938  while Win95, Win2k, WinXP do. */
1939  /*ok(cs->cx == 0, "%d != 0\n", cs->cx);*/
1940  ok(cs->cy == 0, "%d != 0\n", cs->cy);
1941  break;
1942  }
1943 
1944  case WM_GETMINMAXINFO:
1945  {
1947  RECT rc;
1948  MINMAXINFO *minmax = (MINMAXINFO *)lparam;
1949  LONG style, exstyle;
1950 
1952  exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE);
1953 
1954  GetClientRect(parent, &rc);
1955  trace("WM_GETMINMAXINFO: parent %p client size = (%d x %d)\n", parent, rc.right, rc.bottom);
1956 
1957  GetClientRect(parent, &rc);
1958  if ((style & WS_CAPTION) == WS_CAPTION)
1959  style &= ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
1960  AdjustWindowRectEx(&rc, style, 0, exstyle);
1961  dump_minmax_info( minmax );
1962 
1963  ok(minmax->ptMaxSize.x == rc.right - rc.left, "default width of maximized child %d != %d\n",
1964  minmax->ptMaxSize.x, rc.right - rc.left);
1965  ok(minmax->ptMaxSize.y == rc.bottom - rc.top, "default height of maximized child %d != %d\n",
1966  minmax->ptMaxSize.y, rc.bottom - rc.top);
1967  break;
1968  }
1969 
1970  case WM_WINDOWPOSCHANGED:
1971  {
1972  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
1973  RECT rc1, rc2;
1974 
1975  GetWindowRect(hwnd, &rc1);
1976  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
1977  /* note: winpos coordinates are relative to parent */
1979  ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s pos=%s\n",
1981  GetWindowRect(hwnd, &rc1);
1982  GetClientRect(hwnd, &rc2);
1984  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
1985  ok(EqualRect(&rc1, &rc2), "rects do not match, window=%s client=%s\n",
1987  }
1988  /* fall through */
1989  case WM_WINDOWPOSCHANGING:
1990  {
1991  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
1992  WINDOWPOS my_winpos = *winpos;
1993 
1994  trace("%s: %p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
1995  (msg == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED",
1996  winpos->hwnd, winpos->hwndInsertAfter,
1997  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
1998 
2000 
2001  ok(!memcmp(&my_winpos, winpos, sizeof(WINDOWPOS)),
2002  "DefWindowProc should not change WINDOWPOS: %p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2003  winpos->hwnd, winpos->hwndInsertAfter,
2004  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2005 
2006  return 1;
2007  }
2008  }
2009  return DefWindowProcA(hwnd, msg, wparam, lparam);
2010 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define trace(...)
Definition: kmt_test.h:217
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:3570
long x
Definition: polytest.cpp:48
#define WM_NCCALCSIZE
Definition: winuser.h:1667
LONG top
Definition: windef.h:292
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
HWND hwndInsertAfter
Definition: winuser.h:3531
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:291
LONG right
Definition: windef.h:293
#define WM_NCCREATE
Definition: winuser.h:1665
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:1361
#define ok(value,...)
#define CW_USEDEFAULT
Definition: winuser.h:225
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3536
#define WS_CAPTION
Definition: pedump.c:624
r parent
Definition: btrfs.c:2708
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
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 WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static const WCHAR rc2[]
Definition: oid.c:1216
HWND hwnd
Definition: winuser.h:3530
Arabic default style
Definition: afstyles.h:93
#define WM_GETMINMAXINFO
Definition: winuser.h:1622
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 1784 of file win.c.

1785 {
1786  RECT rect;
1787 
1788  GetClientRect( client, &rect );
1791 
1792  rect.right -= rect.left;
1793  rect.bottom -= rect.top;
1794  lpMinMax->ptMaxSize.x = rect.right;
1795  lpMinMax->ptMaxSize.y = rect.bottom;
1796 
1797  lpMinMax->ptMaxPosition.x = rect.left;
1798  lpMinMax->ptMaxPosition.y = rect.top;
1799 
1800  trace("max rect %s\n", wine_dbgstr_rect(&rect));
1801 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define trace(...)
Definition: kmt_test.h:217
long y
Definition: polytest.cpp:48
POINT ptMaxSize
Definition: winuser.h:3570
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)
const char * wine_dbgstr_rect(const RECT *rect)
static FILE * client
Definition: client.c:41
POINT ptMaxPosition
Definition: winuser.h:3571
#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 2012 of file win.c.

2013 {
2014  static HWND mdi_client;
2015 
2016  switch (msg)
2017  {
2018  case WM_CREATE:
2019  return 1;
2020 
2021  case WM_WINDOWPOSCHANGED:
2022  {
2023  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
2024  RECT rc1, rc2;
2025 
2026  GetWindowRect(hwnd, &rc1);
2027  trace("window: %s\n", wine_dbgstr_rect(&rc1));
2028  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
2029  /* note: winpos coordinates are relative to parent */
2031  trace("pos: %s\n", wine_dbgstr_rect(&rc2));
2032  ok(EqualRect(&rc1, &rc2), "rects do not match\n");
2033 
2034  GetWindowRect(hwnd, &rc1);
2035  GetClientRect(hwnd, &rc2);
2037  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
2038  ok(EqualRect(&rc1, &rc2), "rects do not match\n");
2039  }
2040  /* fall through */
2041  case WM_WINDOWPOSCHANGING:
2042  {
2043  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
2044  WINDOWPOS my_winpos = *winpos;
2045 
2046  trace("%s\n", (msg == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
2047  trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2048  winpos->hwnd, winpos->hwndInsertAfter,
2049  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2050 
2052 
2053  trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2054  winpos->hwnd, winpos->hwndInsertAfter,
2055  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2056 
2057  ok(!memcmp(&my_winpos, winpos, sizeof(WINDOWPOS)),
2058  "DefWindowProc should not change WINDOWPOS values\n");
2059 
2060  return 1;
2061  }
2062 
2063  case WM_CLOSE:
2064  PostQuitMessage(0);
2065  break;
2066  }
2068 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define trace(...)
Definition: kmt_test.h:217
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:1667
LRESULT WINAPI DefFrameProcA(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndInsertAfter
Definition: winuser.h:3531
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define ok(value,...)
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3536
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
#define WM_CLOSE
Definition: winuser.h:1603
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:3671
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 WM_WINDOWPOSCHANGED
Definition: winuser.h:1644
#define msg(x)
Definition: auth_time.c:54
#define WM_CREATE
Definition: winuser.h:1590
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static const WCHAR rc2[]
Definition: oid.c:1216
HWND hwnd
Definition: winuser.h:3530
__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 2070 of file win.c.

2071 {
2072  WNDCLASSA cls;
2073 
2074  cls.style = 0;
2076  cls.cbClsExtra = 0;
2077  cls.cbWndExtra = 0;
2078  cls.hInstance = GetModuleHandleA(0);
2079  cls.hIcon = 0;
2080  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
2082  cls.lpszMenuName = NULL;
2083  cls.lpszClassName = "MDI_parent_Class";
2084  if(!RegisterClassA(&cls)) return FALSE;
2085 
2087  cls.lpszClassName = "MDI_child_Class_1";
2088  if(!RegisterClassA(&cls)) return FALSE;
2089 
2091  cls.lpszClassName = "MDI_child_Class_2";
2092  if(!RegisterClassA(&cls)) return FALSE;
2093 
2094  return TRUE;
2095 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRUE
Definition: types.h:120
int cbClsExtra
Definition: winuser.h:3118
LPCSTR lpszMenuName
Definition: winuser.h:3124
#define WHITE_BRUSH
Definition: wingdi.h:901
HBRUSH hbrBackground
Definition: winuser.h:3123
int cbWndExtra
Definition: winuser.h:3119
HCURSOR hCursor
Definition: winuser.h:3122
smooth NULL
Definition: ftsmooth.c:416
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:1803
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:819
LPCSTR lpszClassName
Definition: winuser.h:3125
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3116
HINSTANCE hInstance
Definition: winuser.h:3120
static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:1912
WNDPROC lpfnWndProc
Definition: winuser.h:3117
#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:2012
HICON hIcon
Definition: winuser.h:3121

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 5786 of file win.c.

5787 {
5788  MINMAXINFO *minmax;
5789 
5790  if (msg != WM_GETMINMAXINFO)
5791  return DefWindowProcA(hwnd, msg, wp, lp);
5792 
5793  minmax = (MINMAXINFO *)lp;
5794 
5796  {
5797  minmax->ptReserved.x = 0;
5798  minmax->ptReserved.y = 0;
5799  minmax->ptMaxSize.x = 400;
5800  minmax->ptMaxSize.y = 400;
5801  minmax->ptMaxPosition.x = 300;
5802  minmax->ptMaxPosition.y = 300;
5803  minmax->ptMaxTrackSize.x = 200;
5804  minmax->ptMaxTrackSize.y = 200;
5805  minmax->ptMinTrackSize.x = 100;
5806  minmax->ptMinTrackSize.y = 100;
5807  }
5808  else
5809  DefWindowProcA(hwnd, msg, wp, lp);
5810  return 1;
5811 }
POINT ptMinTrackSize
Definition: winuser.h:3572
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3569
POINT ptMaxSize
Definition: winuser.h:3570
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:3571
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:3573
#define WM_GETMINMAXINFO
Definition: winuser.h:1622

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 8070 of file win.c.

8071 {
8072  if (msg == WM_NCHITTEST) return HTTRANSPARENT;
8073  return DefWindowProcA(hwnd, msg, wp, lp);
8074 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HTTRANSPARENT
Definition: winuser.h:2427
#define WM_NCHITTEST
Definition: winuser.h:1668
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 8076 of file win.c.

8077 {
8078  return DefWindowProcA(hwnd, msg, wp, lp);
8079 }
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 3914 of file win.c.

3915 {
3916  RECT rc;
3917  MoveWindow( hwnd, 0, 0, x, y, 0);
3918  GetWindowRect( hwnd, prc);
3919  rc = *prc;
3921  trace("window rect is %s, nccalc rect is %s\n", wine_dbgstr_rect(&rc), wine_dbgstr_rect(prc));
3922 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define trace(...)
Definition: kmt_test.h:217
#define WM_NCCALCSIZE
Definition: winuser.h:1667
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG_PTR LPARAM
Definition: windef.h:208
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()

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

Definition at line 2418 of file win.c.

2419 {
2420  if (msg == WM_NCCALCSIZE)
2421  {
2422  RECT *rect = (RECT *)lparam;
2423  /* first time around increase the rectangle, next time decrease it */
2424  if (rect->left == 100) InflateRect( rect, 10, 10 );
2425  else InflateRect( rect, -10, -10 );
2426  return 0;
2427  }
2428  return DefWindowProcA( hwnd, msg, wparam, lparam );
2429 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define WM_NCCALCSIZE
Definition: winuser.h:1667
& rect
Definition: startmenu.cpp:1413
static UINT WPARAM LPARAM lparam