Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Client/core/DXHook/CProxyDirect3D9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

#include "StdInc.h"
#include <dwmapi.h>
#include <resource.h>

extern HINSTANCE g_hModule;

HRESULT HandleCreateDeviceResult(HRESULT hResult, IDirect3D9* pDirect3D, UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags,
D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface);
Expand Down Expand Up @@ -172,6 +175,23 @@ HRESULT CProxyDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND
BOOL darkTitleBar = GetSystemRegistryValue((uint)HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme") == "\x0";
DwmSetWindowAttribute(hFocusWindow, DWMWA_USE_IMMERSIVE_DARK_MODE, &darkTitleBar, sizeof(darkTitleBar));

// Update icon
if (HICON icon = LoadIcon(g_hModule, MAKEINTRESOURCE(IDI_ICON1)))
{
const auto paramIcon = reinterpret_cast<LPARAM>(icon);
for (const WPARAM size : {ICON_SMALL, ICON_BIG})
{
SendMessage(hFocusWindow, WM_SETICON, size, paramIcon);
}

// Clean
DestroyIcon(icon);
}

// Redraw, we avoid possible problems with the fact that it won't replace the icon somewhere
InvalidateRect(hFocusWindow, nullptr, TRUE);
UpdateWindow(hFocusWindow);

// Detect if second call to CreateDevice
if (CreateDeviceSecondCallCheck(hResult, m_pDevice, Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface))
{
Expand Down
Loading