开发者

Is there a way to change the maximum width of a window without using the WM_GETMINMAXINFO message?

I want to change the imposed Windows maximum width that a window can be resized to, for an external applicat开发者_如何学运维ion's window (not my C#/WinForms program's window).

The documentation of GetSystemMetrics for SM_CXMAXTRACK says: "The default maximum width of a window that has a caption and sizing borders, in pixels. This metric refers to the entire desktop. The user cannot drag the window frame to a size larger than these dimensions. A window can override this value by processing the WM_GETMINMAXINFO message."

Is there a way to modify this SM_CXMAXTRACK value (either system wide or for one particular window), without processing the WM_GETMINMAXINFO message? Maybe an undocumented function, a registry setting, etc.?

(Or: The documentation for MINMAXINFO.ptMaxTrackSize says: "This value is based on the size of the virtual screen and can be obtained programmatically from the system metrics SM_CXMAXTRACK and SM_CYMAXTRACK." Maybe there is a way to change the size of the virtual screen?)

Thank you


The only two ways I know of of limiting the size of a Window is by handling WM_GETMINMAXINFO, or by modifying the values passed in the WINDOWPOS structure in WM_WINDOWPOSCHANGING. Both of these methods involve being able to intercept and handle the messages for the Window. There's no external setting to limit the size of a Window as far as I know.

If you don't have the source code to the other app about the only thing I could suggest is to write a program that injects code into the other app (via SetWindowsHookEx or CreateRemoteThread), and then subclass the window and handle those messages.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