diff -r e8281b14970c src/video/windows/SDL_windowsevents.c --- a/src/video/windows/SDL_windowsevents.c Wed Aug 03 22:39:44 2016 +0200 +++ b/src/video/windows/SDL_windowsevents.c Sat Aug 06 00:30:40 2016 +0300 @@ -1015,7 +1015,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst) { - WNDCLASS class; + WNDCLASSEX wcex; /* Only do this once... */ if (app_registered) { @@ -1037,21 +1037,22 @@ } /* Register the application class */ - class.hCursor = NULL; - class.hIcon = - LoadImage(SDL_Instance, SDL_Appname, IMAGE_ICON, 0, 0, - LR_DEFAULTCOLOR); - class.lpszMenuName = NULL; - class.lpszClassName = SDL_Appname; - class.hbrBackground = NULL; - class.hInstance = SDL_Instance; - class.style = SDL_Appstyle; - class.lpfnWndProc = WIN_WindowProc; - class.cbWndExtra = 0; - class.cbClsExtra = 0; - if (!RegisterClass(&class)) { + wcex.cbSize = sizeof(WNDCLASSEX); + wcex.hCursor = NULL; + wcex.hIcon = (HICON) LoadImage(SDL_Instance, IDI_APPLICATION, IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0); + wcex.hIconSm = (HICON) LoadImage(SDL_Instance, IDI_APPLICATION, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0); + wcex.lpszMenuName = NULL; + wcex.lpszClassName = SDL_Appname; + wcex.style = SDL_Appstyle; + wcex.hbrBackground = NULL; + wcex.lpfnWndProc = WIN_WindowProc; + wcex.hInstance = SDL_Instance; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + + if (!RegisterClassEx(&wcex)) { return SDL_SetError("Couldn't register application class"); - } + } app_registered = 1; return 0; @@ -1061,7 +1062,7 @@ void SDL_UnregisterApp() { - WNDCLASS class; + WNDCLASSEX wcex; /* SDL_RegisterApp might not have been called before */ if (!app_registered) { @@ -1070,7 +1071,7 @@ --app_registered; if (app_registered == 0) { /* Check for any registered window classes. */ - if (GetClassInfo(SDL_Instance, SDL_Appname, &class)) { + if (GetClassInfoEx(SDL_Instance, SDL_Appname, &wcex)) { UnregisterClass(SDL_Appname, SDL_Instance); } SDL_free(SDL_Appname);