Change application icon
This commit is contained in:
parent
d6e73da190
commit
a9ef15c526
42
src/client/component/icon.cpp
Normal file
42
src/client/component/icon.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#include <std_include.hpp>
|
||||||
|
#include "loader/component_loader.hpp"
|
||||||
|
#include "resource.hpp"
|
||||||
|
|
||||||
|
#include <utils/nt.hpp>
|
||||||
|
#include <utils/hook.hpp>
|
||||||
|
|
||||||
|
namespace icon
|
||||||
|
{
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
utils::hook::detour load_icon_a_hook;
|
||||||
|
|
||||||
|
HINSTANCE get_current_module()
|
||||||
|
{
|
||||||
|
return utils::nt::library::get_by_address(get_current_module);
|
||||||
|
}
|
||||||
|
|
||||||
|
HICON WINAPI load_icon_a_stub(HINSTANCE module, LPCSTR icon_name)
|
||||||
|
{
|
||||||
|
static const utils::nt::library game{};
|
||||||
|
if (game == module && icon_name == MAKEINTRESOURCEA(1))
|
||||||
|
{
|
||||||
|
module = get_current_module();
|
||||||
|
icon_name = MAKEINTRESOURCEA(ID_ICON);
|
||||||
|
}
|
||||||
|
|
||||||
|
return load_icon_a_hook.invoke<HICON>(module, icon_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class component final : public component_interface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
component()
|
||||||
|
{
|
||||||
|
load_icon_a_hook.create(LoadIconA, load_icon_a_stub);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
REGISTER_COMPONENT(icon::component)
|
@ -91,7 +91,7 @@ END
|
|||||||
// Binary Data
|
// Binary Data
|
||||||
//
|
//
|
||||||
|
|
||||||
//ID_ICON ICON "resources/icon.ico"
|
ID_ICON ICON "resources/icon.ico"
|
||||||
IMAGE_SPLASH BITMAP "resources/splash.bmp"
|
IMAGE_SPLASH BITMAP "resources/splash.bmp"
|
||||||
IMAGE_LOGO BITMAP "resources/logo.bmp"
|
IMAGE_LOGO BITMAP "resources/logo.bmp"
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 180 KiB |
Loading…
Reference in New Issue
Block a user