Jump to content

WinWaitForShell: Difference between revisions

From EDM2
Prokushev (talk | contribs)
No edit summary
changed some so not verbatim of IBM's toolkit documentation
Line 1: Line 1:
== WinWaitForShell ==
== WinWaitForShell ==
; WinWaitForShell(ulEvent) :
; WinWaitForShell(event) :
Allows an application to wait for the Workplace Shell to become available.
Allows an application to wait for the Workplace Shell to become available.


=== Parameters ===
=== Parameters ===
; ulEvent - [[OS2_API:DataType:ULONG|ULONG]] - input :
; event - [[OS2_API:DataType:ULONG|ULONG]] - input :
The event to wait for.
The event being waited upon.


=== Constants ===
=== Constants ===
The following constants are defined for the parameter ulEvent:
Constants defined for event:


#define WWFS_QUERY           0x80000000
* [[OS2 API:WPS:Constant#WWFS_QUERY|WWFS_QUERY]]
#define WWFS_DESKTOPCREATED   1
* [[OS2 API:WPS:Constant#WWFS_DESKTOPCREATED|WWFS_DESKTOPCREATED]]
#define WWFS_DESKTOPOPENED   2
* [[OS2 API:WPS:Constant#WWFS_DESKTOPOPENED|WWFS_DESKTOPOPENED]]
#define WWFS_DESKTOPPOPULATED 3
* [[OS2 API:WPS:Constant#WWFS_DESKTOPPOPULATED|WWFS_DESKTOPPOPULATED]]


=== Returns ===
=== Returns ===
This function returns a [[OS2_API:DataType:BOOL|BOOL]] with the values of:
Returns [[OS2_API:DataType:BOOL|BOOL]] with the values of:
* [[OS2_API:DataType:TRUE|TRUE]]
* [[OS2_API:DataType:TRUE|TRUE]]
* [[OS2_API:DataType:FALSE|FALSE]]
* [[OS2_API:DataType:FALSE|FALSE]]


=== Module ===
=== Module ===


=== Define (C/C++) ===
=== Define (C/C++) ===
INCL_WINWORKPLACE


=== Export name/Ordinal ===
=== Export name/Ordinal ===
Line 31: Line 31:


=== Example Code ===
=== Example Code ===
#define INCL_WINWORKPLACE
  BOOL rc;
#define INCL_WINDIALOGS
  ...
#define INCL_WIN
  rc = WinWaitForShell(WWFS_DESKTOPPOPULATED); // Desktop populated
#include <os2.h>
  ...
// Define function not found in headers
  BOOL APIENTRY WinWaitForShell( ULONG ulEvent );
   
  #define WWFS_QUERY            0x80000000
#define WWFS_DESKTOPCREATED  1
#define WWFS_DESKTOPOPENED    2
#define WWFS_DESKTOPPOPULATED 3
int main(int argc, char *argv[])
{
    HAB  hab;
    HMQ  hmq;
    BOOL fShellPopulated;
    fShellPopulated = WinWaitForShell(WWFS_DESKTOPPOPULATED); // Desktop populated
    if (fShellPopulated) {
      DosBeep(440, 1000);
      hab = WinInitialize(0);
      hmq = WinCreateMsgQueue(hab, 0);
      WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, "Desktop was populated", "Message", 0x100, MB_OK|MB_ICONASTERISK);
   
      WinDestroyMsgQueue(hmq);
      WinTerminate(hab);
    } else {
      DosBeep(220, 1000);
    }
    return 0;
}


=== Related Functions ===
=== Related Functions ===


=== Notes ===
=== Notes ===
WinWaitForShell can not be called from detached processes. So a program started by
[[OS2 API:WinWaitForShell|WinWaitForShell]] can not be called from detached processes. So a program started by a RUN= statement in config sys, can not rely on this method to wait for the shell to be up.
a RUN= statement in config sys, can not rely on this method to wait for the shell
to be up.


A message queue is not required for the thread which calls WinWaitForShell.
A message queue is not required for the thread which calls [[OS2_API:WinWaitForShell|WinWaitForShell]].


The prototype and defines for this function are defined in wpobject.h, which may be inaccessible if not compiling a WPS object class. Copy the defines and the prototype verbatim into your own code or headers for use. It is exported through os2386.lib in the OS/2 Warp 4 Toolkit.
The prototype and defines for this function are defined in wpobject.h, which may be inaccessible if not compiling a WPS object class. Copy the defines and the prototype verbatim into your own code or headers for use. It is exported through os2386.lib in the OS/2 Warp 4 Toolkit.

Revision as of 19:26, 10 May 2005

WinWaitForShell

WinWaitForShell(event)

Allows an application to wait for the Workplace Shell to become available.

Parameters

event - ULONG - input

The event being waited upon.

Constants

Constants defined for event:

Returns

Returns BOOL with the values of:

Module

Define (C/C++)

INCL_WINWORKPLACE

Export name/Ordinal

Calling conversion

Cdecl32

Example Code

BOOL rc;
...
rc = WinWaitForShell(WWFS_DESKTOPPOPULATED); // Desktop populated
...

Related Functions

Notes

WinWaitForShell can not be called from detached processes. So a program started by a RUN= statement in config sys, can not rely on this method to wait for the shell to be up.

A message queue is not required for the thread which calls WinWaitForShell.

The prototype and defines for this function are defined in wpobject.h, which may be inaccessible if not compiling a WPS object class. Copy the defines and the prototype verbatim into your own code or headers for use. It is exported through os2386.lib in the OS/2 Warp 4 Toolkit.

OS Version Introduced

OS/2 Warp 4