` Shutting down a running EXE from another EXE -- Window Title known (Jim Kane ) - Icetips Article
Icetips - Templates, Tools & Utilities for Clarion Developers

Templates, Tools and Utilities
for Clarion Developers

Icetips Article

Back to article list   Search Articles     Add Comment     Printer friendly     Direct link  

Par2: Shutting down a running EXE from another EXE -- Window Title known
1998-08-04 -- Jim Kane
 
The steps involved are to 1st get the hwnd or windows handle for the frame or main window of the app to be shut down, then post a wm_close message to that hwnd. Step 1 is simple if the text on the title line of the app is always the same - just use the findwindow() api: wm_Close equate(10H) titlestr cstring(80) hwnd unsigned Titlestr = 'Calculator' !or what ever it is hwnd=findwindow(titlestr,) Then once you want a hwnd: PostMessage(hwnd,wm_close,0,0) You can get the prototypes for the api calls from the winapi program with cw


Today is November 21, 2024, 3:58 am
This article has been viewed 35196 times.



Back to article list   Search Articles   Add Comment   Printer friendly

Login

User Name:

Password: