WINDOWPLACEMENT with different screen Resolutions
Posted on 2005-04-26
I store the windowplacement information(which I am obtaining from a file) in the WINDOWPLACEMENT structure with all the necessary values.
I am also able to use the SetWindowPlacement(&wp) that loads the template in the correct position.
Now, If I want to load the window on a different screen resolution, things get messed up. I want to way to figure out if the Windowplacement values are not suited with the screen reolsution.
If they are not suited with the current screen resolution, then i want to be able to place them at a default location(like Center of Screen).
Can anyone please attach a snippet, if they have tried a similar problem ??
i tried to use the following code, but it did not help
wp.rcNormalPosition.left = min (wp.rcNormalPosition.left,
::GetSystemMetrics (SM_CXSCREEN) -
wp.rcNormalPosition.top = min (wp.rcNormalPosition.top,
::GetSystemMetrics (SM_CYSCREEN) -
Please Help me with this and attach a snippet that i can try