WinStartApp: Difference between revisions
Appearance
mNo edit summary |
|||
Line 1: | Line 1: | ||
== | Execute a program. | ||
== Syntax == | |||
WinStartApp (notifyHndl, progDetails, progParams, reserved, flags) | |||
=== 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 - 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 - [[ | ; flags - [[ULONG]] - input : Zero for no flags or: | ||
* [[ | * [[SAF#SAF_BACKGROUND|SAF_BACKGROUND]] | ||
* [[ | * [[SAF#SAF_INSTALLEDCMDLINE|SAF_INSTALLEDCMDLINE]] | ||
* [[ | * [[SAF#SAF_MAXIMIZED|SAF_MAXIMIZED]] | ||
* [[ | * [[SAF#SAF_MINIMIZED|SAF_MINIMIZED]] | ||
* [[ | * [[SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] | ||
=== Constants === | === Constants === | ||
Line 22: | Line 24: | ||
;[[NULLHANDLE]] : An error occurred. | ;[[NULLHANDLE]] : An error occurred. | ||
Possible returns from [[WinGetLastError]]: | Possible returns from [[WinGetLastError]]: | ||
* [[ | * [[PM Error Codes#PMERR_CANNOT_START|PMERR_CANNOT_START]] | ||
* [[ | * [[PM Error Codes#PMERR_DOS_ERROR|PMERR_DOS_ERROR]] | ||
* [[ | * [[PM Error Codes#PMERR_INVALID_APPL|PMERR_INVALID_APPL]] | ||
* [[ | * [[PM Error Codes#PMERR_INVALID_HWND|PMERR_INVALID_HWND]] | ||
* [[ | * [[PM Error Codes#PMERR_INVALID_PARAMETERS|PMERR_INVALID_PARAMETERS]] | ||
* [[ | * [[PM Error Codes#PMERR_INVALID_PROGRAM_CATEGORY|PMERR_INVALID_PROGRAM_CATEGORY]] | ||
* [[ | * [[PM Error Codes#PMERR_INVALID_WINDOW|PMERR_INVALID_WINDOW]] | ||
* [[ | * [[PM Error Codes#PMERR_STARTED_IN_BACKGROUND|PMERR_STARTED_IN_BACKGROUND]] | ||
=== Define (C/C++) === | === Define (C/C++) === | ||
Line 52: | Line 54: | ||
=== Related Functions === | === Related Functions === | ||
*[[WinQueryTaskSizePos]] | *[[WinQueryTaskSizePos]] | ||
* | *WinSetWindowPos | ||
*[[WinTerminateApp]] | *[[WinTerminateApp]] | ||
=== Notes === | === Notes === | ||
Specifying [[ | Specifying [[SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] flag, the newly invoked program can be stopped with [[WinTerminateApp]]. | ||
[[Category:Win]] | [[Category:Win]] |
Revision as of 15:37, 2 March 2017
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:
- PMERR_CANNOT_START
- PMERR_DOS_ERROR
- PMERR_INVALID_APPL
- PMERR_INVALID_HWND
- PMERR_INVALID_PARAMETERS
- PMERR_INVALID_PROGRAM_CATEGORY
- PMERR_INVALID_WINDOW
- PMERR_STARTED_IN_BACKGROUND
Define (C/C++)
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
Calling Convention
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
- WinQueryTaskSizePos
- WinSetWindowPos
- WinTerminateApp
Notes
Specifying SAF_STARTCHILDAPP flag, the newly invoked program can be stopped with WinTerminateApp.