# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1319442980 0 # Node ID 51892bf7fe01f9c891da078c13136f95ba1e7ddf # Parent 363d859e837215139bfd4794272fac0b189e07f4 Attempt on Windows to use an icon handle for bitmap buttons before a bitmap... Since XP does not seem to support transparency on bitmaps. diff -r 363d859e8372 -r 51892bf7fe01 win/dw.c --- a/win/dw.c Mon Oct 24 06:29:05 2011 +0000 +++ b/win/dw.c Mon Oct 24 07:56:20 2011 +0000 @@ -5462,17 +5462,22 @@ HWND tmp; BubbleButton *bubble; HBITMAP hbitmap = 0; - HANDLE icon = 0; + HANDLE hicon = 0; int windowtype = 0, len; if (!(bubble = calloc(1, sizeof(BubbleButton)))) return 0; #ifdef GDIPLUS - windowtype = BS_BITMAP; - hbitmap = _dw_load_bitmap(filename, NULL); + if((hicon = _dw_load_icon(filename))) + windowtype = BS_ICON; + else + { + hbitmap = _dw_load_bitmap(filename, NULL); + windowtype = BS_BITMAP; + } #else - windowtype = _dw_get_image_handle(filename, &icon, &hbitmap); + windowtype = _dw_get_image_handle(filename, &hicon, &hbitmap); #endif tmp = CreateWindow( BUTTONCLASSNAME, @@ -5491,14 +5496,11 @@ _create_tooltip(tmp, text); -#ifndef GDIPLUS - if (icon) - { - SendMessage(tmp, BM_SETIMAGE,(WPARAM) IMAGE_ICON,(LPARAM) icon); - } - else -#endif - if (hbitmap) + if (hicon) + { + SendMessage(tmp, BM_SETIMAGE,(WPARAM) IMAGE_ICON,(LPARAM) hicon); + } + else if (hbitmap) { SendMessage(tmp, BM_SETIMAGE,(WPARAM) IMAGE_BITMAP, (LPARAM) hbitmap); }