ReactOS 0.4.15-dev-7961-gdcf9eb0
CreateWindowEx.c File Reference
#include "precomp.h"
Include dependency graph for CreateWindowEx.c:

Go to the source code of this file.

Macros

#define ok_hex_(expression, result)
 

Functions

static void Test_Params (void)
 
static int get_iwnd (HWND hWnd)
 
static LRESULT CALLBACK MSGTestProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static BOOL IsWindowsServer ()
 
static BOOL IsWindows8OrGreater ()
 
static void Test_Messages (void)
 
static LRESULT CALLBACK MSGChildProc2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK MSGTestProc2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void Test_Messages_Child (void)
 
static LRESULT CALLBACK MSGTestProcMDI (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void Test_Messages_MDI (void)
 
static LRESULT CALLBACK MSGTestProcMDI2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK MSGChildProcMDI2 (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
static void Test_Messages_MDI_Child (void)
 
 START_TEST (CreateWindowEx)
 

Variables

static HWND g_TestWindow = NULL
 
static HWND g_ChildWindow = NULL
 
static HWND g_hwndMDIClient = NULL
 
static DWORD g_FaultLine = 0
 
static DWORD g_NcExpectStyle = 0
 
static DWORD g_NcExpectExStyle = 0
 
static DWORD g_ExpectStyle = 0
 
static DWORD g_ExpectExStyle = 0
 
static DWORD g_ChildNcExpectStyle = 0
 
static DWORD g_ChildNcExpectExStyle = 0
 
static DWORD g_ChildExpectStyle = 0
 
static DWORD g_ChildExpectExStyle = 0
 
static int g_ChangeStyle = 0
 
static MSG_ENTRY create_chain []
 
static MSG_ENTRY create_chain_modify []
 
static MSG_ENTRY create_chain_modify_below8_nonsrv []
 
MSG_ENTRY child_create_chain []
 
MSG_ENTRY child_create_chain_modify []
 
MSG_ENTRY child_create_chain_modify_below8_nonsrv []
 
MSG_ENTRY create_chain_MDI []
 
static MSG_ENTRY child_create_chain_MDI []
 
static MSG_ENTRY child_create_chain_MDI_below8 []
 
static MSG_ENTRY child_create_chain_MDI_below8_nonsrv []
 

Macro Definition Documentation

◆ ok_hex_

#define ok_hex_ (   expression,
  result 
)
Value:
do { \
int _value = (expression); \
ok_(__FILE__, g_FaultLine)(_value == (result), "Wrong value for '%s', expected: " #result " (0x%x), got: 0x%x\n", \
#expression, (int)(result), _value); \
} while (0)
static DWORD g_FaultLine
GLuint64EXT * result
Definition: glext.h:11304

Definition at line 98 of file CreateWindowEx.c.

Function Documentation

◆ get_iwnd()

static int get_iwnd ( HWND  hWnd)
static

Definition at line 72 of file CreateWindowEx.c.

73{
74 if (!g_TestWindow)
78
79 if (hWnd == g_TestWindow)
80 return 1;
81 else if (hWnd == g_ChildWindow)
82 return 2;
83 return 0;
84}
static HWND g_ChildWindow
static HWND g_TestWindow
HWND hWnd
Definition: settings.c:17

Referenced by MSGChildProc2(), MSGChildProcMDI2(), MSGTestProc(), MSGTestProc2(), MSGTestProcMDI(), and MSGTestProcMDI2().

◆ IsWindows8OrGreater()

static BOOL IsWindows8OrGreater ( )
static

Definition at line 258 of file CreateWindowEx.c.

259{
260 OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0 };
261 DWORDLONG const dwlConditionMask = VerSetConditionMask(VerSetConditionMask(
265
268
270}
#define FALSE
Definition: types.h:117
BOOL WINAPI VerifyVersionInfoW(IN LPOSVERSIONINFOEXW lpVersionInformation, IN DWORD dwTypeMask, IN DWORDLONG dwlConditionMask)
Definition: version.c:118
unsigned long long DWORDLONG
Definition: intsafe.h:93
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define VER_MAJORVERSION
Definition: rtltypes.h:229
#define VER_GREATER_EQUAL
Definition: rtltypes.h:241
#define VER_MINORVERSION
Definition: rtltypes.h:228
#define VER_SERVICEPACKMAJOR
Definition: rtltypes.h:233
ULONGLONG NTAPI VerSetConditionMask(IN ULONGLONG ConditionMask, IN ULONG TypeMask, IN UCHAR Condition)
Definition: version.c:262
#define _WIN32_WINNT_WIN8
Definition: sdkddkver.h:29
ULONG dwMajorVersion
Definition: rtltypes.h:238
ULONG dwMinorVersion
Definition: rtltypes.h:239
OSVERSIONINFO osvi
Definition: ver.c:28

Referenced by expect_empty_imp(), Test_Messages(), Test_Messages_Child(), and Test_Messages_MDI_Child().

◆ IsWindowsServer()

static BOOL IsWindowsServer ( )
static

Definition at line 248 of file CreateWindowEx.c.

249{
250 OSVERSIONINFOEXW osvi = { sizeof(osvi), 0, 0, 0, 0, {0}, 0, 0, 0, VER_NT_WORKSTATION };
251 DWORDLONG const dwlConditionMask = VerSetConditionMask( 0, VER_PRODUCT_TYPE, VER_EQUAL );
252
253 return !VerifyVersionInfoW(&osvi, VER_PRODUCT_TYPE, dwlConditionMask);
254}
#define VER_EQUAL
Definition: rtltypes.h:239
#define VER_PRODUCT_TYPE
Definition: rtltypes.h:235
#define VER_NT_WORKSTATION

Referenced by AboutDlgProc(), Test_Messages(), Test_Messages_Child(), and Test_Messages_MDI_Child().

◆ MSGChildProc2()

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

Definition at line 335 of file CreateWindowEx.c.

336{
337 LRESULT lRet;
338 int iwnd = get_iwnd(hWnd);
339
340 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
342
343 switch(message)
344 {
346 case WM_IME_NOTIFY:
347 case WM_GETICON:
348 case WM_GETTEXT:
350 break;
351 case WM_NCCREATE:
352 {
354 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
357
358 if (g_ChangeStyle)
359 {
361 dwStyle &= ~(WS_EX_CLIENTEDGE);
363 RECORD_MESSAGE(iwnd, message, MARKER, 0, 0);
364 SetWindowPos(g_TestWindow, NULL, 0, 0, 0, 0,
366
367 RECORD_MESSAGE(iwnd, message, MARKER, 0, 0);
370 }
371 }
372 break;
373 case WM_CREATE:
374 {
376 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
379 }
380 break;
381 case WM_NCCALCSIZE:
382 case WM_STYLECHANGING:
383 case WM_STYLECHANGED:
384 case WM_SIZE:
385 RECORD_MESSAGE(iwnd, message, SENT, wParam, 0);
386 break;
389 ok(wParam == 0,"expected wParam=0\n");
391 break;
392 default:
393 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
394 break;
395 }
397 RECORD_MESSAGE(iwnd, message, SENT_RET, 0, 0);
398 return lRet;
399}
static DWORD g_ChildExpectStyle
static DWORD g_ChildNcExpectStyle
static DWORD g_ChildExpectExStyle
static int g_ChangeStyle
static int get_iwnd(HWND hWnd)
#define ok_hex_(expression, result)
static DWORD g_ChildNcExpectExStyle
#define ok(value,...)
Definition: atltest.h:57
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
static const struct access_res create[16]
Definition: package.c:7644
static BOOL IsDWmMsg(UINT msg)
Definition: msgtrace.h:39
#define RECORD_MESSAGE(...)
Definition: msgtrace.h:60
@ MARKER
Definition: msgtrace.h:11
@ SENT_RET
Definition: msgtrace.h:10
@ SENT
Definition: msgtrace.h:6
static BOOL IseKeyMsg(UINT msg)
Definition: msgtrace.h:52
#define DefWindowProc
Definition: ros2win.h:31
Definition: tftpd.h:60
LONG_PTR LRESULT
Definition: windef.h:209
#define SetWindowLong
Definition: winuser.h:5853
#define SWP_NOACTIVATE
Definition: winuser.h:1242
CREATESTRUCTA * LPCREATESTRUCT
Definition: winuser.h:5726
#define WM_IME_NOTIFY
Definition: winuser.h:1830
#define WM_WINDOWPOSCHANGING
Definition: winuser.h:1661
#define WM_CREATE
Definition: winuser.h:1608
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_DRAWFRAME
Definition: winuser.h:1239
#define WM_SIZE
Definition: winuser.h:1611
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_NOSIZE
Definition: winuser.h:1245
#define WM_GETTEXT
Definition: winuser.h:1618
#define WM_NCCREATE
Definition: winuser.h:1683
#define WM_IME_SETCONTEXT
Definition: winuser.h:1829
#define GetWindowLong
Definition: winuser.h:5796
#define WM_USER
Definition: winuser.h:1895
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define SWP_NOZORDER
Definition: winuser.h:1247
#define WM_NCCALCSIZE
Definition: winuser.h:1685
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1662
#define GWL_EXSTYLE
Definition: winuser.h:851

Referenced by Test_Messages_Child().

◆ MSGChildProcMDI2()

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

Definition at line 834 of file CreateWindowEx.c.

835{
836 LRESULT lRet;
837 int iwnd = get_iwnd(hWnd);
838
839 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
841
842 switch(message)
843 {
845 case WM_IME_NOTIFY:
846 case WM_GETICON:
847 case WM_GETTEXT:
849 break;
850 case WM_NCCREATE:
851 {
853 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
856 }
857 break;
858 case WM_CREATE:
859 {
861 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
864 }
865 break;
866 case WM_NCCALCSIZE:
867 case WM_STYLECHANGING:
868 case WM_STYLECHANGED:
869 case WM_SIZE:
870 RECORD_MESSAGE(iwnd, message, SENT, wParam, 0);
871 break;
874 ok(wParam == 0,"expected wParam=0\n");
876 break;
877 default:
878 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
879 break;
880 }
882 RECORD_MESSAGE(iwnd, message, SENT_RET, 0, 0);
883 return lRet;
884}
#define DefMDIChildProc
Definition: ros2win.h:33

Referenced by Test_Messages_MDI_Child().

◆ MSGTestProc()

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

Definition at line 108 of file CreateWindowEx.c.

109{
110 LRESULT lRet;
111 int iwnd = get_iwnd(hWnd);
112
113 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
115
116 switch(message)
117 {
119 case WM_IME_NOTIFY:
120 case WM_GETICON:
121 case WM_GETTEXT:
123 break;
124 case WM_NCCREATE:
125 {
127 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
129 ok_hex_(create->dwExStyle, g_NcExpectExStyle);
130 if (g_ChangeStyle)
131 {
133 dwStyle &= ~(WS_EX_CLIENTEDGE);
134 SetWindowLong(hWnd, GWL_EXSTYLE, dwStyle);
135 RECORD_MESSAGE(iwnd, message, MARKER, 0, 0);
136 SetWindowPos(hWnd, NULL, 0, 0, 0, 0,
138
139 RECORD_MESSAGE(iwnd, message, MARKER, 0, 0);
141 ok_hex_(create->dwExStyle, g_NcExpectExStyle);
142 }
143 }
144 break;
145 case WM_CREATE:
146 {
148 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
150 ok_hex_(create->dwExStyle, g_ExpectExStyle);
151 }
152 break;
153 case WM_NCCALCSIZE:
154 case WM_STYLECHANGING:
155 case WM_STYLECHANGED:
156 case WM_SIZE:
157 RECORD_MESSAGE(iwnd, message, SENT, wParam, 0);
158 break;
161 ok(wParam == 0,"expected wParam=0\n");
163 break;
164 default:
165 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
166 break;
167 }
169 RECORD_MESSAGE(iwnd, message, SENT_RET, 0, 0);
170 return lRet;
171}
static DWORD g_NcExpectExStyle
static DWORD g_ExpectStyle
static DWORD g_NcExpectStyle
static DWORD g_ExpectExStyle

Referenced by Test_Messages().

◆ MSGTestProc2()

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

Definition at line 402 of file CreateWindowEx.c.

403{
404 LRESULT lRet;
405 int iwnd = get_iwnd(hWnd);
406
407 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
409
410 switch(message)
411 {
413 case WM_IME_NOTIFY:
414 case WM_GETICON:
415 case WM_GETTEXT:
417 break;
418 case WM_NCCREATE:
419 {
420 HWND child;
422 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
424 ok_hex_(create->dwExStyle, g_NcExpectExStyle);
425
426 child = CreateWindowExW(0, L"Test_Message_Window_Child2", L"", WS_CHILD, 0, 0, 10, 10, hWnd, NULL, 0, NULL);
427 RECORD_MESSAGE(iwnd, message, MARKER, 0, 0);
428 ok_(__FILE__, g_FaultLine)(g_ChildWindow == child, "Testing against the wrong child!\n");
429 }
430 break;
431 case WM_NCDESTROY:
432 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
434 break;
435 case WM_CREATE:
436 {
438 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
440 ok_hex_(create->dwExStyle, g_ExpectExStyle);
441 }
442 break;
443 case WM_NCCALCSIZE:
444 case WM_STYLECHANGING:
445 case WM_STYLECHANGED:
446 case WM_SIZE:
447 RECORD_MESSAGE(iwnd, message, SENT, wParam, 0);
448 break;
451 ok(wParam == 0,"expected wParam=0\n");
453 break;
454 default:
455 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
456 break;
457 }
459 RECORD_MESSAGE(iwnd, message, SENT_RET, 0, 0);
460 return lRet;
461}
#define ok_(x1, x2)
Definition: atltest.h:61
static HWND child
Definition: cursoricon.c:298
#define L(x)
Definition: ntvdm.h:50
#define WS_CHILD
Definition: pedump.c:617
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WM_NCDESTROY
Definition: winuser.h:1684
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by Test_Messages_Child().

◆ MSGTestProcMDI()

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

Definition at line 652 of file CreateWindowEx.c.

653{
654 LRESULT lRet;
655 int iwnd = get_iwnd(hWnd);
656
657 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
659
660 switch(message)
661 {
663 case WM_IME_NOTIFY:
664 case WM_GETICON:
665 case WM_GETTEXT:
667 break;
668 case WM_NCCREATE:
669 {
671 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
673 ok_hex_(create->dwExStyle, g_NcExpectExStyle);
674 }
675 break;
676 case WM_CREATE:
677 {
678 CLIENTCREATESTRUCT ccs = { 0 };
680 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
682 ok_hex_(create->dwExStyle, g_ExpectExStyle);
683
684 g_hwndMDIClient = CreateWindow("MDICLIENT", (LPCTSTR) NULL,
686 0, 0, 0, 0, hWnd, (HMENU) 0xCAC, NULL, (LPSTR) &ccs);
687
689
690 }
691 break;
692 case WM_NCCALCSIZE:
693 case WM_STYLECHANGING:
694 case WM_STYLECHANGED:
695 case WM_SIZE:
696 RECORD_MESSAGE(iwnd, message, SENT, wParam, 0);
697 break;
700 ok(wParam == 0,"expected wParam=0\n");
702 break;
703 default:
704 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
705 break;
706 }
708 RECORD_MESSAGE(iwnd, message, SENT_RET, 0, 0);
709 return lRet;
710}
static HWND g_hwndMDIClient
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_HSCROLL
Definition: pedump.c:628
#define WS_CLIPCHILDREN
Definition: pedump.c:619
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define CreateWindow
Definition: winuser.h:5754
#define SW_SHOW
Definition: winuser.h:775
char * LPSTR
Definition: xmlstorage.h:182
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Referenced by Test_Messages_MDI().

◆ MSGTestProcMDI2()

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

Definition at line 761 of file CreateWindowEx.c.

762{
763 LRESULT lRet;
764 int iwnd = get_iwnd(hWnd);
765
766 if(message > WM_USER || !iwnd || IsDWmMsg(message) || IseKeyMsg(message))
768
769 switch(message)
770 {
772 case WM_IME_NOTIFY:
773 case WM_GETICON:
774 case WM_GETTEXT:
776 break;
777 case WM_NCCREATE:
778 {
780 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
782 ok_hex_(create->dwExStyle, g_NcExpectExStyle);
783 }
784 break;
785 case WM_CREATE:
786 {
787 MDICREATESTRUCT mcs = {0};
788 CLIENTCREATESTRUCT ccs = { 0 };
790 HWND hchild;
791 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
793 ok_hex_(create->dwExStyle, g_ExpectExStyle);
794
795
796 g_hwndMDIClient = CreateWindow("MDICLIENT", (LPCTSTR) NULL,
798 0, 0, 0, 0, hWnd, (HMENU) 0xCAC, NULL, (LPSTR) &ccs);
799
801
802
803 mcs.szClass = "Test_Message_MDI_Window_Child2";
804 mcs.x = mcs.cx = CW_USEDEFAULT;
805 mcs.y = mcs.cy = CW_USEDEFAULT;
806 mcs.style = WS_MAXIMIZE;
807
809 (LPARAM)&mcs);
810 ok(hchild == g_ChildWindow, "We are testing with %p instead of %p\n", g_ChildWindow, hchild);
811
812 }
813 break;
814 case WM_NCCALCSIZE:
815 case WM_STYLECHANGING:
816 case WM_STYLECHANGED:
817 case WM_SIZE:
818 RECORD_MESSAGE(iwnd, message, SENT, wParam, 0);
819 break;
822 ok(wParam == 0,"expected wParam=0\n");
824 break;
825 default:
826 RECORD_MESSAGE(iwnd, message, SENT, 0, 0);
827 break;
828 }
830 RECORD_MESSAGE(iwnd, message, SENT_RET, 0, 0);
831 return lRet;
832}
static struct myctx * mcs
Definition: adnstest.c:53
HANDLE HWND
Definition: compat.h:19
#define WS_MAXIMIZE
Definition: pedump.c:623
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_MDICREATE
Definition: winuser.h:1812
#define SendMessage
Definition: winuser.h:5843
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by Test_Messages_MDI_Child().

◆ START_TEST()

START_TEST ( CreateWindowEx  )

Definition at line 1129 of file CreateWindowEx.c.

1130{
1131 Test_Params();
1132 Test_Messages();
1136}
static void Test_Messages(void)
static void Test_Messages_MDI_Child(void)
static void Test_Messages_Child(void)
static void Test_Messages_MDI(void)
static void Test_Params(void)

◆ Test_Messages()

static void Test_Messages ( void  )
static

Definition at line 272 of file CreateWindowEx.c.

273{
274 HWND hWnd;
275 BOOL Below8NonServer = !IsWindows8OrGreater() && !IsWindowsServer();
276
277 RegisterSimpleClass(MSGTestProc, L"Test_Message_Window_XX");
278
279 g_ChangeStyle = 0;
280
283 g_FaultLine = __LINE__ + 1;
284 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_XX", L"", 0, 10, 20,
285 200, 210, NULL, NULL, 0, NULL);
286
287 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
291 EMPTY_CACHE();
292
295 g_FaultLine = __LINE__ + 1;
296 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_XX", L"", WS_OVERLAPPEDWINDOW, 10, 20,
297 200, 210, NULL, NULL, 0, NULL);
298
299 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
303 EMPTY_CACHE();
304
305 g_ChangeStyle = 1;
306
309 g_FaultLine = __LINE__ + 1;
310 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_XX", L"", 0, 10, 20,
311 200, 210, NULL, NULL, 0, NULL);
312
313 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
317 EMPTY_CACHE();
318
321 g_FaultLine = __LINE__ + 1;
322 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_XX", L"", WS_OVERLAPPEDWINDOW, 10, 20,
323 200, 210, NULL, NULL, 0, NULL);
324
325 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
329 EMPTY_CACHE();
330
331 UnregisterClassW(L"Test_Message_Window_XX", NULL);
332}
static BOOL IsWindowsServer()
static MSG_ENTRY create_chain_modify_below8_nonsrv[]
static BOOL IsWindows8OrGreater()
static LRESULT CALLBACK MSGTestProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
static MSG_ENTRY create_chain_modify[]
static MSG_ENTRY create_chain[]
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EMPTY_CACHE()
Definition: msgtrace.h:59
#define COMPARE_CACHE(msg_chain)
Definition: msgtrace.h:57
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
static __inline ATOM RegisterSimpleClass(WNDPROC lpfnWndProc, LPCWSTR lpszClassName)
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define WS_EX_OVERLAPPEDWINDOW
Definition: winuser.h:398

