[MAGNIFY] Initialize the common controls as the program has a manifest

This commit is contained in:
Bișoc George
2019-05-12 16:18:28 +02:00
committed by Hermès Bélusca-Maïto
parent 7a133609e7
commit 6a124ef38a
2 changed files with 7 additions and 1 deletions

View 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)

View 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);