ew (guiDlg, IDOK, TRUE);
if (panelDlg != NULL) {
ShowWindow (panelDlg, FALSE);
- DestroyWindow (panelDlg);
+ x_DestroyWindow(panelDlg, panelresource);
panelDlg = NULL;
}
if (ToolTipHWND != NULL) {
extern int dialog_inhibit;
HWND x_CreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, struct newresource*);
+void x_DestroyWindow(HWND, struct newresource*);
void getguipos(int *xp, int *yp);
extern int scaleresource(struct newresource*, struct dlgcontext *dctx, HWND, int, int, DWORD, int);
extern void rescaleresource(struct newresource*, bool);
return DIALOG_CreateIndirect(hInstance, lpTemplate, hWndParent, lpDialogFunc, lParamInit, NULL, res);
}
+void x_DestroyWindow(HWND hwnd, struct newresource *res)
+{
+ for (int i = 0; res->hwndcnt; i++) {
+ struct newreswnd *pr = &res->hwnds[i];
+ if (res->hwnds[i].hwnd == hwnd) {
+ res->hwndcnt--;
+ int tomove = res->hwndcnt - i;
+ if (tomove > 0) {
+ memmove(&res->hwnds[i], &res->hwnds[i + 1], tomove * sizeof(newreswnd));
+ }
+ break;
+ }
+ }
+ DestroyWindow(hwnd);
+}
static int align (double f)
{
disable = true;
}
SetFocus(nw->hwnd);
- SetWindowPos(nw->hwnd, HWND_TOP, x, y, w, h, SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | SWP_DEFERERASE);
+ if (!SetWindowPos(nw->hwnd, HWND_TOP, x, y, w, h, SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | SWP_DEFERERASE)) {
+ write_log("scalechildwindows %d/%d: ERROR %d", i, nr->hwndcnt, GetLastError());
+ }
if (disable) {
EnableWindow(nw->hwnd, FALSE);
}