Jump to content

WinTerminateApp: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
Line 1: Line 1:
== WinTerminateApp ==
Terminates a program started with [[WinStartApp]].
; WinTerminateApp(appHndl) : Terminates a program started with [[WinStartApp]].
WinTerminateApp(appHndl)


=== Parameters ===
=== Parameters ===
Line 10: Line 10:
* [[FALSE]]
* [[FALSE]]


Possible error codes from [[OS2_API:WinGetLastError|WinGetLastError]]:
Possible error codes from [[WinGetLastError]]:
* [[OS2_API:PMI:error#PMERR_INVALID_HAPP|PMERR_INVALID_HAPP]]
* PMERR_INVALID_HAPP
* [[OS2_API:PMI:error#PMERR_CANNOT_STOP|PMERR_CANNOT_STOP]]
* PMERR_CANNOT_STOP


=== Define (C/C++) ===
=== Define (C/C++) ===
Line 31: Line 31:


=== Notes ===
=== Notes ===
This function works only if [[OS2_API:Constant:SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] is specified at program start. The notify window handle specified in [[WinStartApp]] will receive the '''WM_APPTERMINATENOTIFY''' message.
This function works only if [[SAF#SAF_STARTCHILDAPP|SAF_STARTCHILDAPP]] is specified at program start. The notify window handle specified in [[WinStartApp]] will receive the '''WM_APPTERMINATENOTIFY''' message.
This function must be called from the same process that called WinStartApp.
This function must be called from the same process that called WinStartApp.
This function requires the existence of a message queue on the calling thread.
This function requires the existence of a message queue on the calling thread.


[[Category:Win]]
[[Category:Win]]

Revision as of 16:17, 12 March 2018

Terminates a program started with WinStartApp.

WinTerminateApp(appHndl)

Parameters

appHndl - HAPP - input
The application handle as returned by WinStartApp.

Returns

Returns BOOL:

Possible error codes from WinGetLastError:

  • PMERR_INVALID_HAPP
  • PMERR_CANNOT_STOP

Define (C/C++)

INCL_WINWINDOWMGR or INCL_WIN or INCL_PM

Calling Convention

Cdecl32

Example Code

HAPP    appHndl;
BOOL    rc;
...
rc = WinTerminateApp(appHndl);
...

Related Functions

Notes

This function works only if SAF_STARTCHILDAPP is specified at program start. The notify window handle specified in WinStartApp will receive the WM_APPTERMINATENOTIFY message. This function must be called from the same process that called WinStartApp. This function requires the existence of a message queue on the calling thread.