Fixing the main window's icon in the title bar

This commit is contained in:
Laci bá
2021-10-16 18:18:34 +02:00
committed by GitHub
parent 451d0c8bd6
commit 33de277900

View File

@@ -1304,13 +1304,19 @@ ui_init(int nCmdShow)
wincl.lpfnWndProc = MainWindowProcedure;
wincl.style = CS_DBLCLKS; /* Catch double-clicks */
wincl.cbSize = sizeof(WNDCLASSEX);
wincl.hIcon = LoadIcon(hinstance, (LPCTSTR)10);
wincl.hIconSm = LoadIcon(hinstance, (LPCTSTR)10);
wincl.hIcon = NULL;
wincl.hIconSm = NULL;
wincl.hCursor = NULL;
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = CreateSolidBrush(RGB(0,0,0));
/* Load proper icons */
wchar_t path[MAX_PATH + 1] = {0};
GetModuleFileNameW(hinstance, path, MAX_PATH);
ExtractIconExW(path, 0, &wincl.hIcon, &wincl.hIconSm, 1);
if (! RegisterClassEx(&wincl))
return(2);
wincl.lpszClassName = SUB_CLASS_NAME;