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

I want to change the overlaid Windows max width that the window can be resized for, for the outer window of the application (not my C # / WinForms program window).

The GetSystemMetrics documentation for SM_CXMAXTRACK states: "The default maximum window width, which has title and size borders, in pixels. This metric applies to the entire desktop. The user cannot drag a window frame larger than these dimensions. The window can override this value. while processing the WM_GETMINMAXINFO message. "

Is there a way to change this SM_CXMAXTRACK value (both system-wide and for one specific window) without handling the WM_GETMINMAXINFO message? Possibly an undocumented function, registry setting, etc.?

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

thanks

+2


a source to share


1 answer


The only two ways to limit the size of the window are to handle WM_GETMINMAXINFO or change the values โ€‹โ€‹passed in the WINDOWPOS structure to WM_WINDOWPOSCHANGING. Both of these methods include the ability to intercept and process messages for the window. As far as I know, there are no external settings to limit the window size.



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

+3


a source







All Articles