Maximize + multiple monitors?
-
Hi! A user maximizes the application on monitor #2 and then exits the program. When starting up again, trying to maximize the window using
ShowWindow(SW_MAXIMIZE)
maximizes the window on monitor #1, instead of the expected #2. Is there any way to set the preferred/active monitor? Optimally, a subsequent call toShowWindow(SW_MAXIMIZE)
should then maximize the window on monitor #2. Thanks and best regards Dominik
Too many passwords to remember? Try KeePass Password Safe!
-
Hi! A user maximizes the application on monitor #2 and then exits the program. When starting up again, trying to maximize the window using
ShowWindow(SW_MAXIMIZE)
maximizes the window on monitor #1, instead of the expected #2. Is there any way to set the preferred/active monitor? Optimally, a subsequent call toShowWindow(SW_MAXIMIZE)
should then maximize the window on monitor #2. Thanks and best regards Dominik
Too many passwords to remember? Try KeePass Password Safe!
Yes, use GetWindowPlacement to record the window max/min state, size, and monitor when the app exits, store the returned struct as binary data in the registry (or elsewhere), and the use SetWindowPlacement when the app boots the next time. Don't forget to handle bizarre situations as when a user discards a monitor or changes screen resolution.