git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@809 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-11-25 01:56:31 +00:00
parent 919a24a47b
commit a4b2e39259
2 changed files with 4 additions and 7 deletions

View File

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

View File

@@ -201,8 +201,6 @@ static LRESULT CALLBACK wndproc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) {
} else if(msg == WM_SETCURSOR) { } else if(msg == WM_SETCURSOR) {
if(LOWORD(lp) != HTCLIENT) return DefWindowProc(hWnd, msg, wp, lp); if(LOWORD(lp) != HTCLIENT) return DefWindowProc(hWnd, msg, wp, lp);
if(u->ll->gdi.cursor != NULL) SetCursor(u->ll->gdi.cursor); if(u->ll->gdi.cursor != NULL) SetCursor(u->ll->gdi.cursor);
} else if(msg == WM_GETICON) {
return (LPARAM)u->ll->gdi.icon;
} else if(msg == WM_USER) { } else if(msg == WM_USER) {
InvalidateRect(hWnd, NULL, FALSE); InvalidateRect(hWnd, NULL, FALSE);
UpdateWindow(hWnd); UpdateWindow(hWnd);
@@ -242,7 +240,6 @@ 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;
@@ -276,7 +273,6 @@ static void MwLLDestroyImpl(MwLL handle) {
DestroyWindow(handle->gdi.hWnd); DestroyWindow(handle->gdi.hWnd);
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);
free(handle); free(handle);
} }
@@ -513,8 +509,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;
if(handle->gdi.icon != NULL) DestroyIcon(handle->gdi.icon); ico = CreateIconIndirect(&ii);
handle->gdi.icon = CreateIconIndirect(&ii); SendMessage(handle->gdi.hWnd, WM_SETICON, ICON_BIG, ico);
SendMessage(handle->gdi.hWnd, WM_SETICON, ICON_SMALL, ico);
DestroyIcon(ico);
} }
static void MwLLForceRenderImpl(MwLL handle) { static void MwLLForceRenderImpl(MwLL handle) {