Merge pull request #115294 from bruvzg/win_init_icon

[Windows] Use executable icon as default for the window.
This commit is contained in:
Thaddeus Crews 2026-01-26 13:14:29 -06:00
commit d950e2343e
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

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;