Jump to content

WinTerminateApp: Difference between revisions

From EDM2
Ak120 (talk | contribs)
No edit summary
 
Line 2: Line 2:
  WinTerminateApp(appHndl)
  WinTerminateApp(appHndl)


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


=== Returns ===
==Returns ==
Returns [[BOOL]]:
Returns [[BOOL]]:
* [[TRUE]]
* [[TRUE]]
Line 14: Line 14:
* PMERR_CANNOT_STOP
* PMERR_CANNOT_STOP


=== Define (C/C++) ===
== Define (C/C++) ==
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM
INCL_WINWINDOWMGR or INCL_WIN or INCL_PM


=== Calling Convention ===
== Calling Convention ==
[[Cdecl32]]
[[Cdecl32]]


=== Example Code ===
== Example Code ==
  HAPP    appHndl;
  HAPP    appHndl;
  BOOL    rc;
  BOOL    rc;
Line 26: Line 26:
  rc = WinTerminateApp(appHndl);
  rc = WinTerminateApp(appHndl);
  ...
  ...
=== Related Functions ===
*[[WinStartApp]]


=== Notes ===
=== Notes ===
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 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.
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.
==Related Functions ==
*[[WinStartApp]]


[[Category:Win]]
[[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