Jump to content

WinStartApp: Difference between revisions

From EDM2
Ak120 (talk | contribs)
No edit summary
Line 3: Line 3:


=== Parameters ===
=== Parameters ===
; notifyHndl - [[OS2 API:DataType:HWND|HWND]] - input : The window notification handle or [[OS2 API:DataType:NULLHANDLE|NULLHANDLE]].  If a window handle is passed, the system passes the [[OS2_API:Constant:WM#WM_APPTERMINATENOTIFY|WM_APPTERMINATENOTIFY]] message upon program exit.
; notifyHndl - [[HWND]] - input : The window notification handle or [[NULLHANDLE]].  If a window handle is passed, the system passes the WM_APPTERMINATENOTIFY message upon program exit.
 
; progDetails - [[PROGDETAILS]] - input : The program list structure.
; progDetails - [[OS2 API:DataType:PROGDETAILS|PROGDETAILS]] - input : The program list structure.
; progParams - [[PSZ]] - input : [[NULL]] or the parameters for the program to be started.  The layout is first, the program's exe name; the second, the space separated arguments.
 
; reserved - [[PVOID]] - input : Start data.  Reserved - pass NULL.
; progParams - [[OS2 API:DataType:PSZ|PSZ]] - input : [[OS2 API:Constant:NULL|NULL]] or the parameters for the program to be started.  The layout is first, the program's exe name; the second, the space separated arguments.
 
; reserved - [[OS2 API:DataType:PVOID|PVOID]] - input : Start data.  Reserved - pass [[OS2 API:Constant:NULL|NULL]].


; flags - [[OS2 API:DataType:ULONG|ULONG]] - input : Zero for no flags or:
; flags - [[OS2 API:DataType:ULONG|ULONG]] - input : Zero for no flags or:
Line 22: Line 19:


=== Returns ===
=== Returns ===
;[[OS2_API:DataType:HAPP|HAPP]] : The invoked applications handle of this type.
;[[HAPP]] : The invoked applications handle of this type.
;[[OS2_API:DataType:NULLHANDLE|NULLHANDLE]] : An error occurred.
;[[NULLHANDLE]] : An error occurred.
Possible returns from [[OS2 API:WinGetLastError|WinGetLastError]]:
Possible returns from [[WinGetLastError]]:
* [[OS2 API:PMI:error#PMERR_CANNOT_START|PMERR_CANNOT_START]]
* [[OS2 API:PMI:error#PMERR_CANNOT_START|PMERR_CANNOT_START]]
* [[OS2 API:PMI:error#PMERR_DOS_ERROR|PMERR_DOS_ERROR]]
* [[OS2 API:PMI:error#PMERR_DOS_ERROR|PMERR_DOS_ERROR]]
Line 33: Line 30:
* [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]]
* [[OS2 API:PMI:error#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]]
* [[OS2 API:PMI:error#PMERR_STARTED_IN_BACKGROUND|PMERR_STARTED_IN_BACKGROUND]]
* [[OS2 API:PMI:error#PMERR_STARTED_IN_BACKGROUND|PMERR_STARTED_IN_BACKGROUND]]
=== Module ===


=== Define (C/C++) ===
=== Define (C/C++) ===
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
=== Export name/Ordinal ===


=== Calling conversion ===
=== Calling conversion ===
Line 45: Line 38:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:HWND|HWND]]       notifyHndl;
  HWND        notifyHndl;
  [[OS2 API:DataType:PROGDETAILS|PROGDETAILS]] progDetails;
  PROGDETAILS progDetails;
  [[OS2 API:DataType:PSZ|PSZ]]         progParams;
  PSZ        progParams;
  [[OS2 API:DataType:PVOID|PVOID]]       reserved = [[OS2_API:Constant:NULL|NULL]];
  PVOID      reserved = NULL;
  [[OS2 API:DataType:ULONG|ULONG]]       flags;
  ULONG      flags;
  [[OS2 API:DataType:HAPP|HAPP]]       invokedHndl;
  HAPP        invokedHndl;
  ...
  ...
  // populate PROGDETAILS structure...
  // populate PROGDETAILS structure...
Line 58: Line 51:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:WinQueryTaskSizePos|WinQueryTaskSizePos]]
*[[WinQueryTaskSizePos]]
[[OS2 API:WinSetWindowPos|WinSetWindowPos]]
*[[WinSetWindowPos]]
[[OS2 API:WinTerminateApp|WinTerminateApp]]
*[[WinTerminateApp]]


=== Notes ===
=== Notes ===
Specifying [[OS2 API:Constant:SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] flag, the newly invoked program can be stopped with [[OS2_API:WinTerminateApp|WinTerminateApp]].
Specifying [[OS2 API:Constant:SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] flag, the newly invoked program can be stopped with [[WinTerminateApp]].
 
=== OS Version Introduced ===
 
 
 
[[OS2_API | Back to OS/2 API]]
 


[[Category:The OS/2 API Project]]
[[Category:Win]]

Revision as of 18:35, 29 November 2016

WinStartApp

WinStartApp(notifyHndl, progDetails, progParams, reserved, flags)
Execute a program.

Parameters

notifyHndl - HWND - input
The window notification handle or NULLHANDLE. If a window handle is passed, the system passes the WM_APPTERMINATENOTIFY message upon program exit.
progDetails - PROGDETAILS - input
The program list structure.
progParams - PSZ - input
NULL or the parameters for the program to be started. The layout is first, the program's exe name; the second, the space separated arguments.
reserved - PVOID - input
Start data. Reserved - pass NULL.
flags - ULONG - input
Zero for no flags or:

Constants

None

Returns

HAPP
The invoked applications handle of this type.
NULLHANDLE
An error occurred.

Possible returns from WinGetLastError:

Define (C/C++)

INCL_WINWINDOWMGR or INCL_WIN or INCL_PM

Calling conversion

Cdecl32

Example Code

HWND        notifyHndl;
PROGDETAILS progDetails;
PSZ         progParams;
PVOID       reserved = NULL;
ULONG       flags;
HAPP        invokedHndl;
...
// populate PROGDETAILS structure...
...
invokedHndl = WinStartApp(notifyHndl, progDetails, progParams, reserved, flags);
...

Related Functions

Notes

Specifying SAF_STARTCHILDAPP flag, the newly invoked program can be stopped with WinTerminateApp.