mirror of https://github.com/buggins/dlangui.git
fix win32 window icon - issue #28
This commit is contained in:
parent
83b4e98390
commit
d709a26434
|
@ -42,6 +42,7 @@ class Win32ColorDrawBuf : ColorDrawBufBase {
|
||||||
/// create resized copy of ColorDrawBuf
|
/// create resized copy of ColorDrawBuf
|
||||||
this(ColorDrawBuf v, int dx, int dy) {
|
this(ColorDrawBuf v, int dx, int dy) {
|
||||||
this(dx, dy);
|
this(dx, dy);
|
||||||
|
resetClipping();
|
||||||
fill(0xFFFFFFFF);
|
fill(0xFFFFFFFF);
|
||||||
if (_dx == dx && _dy == dy)
|
if (_dx == dx && _dy == dy)
|
||||||
drawImage(0, 0, v);
|
drawImage(0, 0, v);
|
||||||
|
@ -87,7 +88,7 @@ class Win32ColorDrawBuf : ColorDrawBufBase {
|
||||||
//return CreateBitmap(_dx, _dy, 1, 1, buf.ptr);
|
//return CreateBitmap(_dx, _dy, 1, 1, buf.ptr);
|
||||||
}
|
}
|
||||||
/// destroy object, but leave bitmap as is
|
/// destroy object, but leave bitmap as is
|
||||||
HBITMAP destoryLeavingBitmap() {
|
HBITMAP destroyLeavingBitmap() {
|
||||||
HBITMAP res = _drawbmp;
|
HBITMAP res = _drawbmp;
|
||||||
_drawbmp = null;
|
_drawbmp = null;
|
||||||
destroy(this);
|
destroy(this);
|
||||||
|
|
|
@ -449,7 +449,7 @@ class Win32Window : Window {
|
||||||
resizedicon.invertAlpha();
|
resizedicon.invertAlpha();
|
||||||
ICONINFO ii;
|
ICONINFO ii;
|
||||||
HBITMAP mask = resizedicon.createTransparencyBitmap();
|
HBITMAP mask = resizedicon.createTransparencyBitmap();
|
||||||
HBITMAP color = resizedicon.destoryLeavingBitmap();
|
HBITMAP color = resizedicon.destroyLeavingBitmap();
|
||||||
ii.fIcon = TRUE;
|
ii.fIcon = TRUE;
|
||||||
ii.xHotspot = 0;
|
ii.xHotspot = 0;
|
||||||
ii.yHotspot = 0;
|
ii.yHotspot = 0;
|
||||||
|
@ -457,8 +457,8 @@ class Win32Window : Window {
|
||||||
ii.hbmColor = color;
|
ii.hbmColor = color;
|
||||||
_icon = CreateIconIndirect(&ii);
|
_icon = CreateIconIndirect(&ii);
|
||||||
if (_icon) {
|
if (_icon) {
|
||||||
SendMessage(_hwnd, WM_SETICON, ICON_SMALL, cast(int)_icon);
|
SendMessageW(_hwnd, WM_SETICON, ICON_SMALL, cast(LPARAM)_icon);
|
||||||
SendMessage(_hwnd, WM_SETICON, ICON_BIG, cast(int)_icon);
|
SendMessageW(_hwnd, WM_SETICON, ICON_BIG, cast(LPARAM)_icon);
|
||||||
} else {
|
} else {
|
||||||
Log.e("failed to create icon");
|
Log.e("failed to create icon");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue