I'm trying to save the position of my main window so that I can restore it later. To do so I put the following code into my close button event:
Dialog Get Loc hWndForm To Xpos, Ypos
Xpos and Ypos are always returned as zero. This seems to imply that the forms parent is not the desktop, but most likely a hidden window lying at the same location as this sibling.
Can someone offer assistance with how I should be obtaining the windows position, and then restoring it when I next start up?
BTW, I trapped on the WM_MOVE event in the CUSTOM event. That worked okay but I'm kinda wondering whether this would be the best way, and how/where I should define the startup windows position?
Andrew
I don't know if the PB DDT command is expecting a Windows Dialog.... I don't intermix DDT with SDK.
You may try using FireFly's wrapper: FF_Control_GetLoc.
You can also use FF_Control_GetSize.
Store all four values to your configuration file and set them upon program start. ie. FF_Control_SetLoc and FF_Control_SetSize.
You may also need to save and restore the Form's Show State. Check out the Win32 API functions: IsIconic, IsZoomed.
Works a treat! Thanks Paul.
Andrew