🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #16710

Closing All Windows On A Desktop

#16710
From: dln
Date: Thu, 01 May 2003 02:16
17 lines
2104 bytes
I'm curious if anybody knows how the Windows Task Manager (Win2K, XP) kills
a window when the "End Process" button is clicked?  The reason I ask is I've
written an application which attempts to close all windows on the desktop by
calling DestroyWindow, passing the handle of the window to be closed as the
function's parameter.  For the most part, this works.  However, the instance
of Windows Explorer which controls the Windows shell will not close,
regardless of what API call I use.  In addition to DestroyWindow, I've tried
posting/sending a WM_QUIT and WM_CLOSE message to the window.  The WM_QUIT
does nothing (the icons on the desktop might blink a bit as if they're being
refreshed, but not much else), and the WM_CLOSE causes the "Are you sure you
want to log off?" dialog to appear (and that's not the behavior I desire).
The Windows Task Manager on the other hand, will kill any instance of
Explorer outright (regardless of whether it controls the desktop shell or
not), so it appears to use a function call that I'm not aware of to kill the
window.  Does anybody know how this is accomplished?

Thanks.
Technical Details
Message-ID: <3eb081aa@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,9a0a5b67bc017ec9,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-04-30 19:34:46 PST
From: "dln" <dnadon@nospam.austin.rr.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Closing All Windows On A Desktop
Date: Wed, 30 Apr 2003 21:16:11 -0500
Lines: 19
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 66.25.203.129
Message-ID: <3eb081aa@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1051754922 66.25.203.129 (30 Apr 2003 19:08:42 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail