ReactOS  0.4.14-dev-583-g2a1ba2c
win.c File Reference
#include "precomp.h"
Include dependency graph for win.c:

Go to the source code of this file.

Classes

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

Macros

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

Functions

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

Variables

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

Macro Definition Documentation

◆ check_active_state

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

Definition at line 159 of file win.c.

◆ check_wnd_state

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

Definition at line 143 of file win.c.

◆ check_z_order

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

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

◆ expect_menu

#define expect_menu (   window,
  menu 
)
Value:
SetLastError(0xdeadbeef); \
res = (GetMenu(window) == (HMENU)menu); \
ok(res, "GetMenu error %d\n", GetLastError())
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SetLastError(x)
Definition: compat.h:417
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 7610 of file win.c.

◆ parentdc_field_ok

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

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

Definition at line 5506 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:5491
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 5495 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:164
GLfloat f
Definition: glext.h:7540

Definition at line 5491 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:5495
static FILE * client
Definition: client.c:41

Definition at line 5501 of file win.c.

◆ SET_FOREGROUND_INJECT

#define SET_FOREGROUND_INJECT   0x10

Definition at line 9012 of file win.c.

◆ SET_FOREGROUND_SET_1

#define SET_FOREGROUND_SET_1   0x02

Definition at line 9009 of file win.c.

◆ SET_FOREGROUND_SET_2

#define SET_FOREGROUND_SET_2   0x08

Definition at line 9011 of file win.c.

◆ SET_FOREGROUND_STEAL_1

#define SET_FOREGROUND_STEAL_1   0x01

Definition at line 9008 of file win.c.

◆ SET_FOREGROUND_STEAL_2

#define SET_FOREGROUND_STEAL_2   0x04

Definition at line 9010 of file win.c.

◆ SHOWSYSMETRIC

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

Definition at line 5344 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:3985
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 5263 of file win.c.

5264 {
5265  WNDCLASSA class;
5266 
5267  class.style = CS_HREDRAW | CS_VREDRAW;
5268  class.lpfnWndProc = DefWindowProcA;
5269  class.cbClsExtra = 0;
5270  class.cbWndExtra = 0;
5271  class.hInstance = 0;
5272  class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION);
5273  class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
5274  class.hbrBackground = 0;
5275  class.lpszMenuName = 0;
5276  class.lpszClassName = szAWRClass;
5277 
5278  if (!RegisterClassA(&class)) {
5279  ok(FALSE, "RegisterClass failed\n");
5280  return FALSE;
5281  }
5282 
5283  hmenu = CreateMenu();
5284  if (!hmenu)
5285  return FALSE;
5286  ok(hmenu != 0, "Failed to create menu\n");
5287  ok(AppendMenuA(hmenu, MF_STRING, 1, "Test!"), "Failed to create menu item\n");
5288 
5289  return TRUE;
5290 }
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
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:3138
#define ok(value,...)
Definition: atltest.h:57
#define IDC_ARROW
Definition: winuser.h:682
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)

Referenced by test_AdjustWindowRect().

◆ BOOL()

static BOOL ( WINAPI pGetWindowInfo)
static

Referenced by test_shell_window().

◆ button_hook_proc()

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

Definition at line 3292 of file win.c.

3293 {
3294  LRESULT ret;
3295  USHORT key_state;
3296 
3297  key_state = GetKeyState(VK_LBUTTON);
3298  ok(!(key_state & 0x8000), "VK_LBUTTON should not be pressed, state %04x\n", key_state);
3299 
3301 
3302  if (msg == WM_LBUTTONDOWN)
3303  {
3304  HWND hwnd, capture;
3305 
3307 
3308  hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
3309  assert(hwnd);
3310  trace("hwnd %p\n", hwnd);
3311 
3313 
3315 
3317 
3319 
3320  hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL);
3321  assert(hwnd);
3322  trace("hwnd %p\n", hwnd);
3323 
3325 
3326  /* button wnd proc should release capture on WM_KILLFOCUS if it does
3327  * match internal button state.
3328  */
3331 
3333  check_wnd_state(hwnd, hwnd, hwnd, 0);
3334 
3335  capture = SetCapture(hwnd);
3336  ok(capture == 0, "SetCapture() = %p\n", capture);
3337 
3339 
3341 
3342  check_wnd_state(button, 0, button, 0);
3343  }
3344 
3345  return ret;
3346 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SW_SHOWNOACTIVATE
Definition: winuser.h:768
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define VK_LBUTTON
Definition: winuser.h:2165
#define check_wnd_state(a, b, c, d)
Definition: win.c:143
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD button
Definition: button.c:166
#define assert(x)
Definition: debug.h:53
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
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
#define trace
Definition: atltest.h:70
int ret
HWND WINAPI SetCapture(_In_ HWND hWnd)
unsigned short USHORT
Definition: pedump.c:61
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
#define 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:3290
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 1119 of file win.c.

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

