[Windows] Use executable icon as default for the window.

This commit is contained in:
Pāvels Nadtočajevs
2026-01-23 10:41:23 +02:00
parent c3058391d7
commit b0320ef4ff

View File

@@ -7153,6 +7153,11 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
OleInitialize(nullptr);
HICON default_icon = LoadIconW(GetModuleHandle(nullptr), L"GODOT_ICON");
if (default_icon == nullptr) {
default_icon = LoadIcon(nullptr, IDI_WINLOGO);
}
memset(&wc, 0, sizeof(WNDCLASSEXW));
wc.cbSize = sizeof(WNDCLASSEXW);
wc.style = CS_OWNDC | CS_DBLCLKS;
@@ -7160,7 +7165,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance ? hInstance : GetModuleHandle(nullptr);
wc.hIcon = LoadIcon(nullptr, IDI_WINLOGO);
wc.hIcon = default_icon;
wc.hCursor = nullptr;
wc.hbrBackground = nullptr;
wc.lpszMenuName = nullptr;