Jump to content

WinStartApp: Difference between revisions

From EDM2
Ak120 (talk | contribs)
mNo edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 5: Line 5:


=== Parameters ===
=== 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.
; 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 - 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.
; 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.
; reserved - [[PVOID]] - input : Start data. Reserved - pass NULL.
 
; flags - [[ULONG]] - input : Zero for no flags or:
; flags - [[ULONG]] - input : Zero for no flags or:
* [[SAF#SAF_BACKGROUND|SAF_BACKGROUND]]
* [[SAF#SAF_BACKGROUND|SAF_BACKGROUND]]

Revision as of 18:54, 6 January 2023

Execute a program.

Syntax

WinStartApp (notifyHndl, progDetails, progParams, reserved, flags)

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 Convention

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.