comctl32/tests: InitCommonControlsEx() is missing on Windows 95 so call InitCommonControls() instead.

Francois Gouget fgouget at free.fr
Sun Dec 9 18:27:50 CST 2007


---
There does not seem to be any real difference between those two anyway: 
in Wine both do nothing and all the relevant classes are registered in 
DllMain(). According to Wine's code the same is true of recent Windows 
comctl32. Now we'll see if there's a problem on some 
intermediate Windows version somewhere.

 dlls/comctl32/tests/comboex.c  |    5 +----
 dlls/comctl32/tests/datetime.c |    6 +-----
 dlls/comctl32/tests/header.c   |    5 +----
 dlls/comctl32/tests/listview.c |    6 +-----
 dlls/comctl32/tests/monthcal.c |    6 ++----
 dlls/comctl32/tests/progress.c |    5 +----
 dlls/comctl32/tests/rebar.c    |    5 +----
 dlls/comctl32/tests/treeview.c |    5 +----
 8 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/dlls/comctl32/tests/comboex.c b/dlls/comctl32/tests/comboex.c
index 8f436ca..f3f46b3 100644
--- a/dlls/comctl32/tests/comboex.c
+++ b/dlls/comctl32/tests/comboex.c
@@ -189,11 +189,8 @@ static LRESULT CALLBACK ComboExTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, L
 
 static void init(void) {
     WNDCLASSA wc;
-    INITCOMMONCONTROLSEX icex;
 
-    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
-    icex.dwICC   = ICC_USEREX_CLASSES;
-    InitCommonControlsEx(&icex);
+    InitCommonControls();
 
     wc.style = CS_HREDRAW | CS_VREDRAW;
     wc.cbClsExtra = 0;
diff --git a/dlls/comctl32/tests/datetime.c b/dlls/comctl32/tests/datetime.c
index 1a8afd1..956f16e 100644
--- a/dlls/comctl32/tests/datetime.c
+++ b/dlls/comctl32/tests/datetime.c
@@ -560,11 +560,7 @@ static void test_datetime_control(void)
 
 START_TEST(datetime)
 {
-    INITCOMMONCONTROLSEX icex;
-
-    icex.dwSize = sizeof(icex);
-    icex.dwICC = ICC_DATE_CLASSES;
-    InitCommonControlsEx(&icex);
+    InitCommonControls();
     init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
 
     test_datetime_control();
diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c
index e80944f..fa75d49 100644
--- a/dlls/comctl32/tests/header.c
+++ b/dlls/comctl32/tests/header.c
@@ -1482,11 +1482,8 @@ static LRESULT CALLBACK HeaderTestWndProc(HWND hWnd, UINT msg, WPARAM wParam, LP
 
 static void init(void) {
     WNDCLASSA wc;
-    INITCOMMONCONTROLSEX icex;
 
-    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
-    icex.dwICC  = ICC_USEREX_CLASSES;
-    InitCommonControlsEx(&icex);
+    InitCommonControls();
 
     wc.style = CS_HREDRAW | CS_VREDRAW;
     wc.cbClsExtra = 0;
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index bdd7d43..5419760 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1041,11 +1041,7 @@ static void test_item_position(void)
 
 START_TEST(listview)
 {
-    INITCOMMONCONTROLSEX icc;
-
-    icc.dwICC = 0;
-    icc.dwSize = sizeof icc;
-    InitCommonControlsEx(&icc);
+    InitCommonControls();
 
     init_msg_sequences(sequences, NUM_MSG_SEQUENCES);
 
diff --git a/dlls/comctl32/tests/monthcal.c b/dlls/comctl32/tests/monthcal.c
index a495919..7fe2bd7 100644
--- a/dlls/comctl32/tests/monthcal.c
+++ b/dlls/comctl32/tests/monthcal.c
@@ -313,10 +313,9 @@ static void test_monthcal(void)
 {
     HWND hwnd;
     SYSTEMTIME st[2], st1[2];
-    INITCOMMONCONTROLSEX ic = {sizeof(INITCOMMONCONTROLSEX), ICC_DATE_CLASSES};
     int res, month_range;
 
-    InitCommonControlsEx(&ic);
+    InitCommonControls();
     hwnd = CreateWindowA(MONTHCAL_CLASSA, "MonthCal", WS_POPUP | WS_VISIBLE, CW_USEDEFAULT,
                          0, 300, 300, 0, 0, NULL, NULL);
     ok(hwnd != NULL, "Failed to create MonthCal\n");
@@ -478,9 +477,8 @@ static HWND create_monthcal_control(DWORD style, HWND parent_window)
 {
     struct subclass_info *info;
     HWND hwnd;
-    static const INITCOMMONCONTROLSEX ic = {sizeof(INITCOMMONCONTROLSEX), ICC_DATE_CLASSES};
 
-    InitCommonControlsEx(&ic);
+    InitCommonControls();
 
     info = HeapAlloc(GetProcessHeap(), 0, sizeof(struct subclass_info));
     if (!info)
diff --git a/dlls/comctl32/tests/progress.c b/dlls/comctl32/tests/progress.c
index 42c1e8d..2716f33 100644
--- a/dlls/comctl32/tests/progress.c
+++ b/dlls/comctl32/tests/progress.c
@@ -91,12 +91,9 @@ static void update_window(HWND hWnd)
 static void init(void)
 {
     WNDCLASSA wc;
-    INITCOMMONCONTROLSEX icex;
     RECT rect;
     
-    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
-    icex.dwICC   = ICC_PROGRESS_CLASS;
-    InitCommonControlsEx(&icex);
+    InitCommonControls();
   
     wc.style = CS_HREDRAW | CS_VREDRAW;
     wc.cbClsExtra = 0;
diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index 79da16e..6bebeb7 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -786,14 +786,11 @@ static void bandinfo_test(void)
 
 START_TEST(rebar)
 {
-    INITCOMMONCONTROLSEX icc;
     WNDCLASSA wc;
     MSG msg;
     RECT rc;
 
-    icc.dwSize = sizeof(icc);
-    icc.dwICC = ICC_COOL_CLASSES;
-    InitCommonControlsEx(&icc);
+    InitCommonControls();
 
     wc.style = CS_HREDRAW | CS_VREDRAW;
     wc.cbClsExtra = 0;
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 2981db7..93010d3 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -651,11 +651,8 @@ START_TEST(treeview)
 {
     WNDCLASSA wc;
     MSG msg;
-    INITCOMMONCONTROLSEX icex;
   
-    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
-    icex.dwICC   = ICC_TREEVIEW_CLASSES;
-    InitCommonControlsEx(&icex);
+    InitCommonControls();
     init_msg_sequences(MsgSequences, NUM_MSG_SEQUENCES);
   
     wc.style = CS_HREDRAW | CS_VREDRAW;
-- 
1.5.3.4




More information about the wine-patches mailing list