Referenced by START_TEST().

◆ check_active_state_()

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

Definition at line 160 of file win.c.

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

◆ check_dialog_style()

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

Definition at line 4471 of file win.c.

4472 {
4473  struct
4474  {
4475  DLGTEMPLATE dt;
4476  WORD menu_name;
4477  WORD class_id;
4478  WORD class_atom;
4479  WCHAR caption[1];
4480  } dlg_data;
4481  DWORD style, ex_style;
4482  HWND hwnd, grand_parent = 0, parent = 0;
4483  struct dialog_param param;
4484  LRESULT id, ret;
4485 
4486  if (style_in & WS_CHILD)
4487  {
4489  0, 0, 0, 0, NULL, NULL, NULL, NULL);
4490  ok(grand_parent != 0, "grand_parent creation failed\n");
4491  }
4492 
4493  parent = CreateWindowExA(0, "static", NULL, style_in,
4494  0, 0, 0, 0, grand_parent, NULL, NULL, NULL);
4495  ok(parent != 0, "parent creation failed, style %#x\n", style_in);
4496 
4497  dlg_data.dt.style = style_in;
4498  dlg_data.dt.dwExtendedStyle = ex_style_in;
4499  dlg_data.dt.cdit = 0;
4500  dlg_data.dt.x = 0;
4501  dlg_data.dt.y = 0;
4502  dlg_data.dt.cx = 100;
4503  dlg_data.dt.cy = 100;
4504  dlg_data.menu_name = 0;
4505  dlg_data.class_id = 0;
4506  dlg_data.class_atom = 0;
4507  dlg_data.caption[0] = 0;
4508 
4510  ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in);
4511 
4512  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4513  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4514  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x1111, 0);
4515  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4516  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4517  ok(id == MAKELONG(0x1111,DC_HASDEFID), "expected (0x1111,DC_HASDEFID), got %08lx\n", id);
4518 
4519  flush_events( TRUE );
4520 
4522  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4523  ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
4524  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4525 
4526  ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
4527 
4528  /* try setting the styles explicitly */
4529  SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in);
4531  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4532  ok(style == (style_out | DS_3DLOOK), "got %#x\n", style);
4533  /* WS_EX_WINDOWEDGE can't always be changed */
4534  if (ex_style_in & WS_EX_DLGMODALFRAME)
4535  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4536  else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE))
4537  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4538  else
4539  ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
4540  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4541 
4542  SetWindowLongA(hwnd, GWL_STYLE, style_in);
4544  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
4545  /* WS_CLIPSIBLINGS can't be reset on top-level windows */
4546  if ((style_in & (WS_CHILD | WS_POPUP)) == WS_CHILD) style_out = style_in;
4547  else style_out = style_in | WS_CLIPSIBLINGS;
4548  ok(style == style_out, "expected style %#x, got %#x\n", style_out, style);
4549  /* WS_EX_WINDOWEDGE can't always be changed */
4550  if (ex_style_in & WS_EX_DLGMODALFRAME)
4551  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4552  else if ((style & (WS_DLGFRAME | WS_THICKFRAME)) && !(ex_style_in & WS_EX_STATICEDGE))
4553  ex_style_out = ex_style_in | WS_EX_WINDOWEDGE;
4554  else
4555  ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE;
4556  /* FIXME: Remove the condition below once Wine is fixed */
4557  todo_wine_if (ex_style != ex_style_out)
4558  ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style);
4559 
4561 
4562  param.parent = parent;
4563  param.grand_parent = grand_parent;
4564  param.dlg_data = &dlg_data.dt;
4566 
4567  ok(IsWindowEnabled(parent), "wrong parent state (dialog style %#x)\n", style_in);
4568  if (grand_parent)
4569  ok(IsWindowEnabled(grand_parent), "wrong grand parent state (dialog style %#x)\n", style_in);
4570 
4573 }
#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:3034
#define WS_DLGFRAME
Definition: pedump.c:626
#define DM_SETDEFID
Definition: winuser.h:2081
#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:2080
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define DC_HASDEFID
Definition: winuser.h:2584
#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:3035
#define todo_wine_if(is_todo)
Definition: test.h:164
r parent
Definition: btrfs.c:2869
__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:4339
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:4384
INT_PTR WINAPI DialogBoxIndirectParamA(_In_opt_ HINSTANCE, _In_ LPCDLGTEMPLATE, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
int ret
short x
Definition: winuser.h:3037
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
short y
Definition: winuser.h:3038
WORD cdit
Definition: winuser.h:3036
#define GWL_STYLE
Definition: winuser.h:846
#define DS_3DLOOK
Definition: winuser.h:367
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
LONG WINAPI SetWindowLongA(_In_ HWND, _In_ int, _In_ LONG)
short cy
Definition: winuser.h:3040
DLGTEMPLATE * dlg_data
Definition: win.c:4385
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:3039
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:4388

Referenced by test_dialog_styles().

◆ check_error()

static int check_error ( DWORD  actual,
DWORD  expected 
)
static

Definition at line 6299 of file win.c.

6300 {
6301  static int sets_last_error = -1;
6302  if (sets_last_error == -1)
6303  sets_last_error = (actual != 0xdeadbeef);
6304  return (!sets_last_error && (actual == 0xdeadbeef)) || (actual == expected);
6305 }
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:2764
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GA_ROOTOWNER
Definition: winuser.h:2765
#define GA_PARENT
Definition: winuser.h:2763
#define GetWindowLongPtrA
Definition: winuser.h:4803
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
HWND WINAPI GetParent(_In_ HWND)
#define ok(value,...)
Definition: atltest.h:57
#define GW_OWNER
Definition: winuser.h:761
GLuint res
Definition: glext.h:9613
static HWND(WINAPI *pGetAncestor)(HWND
#define GWLP_HWNDPARENT
Definition: winuser.h:852

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

◆ check_style_wnd_proc()

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

Definition at line 6350 of file win.c.

6351 {
6353  const STYLESTRUCT *got = (STYLESTRUCT *)lParam;
6354 
6355  if (message == WM_STYLECHANGING && wParam == GWL_STYLE)
6356  {
6357  ok(got->styleOld == expected[0].styleOld, "expected old style %#x, got %#x\n",
6358  expected[0].styleOld, got->styleOld);
6359  ok(got->styleNew == expected[0].styleNew, "expected new style %#x, got %#x\n",
6360  expected[0].styleNew, got->styleNew);
6361  }
6362  else if (message == WM_STYLECHANGED && wParam == GWL_STYLE)
6363  {
6364  ok(got->styleOld == expected[1].styleOld, "expected old style %#x, got %#x\n",
6365  expected[1].styleOld, got->styleOld);
6366  ok(got->styleNew == expected[1].styleNew, "expected new style %#x, got %#x\n",
6367  expected[1].styleNew, got->styleNew);
6368  }
6369 
6371 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
Definition: tftpd.h:59
WPARAM wParam
Definition: combotst.c:138
#define GWLP_USERDATA
Definition: treelist.c:63
#define GetWindowLongPtrA
Definition: winuser.h:4803
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define GWL_STYLE
Definition: winuser.h:846
#define ok(value,...)
Definition: atltest.h:57
DWORD styleNew
Definition: winuser.h:3668
DWORD styleOld
Definition: winuser.h:3667
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 4207 of file win.c.

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

Referenced by test_window_styles().

◆ check_wnd_state_()

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

Definition at line 144 of file win.c.

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

◆ check_z_order_debug()

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

Definition at line 2796 of file win.c.

2798 {
2799  HWND test;
2800  DWORD ex_style;
2801 
2803  /* skip foreign windows */
2804  while (test && test != next &&
2807  GetWindow(test, GW_OWNER) == next))
2808  {
2809  /*trace("skipping next %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
2811  }
2812  ok_(file, line)(next == test, "%p: expected next %p, got %p\n", hwnd, next, test);
2813 
2815  /* skip foreign windows */
2816  while (test && test != prev &&
2819  GetWindow(test, GW_OWNER) == hwnd))
2820  {
2821  /*trace("skipping prev %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/
2823  }
2824  ok_(file, line)(prev == test, "%p: expected prev %p, got %p\n", hwnd, prev, test);
2825 
2827  ok_(file, line)(owner == test, "%p: expected owner %p, got %p\n", hwnd, owner, test);
2828 
2829  ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE);
2830  ok_(file, line)(!(ex_style & WS_EX_TOPMOST) == !topmost, "%p: expected %stopmost\n",
2831  hwnd, topmost ? "" : "NOT ");
2832 }
#define GW_HWNDNEXT
Definition: winuser.h:756
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GWL_EXSTYLE
Definition: winuser.h:845
#define test
Definition: rosglue.h:37
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
#define GetWindowLongPtrA
Definition: winuser.h:4803
#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:821
#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
#define ok_(x1, x2)
Definition: atltest.h:61
Definition: fci.c:126

◆ create_tool_window()

static HWND create_tool_window ( LONG  style,
HWND  parent 
)
static

Definition at line 201 of file win.c.

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

3148 {
3150  DWORD res;
3151  BOOL ret;
3152 
3153  p->window = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0);
3154 
3155  ret = SetEvent(p->window_created);
3156  ok(ret, "SetEvent failed, last error %#x.\n", GetLastError());
3157 
3158  res = WaitForSingleObject(p->test_finished, INFINITE);
3159  ok(res == WAIT_OBJECT_0, "Wait failed (%#x), last error %#x.\n", res, GetLastError());
3160 
3161  DestroyWindow(p->window);
3162  return 0;
3163 }
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
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 CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4290
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 ok(value,...)
Definition: atltest.h:57
#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 8089 of file win.c.

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

5666 {
5667  return DefWindowProcA(hwnd, msg, wparam, lparam);
5668 }
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 5670 of file win.c.

5671 {
5672  return DefWindowProcW(hwnd, msg, wparam, lparam);
5673 }
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 4736 of file win.c.

4737 {
4738  if (msg == WM_ENTERIDLE) {
4739  HWND dialog = (HWND)lparam;
4741  }
4742  return DefWindowProcA( hwnd, msg, wparam, lparam );
4743 }
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:1731
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:3605
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3602
POINT ptMaxSize
Definition: winuser.h:3603
long x
Definition: polytest.cpp:48
#define trace
Definition: atltest.h:70
POINT ptMaxPosition
Definition: winuser.h:3604
POINT ptMaxTrackSize
Definition: winuser.h:3606

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

7700 {
7701  DWORD i, size;
7702  RGNDATA *data = NULL;
7703  RECT *rect;
7704 
7705  if (!hrgn)
7706  {
7707  printf( "null region\n" );
7708  return;
7709  }
7710  if (!(size = GetRegionData( hrgn, 0, NULL ))) return;
7711  if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return;
7712  GetRegionData( hrgn, size, data );
7713  printf("%d rects:", data->rdh.nCount );
7714  for (i = 0, rect = (RECT *)data->Buffer; i < data->rdh.nCount; i++, rect++)
7715  printf( " %s", wine_dbgstr_rect( rect ));
7716  printf("\n");
7717  HeapFree( GetProcessHeap(), 0, data );
7718 }
& 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:403
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:402
#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 4339 of file win.c.

4340 {
4341  return 0;
4342 }

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

4389 {
4390  if (msg == WM_INITDIALOG)
4391  {
4393  struct dialog_param *param = (struct dialog_param *)lparam;
4394  BOOL parent_is_child;
4395  HWND disabled_hwnd;
4396  LRESULT id, ret;
4397 
4398  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4399  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4400  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x2222, 0);
4401  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4402  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4403  ok(id == MAKELONG(0x2222,DC_HASDEFID), "expected (0x2222,DC_HASDEFID), got %08lx\n", id);
4404 
4405  expected_id = MAKELONG(0x2222,DC_HASDEFID);
4406 
4407  parent_is_child = (GetWindowLongA(param->parent, GWL_STYLE) & (WS_POPUP | WS_CHILD)) == WS_CHILD;
4408 
4409  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4410  if (parent_is_child)
4411  {
4412  ok(IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
4413  disabled_hwnd = param->grand_parent;
4414  }
4415  else
4416  {
4417  ok(!IsWindowEnabled(param->parent), "wrong state for %08x\n", style);
4418  disabled_hwnd = param->parent;
4419  }
4420 
4421  if (param->grand_parent)
4422  {
4423  if (parent_is_child)
4424  ok(!IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
4425  else
4426  ok(IsWindowEnabled(param->grand_parent), "wrong state for %08x\n", style);
4427  }
4428 
4429  DialogBoxIndirectParamA(GetModuleHandleA(NULL), param->dlg_data, disabled_hwnd, empty_dlg_proc3, 0);
4430  ok(IsWindowEnabled(disabled_hwnd), "wrong state for %08x\n", style);
4431 
4432  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4433  ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
4434  if (param->grand_parent)
4435  ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
4436 
4438  ok(IsWindowEnabled(hwnd), "wrong state for %p\n", hwnd);
4439  ok(IsWindowEnabled(param->parent), "wrong state for %p\n", param->parent);
4440  if (param->grand_parent)
4441  ok(IsWindowEnabled(param->grand_parent), "wrong state for %p (%08x)\n", param->grand_parent, style);
4442 
4443  param->dlg_data->style |= WS_CHILD;
4445  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4446 
4447  param->dlg_data->style |= DS_CONTROL;
4449  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4450 
4451  param->dlg_data->dwExtendedStyle |= WS_EX_CONTROLPARENT;
4454  param->dlg_data->style &= ~DS_CONTROL;
4456  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4457 
4460  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4461 
4462  param->dlg_data->style |= DS_CONTROL;
4464  ok(IsWindowEnabled(hwnd), "wrong state for %p (%08x)\n", hwnd, style);
4465 
4466  EndDialog(hwnd, 0);
4467  }
4468  return 0;
4469 }
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:2081
#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:4346
#define DM_GETDEFID
Definition: winuser.h:2080
static LRESULT expected_id
Definition: win.c:4344
#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:2584
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#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:821
#define GWL_STYLE
Definition: winuser.h:846
#define DS_CONTROL
Definition: winuser.h:372
#define ok(value,...)
Definition: atltest.h:57
#define WS_POPUP
Definition: pedump.c:616
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:1721

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

4347 {
4348  if (msg == WM_INITDIALOG)
4349  {
4351  LRESULT id, ret;
4352 
4353  id = DefDlgProcA(parent, DM_GETDEFID, 0, 0);
4354  if (!id || root_dialog(hwnd) == hwnd)
4355  parent = 0;
4356 
4357  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4358  if (!parent)
4359  ok(id == MAKELONG(IDOK,DC_HASDEFID), "expected (IDOK,DC_HASDEFID), got %08lx\n", id);
4360  else
4361  ok(id == expected_id, "expected %08lx, got %08lx\n", expected_id, id);
4362 
4363  ret = DefDlgProcA(hwnd, DM_SETDEFID, 0x3333, 0);
4364  ok(ret, "DefDlgProc(DM_SETDEFID) failed\n");
4365  id = DefDlgProcA(hwnd, DM_GETDEFID, 0, 0);
4366  ok(id == MAKELONG(0x3333,DC_HASDEFID), "expected (0x3333,DC_HASDEFID), got %08lx\n", id);
4367 
4368  if (parent)
4369  {
4370  id = DefDlgProcA(parent, DM_GETDEFID, 0, 0);
4371  ok(id == MAKELONG(0x3333,DC_HASDEFID), "expected (0x3333,DC_HASDEFID), got %08lx\n", id);
4372 
4373  expected_id = MAKELONG(0x3333,DC_HASDEFID);
4374  }
4375 
4376  EndDialog(hwnd, 0);
4377  }
4378 
4379  return 0;
4380 }
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:4319
LRESULT WINAPI DefDlgProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DM_SETDEFID
Definition: winuser.h:2081
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define DM_GETDEFID
Definition: winuser.h:2080
static LRESULT expected_id
Definition: win.c:4344
#define DC_HASDEFID
Definition: winuser.h:2584
#define MAKELONG(a, b)
Definition: typedefs.h:248
r parent
Definition: btrfs.c:2869
int ret
HWND WINAPI GetParent(_In_ HWND)
#define ok(value,...)
Definition: atltest.h:57
#define msg(x)
Definition: auth_time.c:54
GLenum GLuint id
Definition: glext.h:5579
LONG_PTR LRESULT
Definition: windef.h:209
#define WM_INITDIALOG
Definition: winuser.h:1721

Referenced by empty_dlg_proc2().

◆ enum_proc()

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

Definition at line 671 of file win.c.

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

Referenced by enum_thread().

◆ enum_thread()

static DWORD CALLBACK enum_thread ( void arg)
static

Definition at line 677 of file win.c.

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

Referenced by test_enum_thread_windows().

◆ EnumChildProc()

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

Definition at line 185 of file win.c.

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

Referenced by test_parent_owner().

◆ EnumChildProc1()

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

Definition at line 194 of file win.c.

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

Referenced by test_parent_owner().

◆ FixedAdjustWindowRectEx()

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

Definition at line 995 of file win.c.

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

Referenced by test_nonclient_area().

◆ flush_events()

static void flush_events ( BOOL  remove_messages)
static

Definition at line 84 of file win.c.

85 {
86  MSG msg;
87  int diff = 200;
88  int min_timeout = 100;
89  DWORD time = GetTickCount() + diff;
90 
91  while (diff > 0)
92  {
93  if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break;
94  if (remove_messages)
95  while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg );
96  diff = time - GetTickCount();
97  min_timeout = 50;
98  }
99 }
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
__u16 time
Definition: mkdosfs.c:366
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
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 7341 of file win.c.

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

Referenced by test_fullscreen().

◆ get_window_attributes()

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

Definition at line 8182 of file win.c.

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

6579 {
6580  HWND hwnd = arg;
6581  char buf[32];
6582  INT buf_len;
6583 
6584  /* test GetWindowTextA */
6585  num_gettext_msgs = 0;
6586  memset( buf, 0, sizeof(buf) );
6587  buf_len = GetWindowTextA( hwnd, buf, sizeof(buf) );
6588  ok( buf_len != 0, "expected a nonempty window text\n" );
6589  ok( !strcmp(buf, "another_caption"), "got wrong window text '%s'\n", buf );
6590  ok( num_gettext_msgs == 1, "got %u WM_GETTEXT messages\n", num_gettext_msgs );
6591 
6592  return 0;
6593 }
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:1326
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void * arg
Definition: msvc.h:10
int32_t INT
Definition: typedefs.h:56
#define ok(value,...)
Definition: atltest.h:57
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_gettext().

◆ HMONITOR()

static HMONITOR ( WINAPI pMonitorFromPoint)
static

◆ HWND()

◆ ignore_message()

static BOOL ignore_message ( UINT  message)
static

Definition at line 173 of file win.c.

174 {
175  /* these are always ignored */
176  return (message >= 0xc000 ||
177  message == WM_GETICON ||
178  message == WM_GETOBJECT ||
179  message == WM_TIMER ||
180  message == WM_SYSTIMER ||
181  message == WM_TIMECHANGE ||
183 }
Definition: tftpd.h:59
#define WM_SYSTIMER
Definition: win.c:30
#define WM_TIMER
Definition: winuser.h:1724
#define WM_DEVICECHANGE
Definition: winuser.h:1793
#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 749 of file win.c.

750 {
751  switch (msg)
752  {
753  case WM_GETMINMAXINFO:
754  {
755  SetWindowLongPtrA(hwnd, GWLP_USERDATA, 0x20031021);
756  break;
757  }
759  {
760  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
761  if (!(winpos->flags & SWP_NOMOVE))
762  {
763  ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x);
764  ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y);
765  }
766  /* Win9x does not fixup cx/xy for WM_WINDOWPOSCHANGING */
767  if (!(winpos->flags & SWP_NOSIZE) && !is_win9x)
768  {
769  ok((winpos->cx >= 0 && winpos->cx <= 32767) ||
770  winpos->cx == 32768, /* win7 doesn't truncate */
771  "bad winpos->cx %d\n", winpos->cx);
772  ok((winpos->cy >= 0 && winpos->cy <= 32767) ||
773  winpos->cy == 40000, /* win7 doesn't truncate */
774  "bad winpos->cy %d\n", winpos->cy);
775  }
776  break;
777  }
778  case WM_WINDOWPOSCHANGED:
780  {
781  RECT rc1, rc2;
782  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
783  ok(winpos->x >= -32768 && winpos->x <= 32767, "bad winpos->x %d\n", winpos->x);
784  ok(winpos->y >= -32768 && winpos->y <= 32767, "bad winpos->y %d\n", winpos->y);
785 
786  ok((winpos->cx >= 0 && winpos->cx <= 32767) ||
787  winpos->cx == 32768, /* win7 doesn't truncate */
788  "bad winpos->cx %d\n", winpos->cx);
789  ok((winpos->cy >= 0 && winpos->cy <= 32767) ||
790  winpos->cy == 40000, /* win7 doesn't truncate */
791  "bad winpos->cy %d\n", winpos->cy);
792 
793  GetWindowRect(hwnd, &rc1);
794  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
795  /* note: winpos coordinates are relative to parent */
797  if (0)
798  {
799  /* Uncomment this once the test succeeds in all cases */
800  ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
802 
805  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
806  ok(EqualRect(&rc1, &rc2), "rects do not match %s / %s\n", wine_dbgstr_rect(&rc1),
808  }
809  break;
810  }
811  case WM_NCCREATE:
812  {
813  BOOL got_getminmaxinfo = GetWindowLongPtrA(hwnd, GWLP_USERDATA) == 0x20031021;
815 
816  if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
817  ok(got_getminmaxinfo, "main: WM_GETMINMAXINFO should have been received before WM_NCCREATE\n");
818  else
819  ok(!got_getminmaxinfo, "main: WM_GETMINMAXINFO should NOT have been received before WM_NCCREATE\n");
820  break;
821  }
822  case WM_COMMAND:
824  {
826  flush_events( FALSE );
827  }
828  break;
829  case WM_GETTEXT:
831  if (g_wm_gettext_override.enabled)
832  {
833  char *text = (char*)lparam;
834  ok(g_wm_gettext_override.buff == text, "expected buffer %p, got %p\n", g_wm_gettext_override.buff, text);
835  ok(*text == 0, "expected empty string buffer %x\n", *text);
836  return 0;
837  }
838  break;
839  case WM_SETTEXT:
841  break;
842  case WM_ACTIVATEAPP:
843  if (wparam) app_activated = TRUE;
844  else app_deactivated = TRUE;
845  break;
846  }
847 
848  return DefWindowProcA(hwnd, msg, wparam, lparam);
849 }
#define WS_THICKFRAME
Definition: pedump.c:630
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static DWORD num_gettext_msgs
Definition: win.c:58
#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 GWLP_USERDATA
Definition: treelist.c:63
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3569
#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:4803
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1643
const char * wine_dbgstr_rect(const RECT *rect)
#define disable_success_count
Definition: test.h:169
#define SetWindowLongPtrA
Definition: winuser.h:5320
#define WM_COMMAND
Definition: winuser.h:1722
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 ok(value,...)
Definition: atltest.h:57
#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 851 of file win.c.

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

Referenced by RegisterWindowClasses().

◆ mdi_child_wnd_proc_1()

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

Definition at line 1809 of file win.c.

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

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

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

2019 {
2020  static HWND mdi_client;
2021 
2022  switch (msg)
2023  {
2024  case WM_CREATE:
2025  return 1;
2026 
2027  case WM_WINDOWPOSCHANGED:
2028  {
2029  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
2030  RECT rc1, rc2;
2031 
2032  GetWindowRect(hwnd, &rc1);
2033  trace("window: %s\n", wine_dbgstr_rect(&rc1));
2034  SetRect(&rc2, winpos->x, winpos->y, winpos->x + winpos->cx, winpos->y + winpos->cy);
2035  /* note: winpos coordinates are relative to parent */
2037  trace("pos: %s\n", wine_dbgstr_rect(&rc2));
2038  ok(EqualRect(&rc1, &rc2), "rects do not match\n");
2039 
2040  GetWindowRect(hwnd, &rc1);
2041  GetClientRect(hwnd, &rc2);
2043  MapWindowPoints(0, hwnd, (LPPOINT)&rc1, 2);
2044  ok(EqualRect(&rc1, &rc2), "rects do not match\n");
2045  }
2046  /* fall through */
2047  case WM_WINDOWPOSCHANGING:
2048  {
2049  WINDOWPOS *winpos = (WINDOWPOS *)lparam;
2050  WINDOWPOS my_winpos = *winpos;
2051 
2052  trace("%s\n", (msg == WM_WINDOWPOSCHANGING) ? "WM_WINDOWPOSCHANGING" : "WM_WINDOWPOSCHANGED");
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 
2058 
2059  trace("%p after %p, x %d, y %d, cx %d, cy %d flags %08x\n",
2060  winpos->hwnd, winpos->hwndInsertAfter,
2061  winpos->x, winpos->y, winpos->cx, winpos->cy, winpos->flags);
2062 
2063  ok(!memcmp(&my_winpos, winpos, sizeof(WINDOWPOS)),
2064  "DefWindowProc should not change WINDOWPOS values\n");
2065 
2066  return 1;
2067  }
2068 
2069  case WM_CLOSE:
2070  PostQuitMessage(0);
2071  break;
2072  }
2074 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define WM_NCCALCSIZE
Definition: winuser.h:1667
LRESULT WINAPI DefFrameProcA(_In_ HWND, _In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND hwndInsertAfter
Definition: winuser.h:3564
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
LONG_PTR LPARAM
Definition: windef.h:208
UINT flags
Definition: winuser.h:3569
#define trace
Definition: atltest.h:70
#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:3643
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define ok(value,...)
Definition: atltest.h:57
#define WM_WINDOWPOSCHANGED
Definition: winuser.h: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:3563
__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 2076 of file win.c.

2077 {
2078  WNDCLASSA cls;
2079 
2080  cls.style = 0;
2082  cls.cbClsExtra = 0;
2083  cls.cbWndExtra = 0;
2084  cls.hInstance = GetModuleHandleA(0);
2085  cls.hIcon = 0;
2086  cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW);
2088  cls.lpszMenuName = NULL;
2089  cls.lpszClassName = "MDI_parent_Class";
2090  if(!RegisterClassA(&cls)) return FALSE;
2091 
2093  cls.lpszClassName = "MDI_child_Class_1";
2094  if(!RegisterClassA(&cls)) return FALSE;
2095 
2097  cls.lpszClassName = "MDI_child_Class_2";
2098  if(!RegisterClassA(&cls)) return FALSE;
2099 
2100  return TRUE;
2101 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRUE
Definition: types.h:120
int cbClsExtra
Definition: winuser.h:3140
LPCSTR lpszMenuName
Definition: winuser.h:3146
#define WHITE_BRUSH
Definition: wingdi.h:901
HBRUSH hbrBackground
Definition: winuser.h:3145
int cbWndExtra
Definition: winuser.h:3141
HCURSOR hCursor
Definition: winuser.h:3144
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:1809
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
LPCSTR lpszClassName
Definition: winuser.h:3147
HCURSOR WINAPI LoadCursorA(_In_opt_ HINSTANCE, _In_ LPCSTR)
Definition: cursoricon.c:2059
UINT style
Definition: winuser.h:3138
HINSTANCE hInstance
Definition: winuser.h:3142
static LRESULT WINAPI mdi_child_wnd_proc_2(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: win.c:1918
WNDPROC lpfnWndProc
Definition: winuser.h:3139
#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:2018
HICON hIcon
Definition: winuser.h:3143

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

5795 {
5796  MINMAXINFO *minmax;
5797 
5798  if (msg != WM_GETMINMAXINFO)
5799  return DefWindowProcA(hwnd, msg, wp, lp);
5800 
5801  minmax = (MINMAXINFO *)lp;
5802 
5804  {
5805  minmax->ptReserved.x = 0;
5806  minmax->ptReserved.y = 0;
5807  minmax->ptMaxSize.x = 400;
5808  minmax->ptMaxSize.y = 400;
5809  minmax->ptMaxPosition.x = 300;
5810  minmax->ptMaxPosition.y = 300;
5811  minmax->ptMaxTrackSize.x = 200;
5812  minmax->ptMaxTrackSize.y = 200;
5813  minmax->ptMinTrackSize.x = 100;
5814  minmax->ptMinTrackSize.y = 100;
5815  }
5816  else
5817  DefWindowProcA(hwnd, msg, wp, lp);
5818  return 1;
5819 }
POINT ptMinTrackSize
Definition: winuser.h:3605
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3602
POINT ptMaxSize
Definition: winuser.h:3603
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:3604
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:3606
#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 8078 of file win.c.

8079 {
8080  if (msg == WM_NCHITTEST) return HTTRANSPARENT;
8081  return DefWindowProcA(hwnd, msg, wp, lp);
8082 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define HTTRANSPARENT
Definition: winuser.h:2448
#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 8084 of file win.c.

8085 {
8086  return DefWindowProcA(hwnd, msg, wp, lp);
8087 }
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 3922 of file win.c.

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

Referenced by test_nccalcscroll().

◆ nccalcsize_proc()

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

Definition at line 2424 of file win.c.

2425 {
2426  if (msg == WM_NCCALCSIZE)
2427  {
2428  RECT *rect = (RECT *)lparam;
2429  /* first time around increase the rectangle, next time decrease it */
2430  if (rect->left == 100) InflateRect( rect, 10, 10 );
2431  else InflateRect( rect, -10, -10 );
2432  return 0;
2433  }
2434  return DefWindowProcA( hwnd, msg, wparam,