diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index 03250491d4..1d0f12771a 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -352,12 +352,14 @@ RegisterGdkClass (GdkSurfaceType wtype) { char sLoc [MAX_PATH+1]; - if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH)) + // try to load first icon of executable program + if (0 != GetModuleFileName (NULL, sLoc, MAX_PATH)) { ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1); if (0 == hAppIcon && 0 == hAppIconSm) { + // fallback : load icon from GTK DLL if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH)) { ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);