fix win32 window icon - issue #28

This commit is contained in:
Vadim Lopatin 2015-01-12 14:18:32 +03:00
parent 83b4e98390
commit d709a26434
2 changed files with 5 additions and 4 deletions

View File

@ -42,6 +42,7 @@ class Win32ColorDrawBuf : ColorDrawBufBase {
/// create resized copy of ColorDrawBuf
this(ColorDrawBuf v, int dx, int dy) {
this(dx, dy);
resetClipping();
fill(0xFFFFFFFF);
if (_dx == dx && _dy == dy)
drawImage(0, 0, v);
@ -87,7 +88,7 @@ class Win32ColorDrawBuf : ColorDrawBufBase {
//return CreateBitmap(_dx, _dy, 1, 1, buf.ptr);
}
/// destroy object, but leave bitmap as is
HBITMAP destoryLeavingBitmap() {
HBITMAP destroyLeavingBitmap() {
HBITMAP res = _drawbmp;
_drawbmp = null;
destroy(this);

View File

@ -449,7 +449,7 @@ class Win32Window : Window {
resizedicon.invertAlpha();
ICONINFO ii;
HBITMAP mask = resizedicon.createTransparencyBitmap();
HBITMAP color = resizedicon.destoryLeavingBitmap();
HBITMAP color = resizedicon.destroyLeavingBitmap();
ii.fIcon = TRUE;
ii.xHotspot = 0;
ii.yHotspot = 0;
@ -457,8 +457,8 @@ class Win32Window : Window {
ii.hbmColor = color;
_icon = CreateIconIndirect(&ii);
if (_icon) {
SendMessage(_hwnd, WM_SETICON, ICON_SMALL, cast(int)_icon);
SendMessage(_hwnd, WM_SETICON, ICON_BIG, cast(int)_icon);
SendMessageW(_hwnd, WM_SETICON, ICON_SMALL, cast(LPARAM)_icon);
SendMessageW(_hwnd, WM_SETICON, ICON_BIG, cast(LPARAM)_icon);
} else {
Log.e("failed to create icon");
}