[MAGNIFY] Initialize the common controls as the program has a manifest 1562/head
authorBișoc George <fraizeraust99@gmail.com>
Sun, 12 May 2019 14:18:28 +0000 (16:18 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Tue, 14 May 2019 18:49:36 +0000 (20:49 +0200)
base/applications/magnify/CMakeLists.txt
base/applications/magnify/magnifier.c

index ee7919e..271b4aa 100644 (file)
@@ -7,6 +7,6 @@ list(APPEND SOURCE
 add_rc_deps(magnify.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/magnify.ico)
 add_executable(magnify ${SOURCE} magnify.rc)
 set_module_type(magnify win32gui)
-add_importlibs(magnify user32 gdi32 advapi32 shell32 msvcrt kernel32)
+add_importlibs(magnify user32 gdi32 comctl32 advapi32 shell32 msvcrt kernel32)
 add_pch(magnify magnifier.h SOURCE)
 add_cd_file(TARGET magnify DESTINATION reactos/system32 FOR all)
index f8d63cf..cfca251 100644 (file)
@@ -16,6 +16,7 @@
 #include <winuser.h>
 #include <wingdi.h>
 #include <winnls.h>
+#include <commctrl.h>
 #include <shellapi.h>
 #include <windowsx.h>
 #include <stdlib.h>
@@ -77,6 +78,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
 {
     MSG msg;
     HACCEL hAccelTable;
+    INITCOMMONCONTROLSEX iccex;
 
     UNREFERENCED_PARAMETER(hPrevInstance);
     UNREFERENCED_PARAMETER(lpCmdLine);
@@ -111,6 +113,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
         }
     }
 
+    /* Load the common controls */
+    iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+    iccex.dwICC = ICC_STANDARD_CLASSES | ICC_WIN95_CLASSES;
+    InitCommonControlsEx(&iccex);
 
     SelectObject(hdcOffscreen, hbmpOld);
     DeleteObject (hbmpOffscreen);