How to close a process

Zebediah Figura z.figura12 at
Mon Mar 19 09:35:09 CDT 2018

On 19/03/18 05:25, Carlos Vega García wrote:
> Hi!
> I’m doing a test for the explorer.exe. The first part tests if the
> explorer Windows open.
> For that I´m using the function CreateProcessA(), the problem is that I
> can’t close the explorer that I have created.

Hello Carlos,

The problem in this case is that native explorer.exe windows aren't (by
default) associated with a specific process. Starting an explorer.exe
process instead creates a window in the "main" explorer process.

It's possible to detect and close these windows—either using the
IShellWindows interface (which doesn't currently work on Wine) or simply
by looking for a window with matching title and class (as in
shell32:progman_dde). You would then post a WM_QUIT message to the
window. Unfortunately I'm not sure either method is really advisable,
since you don't have much control over how long the window will take to
appear. The progman_dde tests already fail intermittently on Windows.


More information about the wine-devel mailing list