Referenced by START_TEST().

◆ Test_Messages_Child()

static void Test_Messages_Child ( void  )
static

Definition at line 578 of file CreateWindowEx.c.

579{
580 HWND hWnd;
581 BOOL Below8NonServer = !IsWindows8OrGreater() && !IsWindowsServer();
582
583 RegisterSimpleClass(MSGTestProc2, L"Test_Message_Window_X2");
584 RegisterSimpleClass(MSGChildProc2, L"Test_Message_Window_Child2");
585
586 g_ChangeStyle = 0;
587
592 g_FaultLine = __LINE__ + 1;
593 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_X2", L"", 0, 10, 20,
594 200, 210, NULL, NULL, 0, NULL);
595
596 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
600 EMPTY_CACHE();
601
606 g_FaultLine = __LINE__ + 1;
607 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_X2", L"", WS_OVERLAPPEDWINDOW, 10, 20,
608 200, 210, NULL, NULL, 0, NULL);
609
610 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
614 EMPTY_CACHE();
615
616 g_ChangeStyle = 1;
617
622 g_FaultLine = __LINE__ + 1;
623 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_X2", L"", 0, 10, 20,
624 200, 210, NULL, NULL, 0, NULL);
625
626 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
630 EMPTY_CACHE();
631
636 g_FaultLine = __LINE__ + 1;
637 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_X2", L"", WS_OVERLAPPEDWINDOW, 10, 20,
638 200, 210, NULL, NULL, 0, NULL);
639
640 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
644 EMPTY_CACHE();
645
646 UnregisterClassW(L"Test_Message_Window_X2", NULL);
647 UnregisterClassW(L"Test_Message_Window_Child2", NULL);
648}
MSG_ENTRY child_create_chain[]
MSG_ENTRY child_create_chain_modify_below8_nonsrv[]
static LRESULT CALLBACK MSGTestProc2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
MSG_ENTRY child_create_chain_modify[]
static LRESULT CALLBACK MSGChildProc2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

