The WinRestoreWindowPos function will restore the size and position of the window specified by hwnd to the state it was in when WinStoreWindowPos was last called with the same pAppName and pKeyName.
#define INCL_WINWORKPLACE #include <os2.h> PSZ pAppName; /* Pointer to application name. */ PSZ pKeyName; /* Pointer to key name. */ HWND hwnd; /* Window handle of the window to restore. */ BOOL rc; /* Success indicator. */ rc = WinRestoreWindowPos(pAppName, pKeyName, hwnd);