Index: ROSTests/apitests/user32/CMakeLists.txt
===================================================================
--- ROSTests/apitests/user32/CMakeLists.txt	(Revision 67187)
+++ ROSTests/apitests/user32/CMakeLists.txt	(Arbeitskopie)
@@ -2,6 +2,7 @@
 list(APPEND SOURCE
     AttachThreadInput.c
     helper.c
+    CreateDialog.c
     CreateIconFromResourceEx.c
     DeferWindowPos.c
     DestroyCursorIcon.c
Index: ROSTests/apitests/user32/CreateDialog.c
===================================================================
--- ROSTests/apitests/user32/CreateDialog.c	(Revision 0)
+++ ROSTests/apitests/user32/CreateDialog.c	(Arbeitskopie)
@@ -0,0 +1,214 @@
+/*
+ * PROJECT:         ReactOS api tests
+ * LICENSE:         GPL - See COPYING in the top level directory
+ * PURPOSE:         Test for CreateDialog
+ * PROGRAMMERS:     Andreas Maier
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <apitest.h>
+
+#include <wingdi.h>
+#include <winuser.h>
+
+//enable to "printf" MSG to Console
+//#define MSG_INFO
+
+#define TEST_MAX_MSG 50
+
+// cmpflag
+#define MSGLST_CMP_WP  0x1
+#define MSGLST_CMP_LP  0x2
+#define MSGLST_CMP_RES 0x4
+#define MSGLST_CMP_ALL (MSGLST_CMP_WP | MSGLST_CMP_LP | MSGLST_CMP_RES)
+
+typedef struct
+
+{
+    BOOL DlgProc; // true = DlgProg, false WndProc
+    UINT msg;
+    WPARAM wParam;
+    LPARAM lParam;
+    int result;
+    int cmpflag;
+} tagMsgInfo;
+typedef struct
+{
+    int msgCount;
+    tagMsgInfo msgList[TEST_MAX_MSG];
+} tagMsgList;
+tagMsgList msglist;
+
+/* the expected message-list */
+
+const tagMsgList t1msgList =
+{ msgCount: 9,
+  msgList:
+    {
+        // DlgProc, msg,              wParam,   lParam, result, cmpflag
+        {  FALSE,  WM_NCCREATE,            0,         0,     1, MSGLST_CMP_WP | MSGLST_CMP_RES },
+        {  FALSE,  WM_NCCALCSIZE,          0,         0,     0, MSGLST_CMP_WP | MSGLST_CMP_RES },
+        {  FALSE,  WM_CREATE,              0,         0,     0, MSGLST_CMP_WP | MSGLST_CMP_RES },
+        {  FALSE,  WM_SIZE,                0, 0x145012c,     0, MSGLST_CMP_ALL },
+        {  FALSE,  WM_MOVE,                0, 0x0160003,     0, MSGLST_CMP_ALL },
+        {  TRUE,   WM_SETFONT,             0,         0,     0, MSGLST_CMP_LP | MSGLST_CMP_RES },
+        {  FALSE,  WM_SETFONT,             0,         0,     0, MSGLST_CMP_LP | MSGLST_CMP_RES },
+        {  TRUE,   WM_INITDIALOG,          0,         0,     0, MSGLST_CMP_LP | MSGLST_CMP_RES },
+        {  FALSE,  WM_INITDIALOG,          0,         0,     0, MSGLST_CMP_LP | MSGLST_CMP_RES },
+    }
+};
+
+void DumpMsgList(const char* lstName, const tagMsgList ml)
+{
+    char *dlgProcName;
+    int i1;
+
+    printf("%s\n",lstName);
+    for (i1 = 0; i1 < ml.msgCount; i1++)
+    {
+        dlgProcName = (ml.msgList[i1].DlgProc)  ? "DlgProc" : "WndProc";
+        printf("#%.3d %s, msg 0x%lx, wParam 0x%lx, lParam 0x%lx, result %d\n",
+               i1,
+               dlgProcName,
+               (DWORD)ml.msgList[i1].msg,
+               (DWORD)ml.msgList[i1].wParam,
+               (DWORD)ml.msgList[i1].lParam,
+               ml.msgList[i1].result);
+    }
+}
+
+BOOL CmpMsgList(const tagMsgList recvd,
+                const tagMsgList expect)
+{
+    int i1;
+    BOOL isOk;
+
+    isOk = TRUE;
+    if (recvd.msgCount != expect.msgCount)
+    {
+        ok(FALSE,"%d messages expected, %d messages received!\n",
+           expect.msgCount,recvd.msgCount);
+        isOk = FALSE;
+    }
+    else
+    {
+        for (i1 = 0; i1 < recvd.msgCount; i1++)
+        {
+            if (expect.msgList[i1].DlgProc != recvd.msgList[i1].DlgProc)
+                isOk = FALSE;
+            if (expect.msgList[i1].msg != recvd.msgList[i1].msg)
+                isOk = FALSE;
+            if ((expect.msgList[i1].cmpflag & MSGLST_CMP_WP) &&
+                (expect.msgList[i1].wParam != recvd.msgList[i1].wParam))
+                isOk = FALSE;
+            if ((expect.msgList[i1].cmpflag & MSGLST_CMP_LP) &&
+                (expect.msgList[i1].lParam != recvd.msgList[i1].lParam))
+                isOk = FALSE;
+            if ((expect.msgList[i1].cmpflag & MSGLST_CMP_RES) &&
+                (expect.msgList[i1].result != recvd.msgList[i1].result))
+                isOk = FALSE;
+            if (!isOk)
+            {
+                ok(FALSE,"Message #%.3d not equal\n",i1);
+                break;
+            }
+        }
+    }
+
+    if (!isOk)
+    {
+        DumpMsgList("RECEIVED", recvd);
+        DumpMsgList("EXPECTED", expect);
+        return FALSE;
+    }
+
+    ok(TRUE,"\n");
+    return TRUE;
+}
+
+LRESULT CALLBACK Test_CreateDialogW_DLGPROC(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    if (msglist.msgCount < TEST_MAX_MSG)
+    {
+        msglist.msgList[msglist.msgCount].DlgProc = TRUE;
+        msglist.msgList[msglist.msgCount].msg     = msg;
+        msglist.msgList[msglist.msgCount].wParam  = wParam;
+        msglist.msgList[msglist.msgCount].lParam  = lParam;
+        msglist.msgList[msglist.msgCount].result  = 0;
+        msglist.msgCount++;
+    }
+    #ifdef MSG_INFO
+    printf("DlgProc: msg 0x%lx, wParam 0x%lx, lParam 0x%lx\n",
+           (DWORD)msg,(DWORD)wParam,lParam);
+    #endif
+    return FALSE;
+}
+
+LRESULT CALLBACK Test_CreateDialogW_WNDPROC(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    int res;
+    res = DefDlgProcW(hWnd,msg,wParam,lParam);
+
+    if (msglist.msgCount < TEST_MAX_MSG)
+    {
+        msglist.msgList[msglist.msgCount].DlgProc = FALSE;
+        msglist.msgList[msglist.msgCount].msg     = msg;
+        msglist.msgList[msglist.msgCount].wParam  = wParam;
+        msglist.msgList[msglist.msgCount].lParam  = lParam;
+        msglist.msgList[msglist.msgCount].result  = res;
+        msglist.msgCount++;
+    }
+    #ifdef MSG_INFO
+    printf("WndProc: msg 0x%lx, wParam 0x%lx, lParam 0x%lx, result %d\n",
+           (DWORD)msg,(DWORD)wParam,lParam,res);
+    #endif
+    return res;
+}
+
+void Test_CreateDialogW()
+{
+    HWND hWnd;
+    HMODULE hMod;
+    DWORD exstyle;
+    WNDCLASSW wc;
+
+    hMod = GetModuleHandle(NULL);
+    ok(hMod != NULL, "\n");
+
+    msglist.msgCount = 0;
+    wc.style         = CS_HREDRAW | CS_VREDRAW ;
+    wc.lpfnWndProc   = Test_CreateDialogW_WNDPROC;
+    wc.cbClsExtra    = 0;
+    wc.cbWndExtra    = DLGWINDOWEXTRA;
+    wc.hInstance     = hMod;
+    wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION) ;
+    wc.hCursor       = LoadCursor(NULL, IDC_ARROW) ;
+    wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1) ;
+    wc.lpszMenuName  = NULL;
+    wc.lpszClassName = L"TestDialogClass";
+
+    if (!RegisterClassW(&wc))
+    {
+         ok(FALSE,"Error registering Window-Class\n");
+         return;
+    }
+    hWnd = CreateDialogW(hMod,L"TESTDIALOG",0,(void*)Test_CreateDialogW_DLGPROC);
+    if (hWnd > 0)
+    {
+        ok(hWnd > 0, "\n");
+        /* Check the exstyle */
+        exstyle = GetWindowLongW(hWnd,GWL_EXSTYLE);
+        ok(exstyle != 0x50010, "ExStyle wrong, got %#08X, expected 0x50010.",(unsigned)exstyle);
+        /* Check the messages we received during creation */
+        CmpMsgList(msglist, t1msgList);
+    }
+    else
+        ok(hWnd > 0, "A-Error: %lu\n", GetLastError());
+}
+
+START_TEST(CreateDialog)
+{
+    //Test_CreateDialogA();//TODO
+    Test_CreateDialogW();
+}
Index: ROSTests/apitests/user32/testlist.c
===================================================================
--- ROSTests/apitests/user32/testlist.c	(Revision 67187)
+++ ROSTests/apitests/user32/testlist.c	(Arbeitskopie)
@@ -4,6 +4,7 @@
 #include <apitest.h>
 
 extern void func_AttachThreadInput(void);
