forked from AuroraMiddleware/gtk
Load icon from executable on Windows
This commit is contained in:
parent
1a3f2acb95
commit
82b11623f4
@ -352,12 +352,14 @@ RegisterGdkClass (GdkSurfaceType wtype)
|
|||||||
{
|
{
|
||||||
char sLoc [MAX_PATH+1];
|
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);
|
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
|
||||||
|
|
||||||
if (0 == hAppIcon && 0 == hAppIconSm)
|
if (0 == hAppIcon && 0 == hAppIconSm)
|
||||||
{
|
{
|
||||||
|
// fallback : load icon from GTK DLL
|
||||||
if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH))
|
if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH))
|
||||||
{
|
{
|
||||||
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
|
ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user