I'm using the SetWindowPlacement
function to (1) maximize and (2) change the restore position of external windows on the desktop. But when I use this command on WinForm windows, it doesn't seem to set the restore location correctly. (The WinForm window I'm testing with is just a VS2008 WinForms application run without modification.) So, for example, if the window is in a restored state located at (0, 0) and I use SetWindowPlacement
to maximize it and set its restore position to (100,100), then click the window's restore button, it will restore not to (100,100) but to (0,0). It actually seems like the window first restores to the location I set, THEN moves back to its last restore location prior to being manipulated programmatically. I'm confused as to why this would happen only on WinForm windows - every non-WinForm window I try this on restores correctly to the position I indicated with SetWindowPlacement
.
I know that's not much to go on, but I was wondering if anyone here had any ideas about why this is happening. Thanks.