Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can a window be resized past the screen size/offscreen?

My purpose is to size a window to a width/height greater than the size of my physical screen programmatically under Win32. How can I do this?

On my systems it seems the maximum size of a given window is bound by the size of my screen whether programmatically or whether sizing manually by dragging the sizing cursor.

I have tried programmatically with SetWindowPos() and MoveWindow() and both cap the size of the target window. Oddly I know some people do not have this 'cap' so I wonder whether this is perhaps due to some OS setting (registry). Does anyone know something about this? Or perhaps some way to workaround it?

// Edit: new developments

I am testing on Windows XP and Windows 7. The graphics cards I'm using are a NVIDIA Quadro NVS 290 (256MB) and a Geforce 9800GT (1GB). After further investigation it looks like Windows is intercepting the message and fiddling with the parameters. For example, if you call SetWindowPos to make a target 2000x2000 it will only receive a WM_SIZE for the capped x/y.

like image 751
Mike Kwan Avatar asked May 25 '11 11:05

Mike Kwan


People also ask

How do I resize a window that is off the screen?

Hold down the Shift key, then right-click on the appropriate application icon in the Windows taskbar. On the resulting pop-up, select the Move option. Begin pressing the arrow keys on your keyboard to move the invisible window from off-screen to on-screen.

How do I resize a window that is too big?

Right-click on the button that represents the window in Window List . Choose Resize from the Window Menu. Use the arrow keys to resize the window. Press-and-hold Alt, then middle-click near the corner that you want to resize.

Can you make a window bigger?

Making a window bigger can involve cutting into your wall stud, redoing a window header, and cutting into your home's siding for a larger rough opening. These are complicated projects that can impact the strength and integrity of your home.


1 Answers

Implement a message handler for WM_GETMINMAXINFO to stop Windows from applying the sane default behavior:

case WM_GETMINMAXINFO: {
    DefWindowProc(hWnd, message, wParam, lParam);
    MINMAXINFO* pmmi = (MINMAXINFO*)lParam;
    pmmi->ptMaxTrackSize.x = 2000;
    pmmi->ptMaxTrackSize.y = 2000;
    return 0;
}
like image 173
Hans Passant Avatar answered Sep 30 '22 07:09

Hans Passant