Jump to content

WinRestoreWindowPos: Difference between revisions

From EDM2
Ak120 (talk | contribs)
m totally wrong content replaced
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Restores the size and position of the window
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''.


==Syntax==
== Syntax ==
WinRestoreWindowPos (AppName, KeyName, hwnd)
<pre>
#define INCL_WINWORKPLACE
#include <os2.h>


==Parameters==
PSZ     pAppName;  /*  Pointer to application name. */
;AppName (PSZ): Pointer to the application name
PSZ     pKeyName;  /*  Pointer to key name. */
;KeyName (PSZ): Pointer to the key name
HWND    hwnd;      /*  Window handle of the window to restore. */
;hwnd (HWND): Window handle
BOOL    rc;        /*  Success indicator. */


==Returns==
rc = WinRestoreWindowPos(pAppName, pKeyName,
;rc (BOOL) - returns:Return code.
       hwnd);
</pre>
 
== Parameters ==
;''pAppName'' ([[PSZ]]) - input: Pointer to application name.
:A pointer to a zero-terminated string which contains the application name.
 
;''pKeyName'' ([[PSZ]]) - input: Pointer to key name.
:A pointer to a zero-terminated string which contains the key name.
 
;''hwnd'' ([[HWND]]) - input: Window handle of the window to restore.
 
== Returns ==
;''rc'' ([[BOOL]]) - returns: Success indicator.
:TRUE: Successful completion.
:FALSE: Error occurred.
 
== Remarks ==
This function will also restore presentation parameters which were saved by a previous call to [[WinStoreWindowPos]].
 
==Example Code==
Declaration:
<PRE>
#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);
</PRE>
 
== Related Functions ==
* [[WinStoreWindowPos]]


[[Category:Win]]
[[Category:Win]]

Latest revision as of 16:14, 15 May 2025

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.

Syntax

#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);

Parameters

pAppName (PSZ) - input
Pointer to application name.
A pointer to a zero-terminated string which contains the application name.
pKeyName (PSZ) - input
Pointer to key name.
A pointer to a zero-terminated string which contains the key name.
hwnd (HWND) - input
Window handle of the window to restore.

Returns

rc (BOOL) - returns
Success indicator.
TRUE: Successful completion.
FALSE: Error occurred.

Remarks

This function will also restore presentation parameters which were saved by a previous call to WinStoreWindowPos.

Example Code

Declaration:

#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);

Related Functions