The WinStoreWindowPos function will save the current size and position of the window specified by hwnd.
#define INCL_WINWORKPLACE
#include <os2.h>
PSZ pAppName; /* Pointer to application name. */
PSZ pKeyName; /* Pointer to key name. */
HWND hwnd; /* Window handle for the window to be stored. */
BOOL rc; /* Success indicator. */
rc = WinStoreWindowPos(pAppName, pKeyName,
hwnd);