WinInitialize: Difference between revisions
Appearance
No edit summary |
|||
Line 1: | Line 1: | ||
; WinInitialize( ''flOptions'' ); : Initializes the PM facilities to be used by an application. | ; WinInitialize( ''flOptions'' ); : Initializes the PM facilities to be used by an application. | ||
==Usage Explanation== | |||
This function must be the first PM function called by any application thread intending to use PM or GPI services. The return value is sometimes needed by other functions and should be saved. WinTerminate can be called if a thread no longer needs these services. This API can only be called once per thread. | This function must be the first PM function called by any application thread intending to use PM or GPI services. The return value is sometimes needed by other functions and should be saved. WinTerminate can be called if a thread no longer needs these services. This API can only be called once per thread. | ||
===Parameters=== | ===Parameters=== | ||
; ULONG ''flOptions'' (input) | ; ULONG ''flOptions'' (input) | ||
: The only allowed value is 0L. | : The only allowed value is 0L. | ||
===Returns=== | ===Returns=== | ||
; HAB hab | ; HAB hab | ||
: This return value is a handle to an anchor block. The anchor block is a structure which is used by OS/2 to keep track of application specific error information, and the handle is needed for certain other PM functions, such as WinCreateMsgQueue. NULLHANDLE is returned if an error occurred. | : This return value is a handle to an anchor block. The anchor block is a structure which is used by OS/2 to keep track of application specific error information, and the handle is needed for certain other PM functions, such as WinCreateMsgQueue. NULLHANDLE is returned if an error occurred. | ||
===Define (C/C++)=== | ===Define (C/C++)=== | ||
#define INCL_WINWINDOWMGR | #define INCL_WINWINDOWMGR | ||
or | or | ||
Line 28: | Line 21: | ||
===Sample Code=== | ===Sample Code=== | ||
[[HAB]] hab; | [[HAB]] hab; | ||
[[ULONG]] flOptions = 0L; | [[ULONG]] flOptions = 0L; | ||
Line 37: | Line 29: | ||
===See Also=== | ===See Also=== | ||
* [[WinCreateMsgQueue]] | |||
* [[WinGetLastError]] | |||
*[[WinGetErrorInfo]] | |||
*[[WinQueryAnchorBlock]] | |||
*[[WinTerminate]] | |||
[[Category:Win]] | |||
[[Category: |
Revision as of 12:12, 17 November 2016
- WinInitialize( flOptions );
- Initializes the PM facilities to be used by an application.
Usage Explanation
This function must be the first PM function called by any application thread intending to use PM or GPI services. The return value is sometimes needed by other functions and should be saved. WinTerminate can be called if a thread no longer needs these services. This API can only be called once per thread.
Parameters
- ULONG flOptions (input)
- The only allowed value is 0L.
Returns
- HAB hab
- This return value is a handle to an anchor block. The anchor block is a structure which is used by OS/2 to keep track of application specific error information, and the handle is needed for certain other PM functions, such as WinCreateMsgQueue. NULLHANDLE is returned if an error occurred.
Define (C/C++)
#define INCL_WINWINDOWMGR
or
#define INCL_WIN
or
#define INCL_PM #include <os2.h>
Sample Code
HAB hab; ULONG flOptions = 0L; HMQ hmq; hab=WinInitialize(flOptions); hmq=WinCreateMsgQueue(hab, 0L);