Referenced by START_TEST().

◆ Test_Messages_MDI()

static void Test_Messages_MDI ( void  )
static

Definition at line 727 of file CreateWindowEx.c.

728{
729 HWND hWnd;
730
731 RegisterSimpleClass(MSGTestProcMDI, L"Test_Message_Window_MDI_XX");
732
735 g_FaultLine = __LINE__ + 1;
736 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_MDI_XX", L"", 0, 10, 20,
737 200, 210, NULL, NULL, 0, NULL);
738
739 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
743 EMPTY_CACHE();
744
747 g_FaultLine = __LINE__ + 1;
748 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_Window_MDI_XX", L"", WS_OVERLAPPEDWINDOW, 10, 20,
749 200, 210, NULL, NULL, 0, NULL);
750
751 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
755 EMPTY_CACHE();
756
757 UnregisterClassW(L"Test_Message_Window_MDI_XX", NULL);
758}
static LRESULT CALLBACK MSGTestProcMDI(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
MSG_ENTRY create_chain_MDI[]

Referenced by START_TEST().

◆ Test_Messages_MDI_Child()

static void Test_Messages_MDI_Child ( void  )
static

Definition at line 1086 of file CreateWindowEx.c.

1087{
1088 HWND hWnd;
1089
1090 BOOL Below8 = !IsWindows8OrGreater();
1091 BOOL Below8NonServer = !IsWindows8OrGreater() && !IsWindowsServer();
1092
1093 RegisterSimpleClass(MSGTestProcMDI2, L"Test_Message_MDI_Window_X2");
1094 RegisterSimpleClass(MSGChildProcMDI2, L"Test_Message_MDI_Window_Child2");
1095
1100 g_FaultLine = __LINE__ + 1;
1101 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_MDI_Window_X2", L"", 0, 10, 20,
1102 200, 210, NULL, NULL, 0, NULL);
1103
1104 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
1108 EMPTY_CACHE();
1109
1114 g_FaultLine = __LINE__ + 1;
1115 hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Test_Message_MDI_Window_X2", L"", WS_OVERLAPPEDWINDOW, 10, 20,
1116 200, 210, NULL, NULL, 0, NULL);
1117
1118 ok(hWnd == g_TestWindow, "We are testing with %p instead of %p\n", g_TestWindow, hWnd);
1122 EMPTY_CACHE();
1123
1124 UnregisterClassW(L"Test_Message_Window_X2", NULL);
1125 UnregisterClassW(L"Test_Message_MDI_Window_Child2", NULL);
1126}
static LRESULT CALLBACK MSGTestProcMDI2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK MSGChildProcMDI2(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
static MSG_ENTRY child_create_chain_MDI_below8[]
static MSG_ENTRY child_create_chain_MDI[]
static MSG_ENTRY child_create_chain_MDI_below8_nonsrv[]
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407

Referenced by START_TEST().

◆ Test_Params()

static void Test_Params ( void  )
static

Definition at line 11 of file CreateWindowEx.c.

12{
13 HWND hWnd;
14 DWORD dwError;
15
16 SetLastError(0x1234);
17 hWnd = CreateWindowExW(0, L"BUTTON", NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
18 dwError = GetLastError();
19 ok(hWnd != NULL, "hWnd = %p\n", hWnd);
20 ok(dwError == 0, "error = %lu\n", dwError);
22
23 SetLastError(0x1234);
24 hWnd = CreateWindowExW(0, L"BUTTON", NULL, 0, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
25 dwError = GetLastError();
26 ok(hWnd == NULL, "hWnd = %p\n", hWnd);
27 ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
28
29 SetLastError(0x1234);
30 hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
31 dwError = GetLastError();
32 ok(hWnd == NULL, "hWnd = %p\n", hWnd);
33 ok(dwError == ERROR_TLW_WITH_WSCHILD, "error = %lu\n", dwError);
34
35 SetLastError(0x1234);
36 hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
37 dwError = GetLastError();
38 ok(hWnd == NULL, "hWnd = %p\n", hWnd);
39 ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
40
41 SetLastError(0x1234);
42 hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
43 dwError = GetLastError();
44 ok(hWnd != NULL, "hWnd = %p\n", hWnd);
45 ok(dwError == 0, "error = %lu\n", dwError);
47
48 SetLastError(0x1234);
49 hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_POPUP, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
50 dwError = GetLastError();
51 ok(hWnd == NULL, "hWnd = %p\n", hWnd);
52 ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
53
54 SetLastError(0x1234);
55 hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD|WS_POPUP, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
56 dwError = GetLastError();
57 ok(hWnd != NULL, "hWnd = %p\n", hWnd);
58 ok(dwError == 0, "error = %lu\n", dwError);
60
61 SetLastError(0x1234);
62 hWnd = CreateWindowExW(0, L"BUTTON", NULL, WS_CHILD|WS_POPUP, 0, 0, 0, 0, (HWND)(LONG_PTR)-1, NULL, NULL, NULL);
63 dwError = GetLastError();
64 ok(hWnd == NULL, "hWnd = %p\n", hWnd);
65 ok(dwError == ERROR_INVALID_WINDOW_HANDLE, "error = %lu\n", dwError);
66}
#define SetLastError(x)
Definition: compat.h:752
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define WS_POPUP
Definition: pedump.c:616
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define ERROR_TLW_WITH_WSCHILD
Definition: winerror.h:887
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881

Referenced by START_TEST().

Variable Documentation

◆ child_create_chain

MSG_ENTRY child_create_chain[]
Initial value:
=
{
{ 1, WM_NCCREATE, SENT },
{ 2, WM_NCCREATE, SENT },
{ 2, WM_CREATE, SENT },
{ 2, WM_SIZE, SENT },
{ 2, WM_SIZE, SENT_RET },
{ 2, WM_MOVE, SENT },
{ 2, WM_MOVE, SENT_RET },
{ 1, WM_CREATE, SENT },
{ 0, 0 }
}
#define WM_GETMINMAXINFO
Definition: winuser.h:1640
#define WM_MOVE
Definition: winuser.h:1610
#define WM_PARENTNOTIFY
Definition: winuser.h:1803

Definition at line 464 of file CreateWindowEx.c.

Referenced by Test_Messages_Child().

◆ child_create_chain_MDI

MSG_ENTRY child_create_chain_MDI[]
static

Definition at line 887 of file CreateWindowEx.c.

Referenced by Test_Messages_MDI_Child().

◆ child_create_chain_MDI_below8

MSG_ENTRY child_create_chain_MDI_below8[]
static

Definition at line 952 of file CreateWindowEx.c.

Referenced by Test_Messages_MDI_Child().

◆ child_create_chain_MDI_below8_nonsrv

MSG_ENTRY child_create_chain_MDI_below8_nonsrv[]
static

Definition at line 1017 of file CreateWindowEx.c.

Referenced by Test_Messages_MDI_Child().

◆ child_create_chain_modify

MSG_ENTRY child_create_chain_modify[]

Definition at line 490 of file CreateWindowEx.c.

Referenced by Test_Messages_Child().

◆ child_create_chain_modify_below8_nonsrv

MSG_ENTRY child_create_chain_modify_below8_nonsrv[]

Definition at line 532 of file CreateWindowEx.c.

Referenced by Test_Messages_Child().

◆ create_chain

MSG_ENTRY create_chain[]
static
Initial value:
=
{
{ 1, WM_NCCREATE, SENT },
{ 1, WM_CREATE, SENT },
{ 0, 0 }
}

Definition at line 173 of file CreateWindowEx.c.

Referenced by dir_next(), f_lseek(), f_mkdir(), f_write(), and Test_Messages().

◆ create_chain_MDI

MSG_ENTRY create_chain_MDI[]
Initial value:

Definition at line 712 of file CreateWindowEx.c.

Referenced by Test_Messages_MDI().

◆ create_chain_modify

MSG_ENTRY create_chain_modify[]
static
Initial value:
=
{
{ 1, WM_NCCREATE, SENT },
{ 1, WM_STYLECHANGING, SENT, GWL_EXSTYLE },
{ 1, WM_STYLECHANGING, SENT_RET },
{ 1, WM_STYLECHANGED, SENT, GWL_EXSTYLE },
{ 1, WM_STYLECHANGED, SENT_RET },
{ 1, WM_MOVE, SENT },
{ 1, WM_MOVE, SENT_RET },
{ 1, WM_SIZE, SENT },
{ 1, WM_SIZE, SENT_RET },
{ 1, WM_CREATE, SENT },
{ 0, 0 }
}
#define TRUE
Definition: types.h:120
#define SWP_NOREDRAW
Definition: winuser.h:1246
#define SWP_FRAMECHANGED
Definition: winuser.h:1240

Definition at line 186 of file CreateWindowEx.c.

Referenced by Test_Messages().

◆ create_chain_modify_below8_nonsrv

MSG_ENTRY create_chain_modify_below8_nonsrv[]
static
Initial value:
=
{
{ 1, WM_NCCREATE, SENT },
{ 1, WM_STYLECHANGING, SENT, GWL_EXSTYLE },
{ 1, WM_STYLECHANGING, SENT_RET },
{ 1, WM_STYLECHANGED, SENT, GWL_EXSTYLE },
{ 1, WM_STYLECHANGED, SENT_RET },
{ 1, WM_MOVE, SENT },
{ 1, WM_MOVE, SENT_RET },
{ 1, WM_SIZE, SENT },
{ 1, WM_SIZE, SENT_RET },
{ 1, WM_CREATE, SENT },
{ 0, 0 }
}

Definition at line 215 of file CreateWindowEx.c.

Referenced by Test_Messages().

◆ g_ChangeStyle

int g_ChangeStyle = 0
static

Definition at line 107 of file CreateWindowEx.c.

Referenced by MSGChildProc2(), MSGTestProc(), Test_Messages(), and Test_Messages_Child().

◆ g_ChildExpectExStyle

DWORD g_ChildExpectExStyle = 0
static

◆ g_ChildExpectStyle

DWORD g_ChildExpectStyle = 0
static

◆ g_ChildNcExpectExStyle

DWORD g_ChildNcExpectExStyle = 0
static

◆ g_ChildNcExpectStyle

DWORD g_ChildNcExpectStyle = 0
static

◆ g_ChildWindow

◆ g_ExpectExStyle

◆ g_ExpectStyle

◆ g_FaultLine

DWORD g_FaultLine = 0
static

◆ g_hwndMDIClient

HWND g_hwndMDIClient = NULL
static

Definition at line 70 of file CreateWindowEx.c.

Referenced by MSGTestProcMDI(), MSGTestProcMDI2(), and Test_Messages_MDI().

◆ g_NcExpectExStyle

◆ g_NcExpectStyle

◆ g_TestWindow