I have two monitors:
Screen 1: which is secondary screen with 1920x1080
Screen 2: which is primary screen with 1600x900
Screen 1 is larger then Screen 2.
When I open my application in Screen 2, and then move it from screen 2 to screen 1 and try to minimize and then maximize my application, the maximum size is taken by screen 2, and not by current monitor size(it doesn't appear maximized related to monitor size)
How I can edit my code so in maximize and minimize to take the screen resolution where the application exist now instead of taking it depending on the primary monitor?
I am using the code in this thread for the matter of resizing: https://blogs.msdn.microsoft.com/llobo/2006/08/01/maximizing-window-with-windowstylenone-considering-taskbar/
Which is same as this reply: https://stackoverflow.com/a/6315427/5825468
Thanks