This commit is contained in:
hyzboy 2024-07-25 02:58:16 +08:00
commit d80802ce9e

View File

@ -10,9 +10,7 @@ namespace hgl
bool RegistryWinClass(HINSTANCE hInstance) bool RegistryWinClass(HINSTANCE hInstance)
{ {
WNDCLASSEXW win_class; WNDCLASSEXW win_class{};
hgl_zero(win_class);
win_class.cbSize = sizeof(WNDCLASSEXW); win_class.cbSize = sizeof(WNDCLASSEXW);
win_class.style = CS_HREDRAW | CS_VREDRAW; win_class.style = CS_HREDRAW | CS_VREDRAW;
@ -54,8 +52,8 @@ namespace hgl
if (width && height) if (width && height)
{ {
const uint32 screen_width=GetSystemMetrics(SM_CXSCREEN); const int screen_width =GetSystemMetrics(SM_CXSCREEN);
const uint32 screen_height=GetSystemMetrics(SM_CYSCREEN); const int screen_height=GetSystemMetrics(SM_CYSCREEN);
win_left = (screen_width - win_width ) / 2; win_left = (screen_width - win_width ) / 2;
win_top = (screen_height - win_height) / 2; win_top = (screen_height - win_height) / 2;