Jump to content

WinTerminateApp: Difference between revisions

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


=== Parameters ===
=== Parameters ===
; appHndl - [[OS2_API:DataType:HAPP|HAPP]] - input : The application handle as returned by [[OS2_API:WinStartApp|WinStartApp]].
;appHndl - [[HAPP]] - input : The application handle as returned by WinStartApp.
 
=== Constants ===


=== Returns ===
=== Returns ===
Returns [[OS2_API:DataType:BOOL|BOOL]]:
Returns [[BOOL]]:
* [[OS2_API:Constant:TRUE|TRUE]]
* [[TRUE]]
* [[OS2_API:Constant:FALSE|FALSE]]
* [[FALSE]]


Possible error codes from [[OS2_API:WinGetLastError|WinGetLastError]]:
Possible error codes from [[OS2_API:WinGetLastError|WinGetLastError]]:
* [[OS2_API:PMI:error#PMERR_INVALID_HAPP|PMERR_INVALID_HAPP]]
* [[OS2_API:PMI:error#PMERR_INVALID_HAPP|PMERR_INVALID_HAPP]]
* [[OS2_API:PMI:error#PMERR_CANNOT_STOP|PMERR_CANNOT_STOP]]
* [[OS2_API:PMI:error#PMERR_CANNOT_STOP|PMERR_CANNOT_STOP]]
=== 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 27: Line 21:


=== Example Code ===
=== Example Code ===
  [[OS2 API:DataType:HAPP|HAPP]]   appHndl;
  HAPP    appHndl;
  [[OS2_API:DataType:BOOL|BOOL]]   rc;
  BOOL    rc;
  ...
  ...
  rc = WinTerminateApp(appHndl);
  rc = WinTerminateApp(appHndl);
Line 34: Line 28:


=== Related Functions ===
=== Related Functions ===
[[OS2 API:WinStartApp|WinStartApp]]
*[[WinStartApp]]


=== 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 [[OS2_API:WinStartApp|WinStartApp]] will receive the [[OS2_API:Constant:WM#WM_APPTERMINATENOTIFY|WM_APPTERMINATENOTIFY]] message.
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 must be called from the same process that called [[OS2_API:WinStartApp|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.


=== OS Version Introduced ===
[[Category:Win]]
 
[[OS2_API | Back to OS/2 API]]
 
 
[[Category:The OS/2 API Project]]

Revision as of 18:38, 29 November 2016

WinTerminateApp

WinTerminateApp(appHndl)
Terminates a program started with WinStartApp.

Parameters

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

Returns

Returns BOOL:

Possible error codes from WinGetLastError:

Define (C/C++)

INCL_WINWINDOWMGR or INCL_WIN or INCL_PM

Calling conversion

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.