0

I have a window that is minimized and not added to the Taskbar when minimized. When minimized i want it to be moved to the bottom left corner of my main window. This works pretty good, but it somehow is a little small, so you can see the icon and restore,maximize and close button. But it seems impossible to resize that window so it shows the window title.

I tried SetWindowPos() and MoveWindow() but in both functions the new width and or hight parameters seem to be ignored. Moving the minimized window with both functions works fine.

    case WM_SIZE:
            if (wParam == SIZE_MINIMIZED)
            {
                WINDOWINFO wi;
                wi.cbSize = sizeof(WINDOWINFO);
                GetWindowInfo(ghMainWnd, &wi);  // gets the coordinates of the main window

                MoveWindow(hDlg, wi.rcClient.left, wi.rcClient.bottom - 55, 200, 35, TRUE);

                //SetWindowPos(hDlg, NULL, wi.rcClient.left , wi.rcClient.bottom - 55, 200, 35, SWP_NOZORDER | SWP_NOREDRAW);

                return FALSE;
            }

            if (wParam == SIZE_RESTORED) 
            {
                // do some stuff for the restored window
            }
      break;

Any adviced what could work?

Falk
  • 23
  • 7
  • You can try to override the WM_GETMINMAXINFO message, but I'm not sure if it would help in this case. – VuVirt Oct 14 '19 at 11:11
  • If your window is minimized, it won't show any other size than its icon. Verify if (GetWindowLong(GWL_STYLE) & WS_MINIMIZE) != 0 If this applies, try SetWindowLong(GetWindowLong(GWL_STYLE) & ~WS_MINIMIZE). – Nick Oct 14 '19 at 12:22
  • Sure the window got the WS_MINIMIZE flag because it is minimized at that time, but changing it won't make anything different. – Falk Oct 14 '19 at 13:17
  • So you need to maximize it. Maybe like this: https://stackoverflow.com/questions/354445/restore-windowstate-from-minimized by ShowWindow(hwnd, SW_RESTORE); – Nick Oct 14 '19 at 14:15
  • I think you missed my point, i want to make the minimized window bigger in width, so its like 300 in width and 30 pixels in hight (actual size is like 160x30), not restore its actual size, I know how to do that. – Falk Oct 14 '19 at 14:33
  • The minimized window is not a real window, it's just shown as a placeholder, an icon-like thing. I assume you mean an SDI or MDI child window? – Nick Oct 14 '19 at 15:56

0 Answers0