add rc for visual styles and icon

This commit is contained in:
itsmattkc 2021-09-12 22:43:18 -07:00
parent 552cebbe90
commit 0b110eb8a6
5 changed files with 20 additions and 0 deletions

View file

@ -7,6 +7,7 @@ set(CMAKE_MFC_FLAG 2)
option(BUILD_UNICODE "Build with Unicode support" ON)
add_executable(Rebuilder WIN32
res/res.rc
src/app.cpp
src/app.h
src/window.cpp

BIN
res/mama.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

10
res/res.manifest Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="com.itsmattkc.Rebuilder" type="win32" />
<description>LEGO Island modding tool and launcher.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>

2
res/res.rc Normal file
View file

@ -0,0 +1,2 @@
IDI_ICON1 ICON DISCARDABLE "mama.ico"
1 24 "res.manifest"

View file

@ -11,6 +11,13 @@ CRebuilderWindow::CRebuilderWindow()
// Create form
Create(NULL, _T("LEGO Island Rebuilder"));
// Set window icon to application icon
TCHAR filename[MAX_PATH];
GetModuleFileName(NULL, filename, MAX_PATH);
WORD index;
HICON icon = ExtractAssociatedIcon(AfxGetInstanceHandle(), filename, &index);
SetIcon(icon, TRUE);
// Get default Win32 dialog font
m_fDialogFont.CreateStockObject(DEFAULT_GUI_FONT);