feat: add icon on windows (#41)
This commit is contained in:
parent
30a9f8c9d5
commit
b3e3318ad5
@ -10,7 +10,7 @@ file(GLOB src
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_executable(soundux WIN32 ${src})
|
add_executable(soundux WIN32 ${src} "assets/icon.rc")
|
||||||
else()
|
else()
|
||||||
add_executable(soundux ${src})
|
add_executable(soundux ${src})
|
||||||
endif()
|
endif()
|
||||||
|
1
assets/icon.h
Normal file
1
assets/icon.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#define IDI_ICON1 101
|
BIN
assets/icon.ico
Normal file
BIN
assets/icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 KiB |
2
assets/icon.rc
Normal file
2
assets/icon.rc
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include "icon.h"
|
||||||
|
IDI_ICON1 ICON DISCARDABLE "icon.ico"
|
@ -5,6 +5,7 @@
|
|||||||
#include <fancy.hpp>
|
#include <fancy.hpp>
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
|
#include "../assets/icon.h"
|
||||||
int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
int __stdcall WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||||
#else
|
#else
|
||||||
int main()
|
int main()
|
||||||
@ -45,6 +46,11 @@ int main()
|
|||||||
|
|
||||||
Soundux::Globals::gGui = std::make_unique<Soundux::Objects::WebView>();
|
Soundux::Globals::gGui = std::make_unique<Soundux::Objects::WebView>();
|
||||||
Soundux::Globals::gGui->setup();
|
Soundux::Globals::gGui->setup();
|
||||||
|
#if defined(_WIN32)
|
||||||
|
HICON hIcon = LoadIcon(GetModuleHandle(nullptr), MAKEINTRESOURCE(IDI_ICON1));
|
||||||
|
SendMessage(GetActiveWindow(), WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
|
||||||
|
SendMessage(GetActiveWindow(), WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||||
|
#endif
|
||||||
Soundux::Globals::gGui->mainLoop();
|
Soundux::Globals::gGui->mainLoop();
|
||||||
|
|
||||||
Soundux::Globals::gAudio.destory();
|
Soundux::Globals::gAudio.destory();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user