+extern void func_CreateDialog(void);
 extern void func_CreateIconFromResourceEx(void);
 extern void func_DeferWindowPos(void);
 extern void func_DestroyCursorIcon(void);
@@ -34,6 +35,7 @@
 const struct test winetest_testlist[] =
 {
     { "AttachThreadInput", func_AttachThreadInput },
+    { "CreateDialog", func_CreateDialog },
     { "CreateIconFromResourceEx", func_CreateIconFromResourceEx },
     { "DeferWindowPos", func_DeferWindowPos },
     { "DestroyCursorIcon", func_DestroyCursorIcon },
Index: ROSTests/apitests/user32/user32_apitest.rc
===================================================================
--- ROSTests/apitests/user32/user32_apitest.rc	(Revision 67187)
+++ ROSTests/apitests/user32/user32_apitest.rc	(Arbeitskopie)
@@ -5,3 +5,11 @@
 
 IDI_TEST ICON "test.ico"
 TESTCURSOR CURSOR "test.cur"
+TESTDIALOG DIALOG 0,0, 200,200
+//STYLE DS_SHELLFONT | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+CLASS "TestDialogClass"
+CAPTION  "Testdialog"
+FONT 8, "MS Shell Dlg"
+{
+    PUSHBUTTON "a button", 1, 5,5, 100,20
+}
