git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@812 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-25 02:03:14 +00:00
parent 74e2ce72e2
commit 8a02b3d31b
2 changed files with 7 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ struct _MwLLGDI {
HWND hWnd; HWND hWnd;
HDC hDC; HDC hDC;
HCURSOR cursor; HCURSOR cursor;
HICON icon;
int grabbed; int grabbed;
}; };

View File

@@ -240,6 +240,7 @@ static MwLL MwLLCreateImpl(MwLL parent, int x, int y, int width, int height) {
r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL); r->gdi.hWnd = CreateWindow("milsko", "Milsko", parent == NULL ? (WS_OVERLAPPEDWINDOW) : (WS_CHILD | WS_VISIBLE), x == MwDEFAULT ? CW_USEDEFAULT : x, y == MwDEFAULT ? CW_USEDEFAULT : y, width, height, parent == NULL ? NULL : parent->gdi.hWnd, 0, wc.hInstance, NULL);
r->gdi.hInstance = wc.hInstance; r->gdi.hInstance = wc.hInstance;
r->gdi.cursor = NULL; r->gdi.cursor = NULL;
r->gdi.icon = NULL;
u->ll = r; u->ll = r;
u->min_set = 0; u->min_set = 0;
@@ -509,10 +510,10 @@ static void MwLLSetIconImpl(MwLL handle, MwLLPixmap pixmap) {
ii.hbmMask = pixmap->gdi.hMask2; ii.hbmMask = pixmap->gdi.hMask2;
ii.hbmColor = pixmap->gdi.hBitmap; ii.hbmColor = pixmap->gdi.hBitmap;
ico = CreateIconIndirect(&ii); if(handle->gdi.icon != NULL) DestroyIcon(handle->gdi.icon);
SendMessage(handle->gdi.hWnd, WM_SETICON, ICON_SMALL, (LPARAM)ico); handle->gdi.icon = CreateIconIndirect(&ii);
SendMessage(handle->gdi.hWnd, WM_SETICON, ICON_BIG, (LPARAM)ico); SendMessage(handle->gdi.hWnd, WM_SETICON, ICON_SMALL, (LPARAM)handle->gdi.icon);
// DestroyIcon(ico); SendMessage(handle->gdi.hWnd, WM_SETICON, ICON_BIG, (LPARAM)handle->gdi.icon);
} }
static void MwLLForceRenderImpl(MwLL handle) { static void MwLLForceRenderImpl(MwLL handle) {
@@ -561,6 +562,7 @@ static void MwLLSetCursorImpl(MwLL handle, MwCursor* image, MwCursor* mask) {
cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage); cursor = CreateCursor(GetModuleHandle(NULL), xs, ys, MwCursorDataHeight, MwCursorDataHeight, dmask, dimage);
if(handle->gdi.cursor != NULL) DestroyCursor(handle->gdi.cursor); if(handle->gdi.cursor != NULL) DestroyCursor(handle->gdi.cursor);
if(handle->gdi.icon != NULL) DestroyIcon(handle->gdi.icon);
handle->gdi.cursor = cursor; handle->gdi.cursor = cursor;
free(dimage); free(dimage);