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

给你一囗甜甜゛ 提交于 2019-11-28 02:03:27

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;
}

Windows with a thick frame (to allow user resize) are restricted from growing larger than the desktop.

Try SetWindowLong() clearing the THICKFRAME (0x40000) flag.

The following should allow programatic sizing, but the user will lose the ability to resize. If you add the Thickframe back after sizing, the user can resize, but when he does so the window will immediately shrink back to the desktop limited size.

The following is from some csharp code that also removes all borders, caption, etc:

WS style = (WS)GetWindowLong(ptr, GWL_STYLE); style = style & ~WS.BORDER & ~WS.ThickFrame & ~WS.SYSMENU & ~WS.CAPTION | WS.POPUP; SetWindowLong(ptr, GWL_STYLE, (int)style);


A good tool to play with window settings is uuSpy. It's like Microsoft Spy++, but allows you to modify settings like THICKFRAME.

Yes, windows can be larger than the screen (or even the sum of all your monitors). Windows can also be positioned off-screen (which some applications do as a hack to hide while remaining active).

Perhaps the Windows 7 desktop manager is kicking in and trying to "dock" those windows to the edges of your screen for you.

You might try using the slightly lower-level API SetWindowPos, which gives you control over notifications, z-order, and other stuff.

tom-q

You can get a window to be larger in resolution (and even way way larger) than your screen, using the 'Infinte Screen" software: http://ynea.futureware.at/cgi-bin/infinite_screen.pl

Here's how to use it:

  1. Download it, run it.

  2. In the Oversize tab, choose the Windows you want to enlarge.

  3. Give it the Width and Height you want. Done!

Just in case you need a large screenshot (that's how I ended up here): If you want to get a screenshot of the window, you've got a screenshot option in the same Oversize tab. (Because screenshots are normally no bigger than the screen size, even if the window is larger). Another (and better) way to screenshot the window is using Greenshot, as you can save them in .tiff and directly watching the window.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!