Jump to content

WinTerminateApp: Difference between revisions

From EDM2
m Corrected PMI error code links
No edit summary
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== WinTerminateApp ==
Terminates a program started with [[WinStartApp]].
; WinTerminateApp(appHndl) :
WinTerminateApp(appHndl)
Terminates a program started with [[OS2_API:WinStartApp|WinStartApp]].


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


=== Constants ===
==Returns ==
Returns [[BOOL]]:
* [[TRUE]]
* [[FALSE]]


=== Returns ===
Possible error codes from [[WinGetLastError]]:
Returns [[OS2_API:DataType:BOOL|BOOL]]:
* PMERR_INVALID_HAPP
* [[OS2_API:Constant:TRUE|TRUE]]
* PMERR_CANNOT_STOP
* [[OS2_API:Constant:FALSE|FALSE]]


Possible error codes from [[OS2_API:WinGetLastError|WinGetLastError]]:
== Define (C/C++) ==
* [[OS2_API:Constant:PMI:error#PMERR_INVALID_HAPP|PMERR_INVALID_HAPP]]
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
* [[OS2_API:Constant:PMI:error#PMERR_CANNOT_STOP|PMERR_CANNOT_STOP]]


=== Module ===
== Calling Convention ==
 
=== Define (C/C++) ===
INCL_WINWINDOWMGR
 
=== Export name/Ordinal ===
 
=== Calling conversion ===
[[Cdecl32]]
[[Cdecl32]]


=== 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);
  ...
  ...


=== Related Functions ===
=== Notes ===
[[OS2 API:WinStartApp|WinStartApp]]
This function works only if [[SAF|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.


=== 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 must be called from the same process that called [[OS2_API:WinStartApp|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 ===
==Related Functions ==
*[[WinStartApp]]
 
 
[[Category:Win]]

Latest revision as of 18:58, 14 May 2025

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);
...

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.

Related Functions