Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Alle Fenster auf dem Desktop minimieren

0 views
Skip to first unread message

Erkan Bostanci

unread,
Apr 16, 2002, 10:54:46 AM4/16/02
to
Hallo,
ich möchte alle gerade auf dem Desktop angezeigten Fenster minimieren
(programmatisch), so ähnlich wie der Button in der Taskleiste "Show
Desktop".
Ich kann mit der Anweisung:
CWnd * pcwndDesktop = GetDesktopWindow();
an das Desktop-Window kommen, aber wenn ich dann durch alle Kind-Fenster
iteriere, mit:
CWnd * pcwndNext = pcwndDesktop->GetWindow(GW_CHILD);
while (pcwndNext)
{
pcwndNext->ShowWindow(SW_MINIMIZE);
pcwndNext = pcwndNext->GetWindow(GW_HWNDNEXT);
}
und die Kinder minimiere, klappts nicht. In der Hilfe steht, das bei
SW_MINIMIZE das angegebene Fenster minimiert wird und dann das in der Liste
folgende aktiviert wird. Das will ich eigenltich gar nicht.
Hat jemand eine Idee, wie man das Problem lösen kann ?

Danke, Erkan.


Martin Horst

unread,
Apr 16, 2002, 12:30:57 PM4/16/02
to
On Tue, 16 Apr 2002 15:54:46 +0100, "Erkan Bostanci" <ebos...@dspace.de> wrote:

Hi,

>Hallo,
>ich möchte alle gerade auf dem Desktop angezeigten Fenster minimieren
>(programmatisch), so ähnlich wie der Button in der Taskleiste "Show
>Desktop".
>Ich kann mit der Anweisung:
>CWnd * pcwndDesktop = GetDesktopWindow();
>an das Desktop-Window kommen, aber wenn ich dann durch alle Kind-Fenster
>iteriere, mit:
> CWnd * pcwndNext = pcwndDesktop->GetWindow(GW_CHILD);
> while (pcwndNext)
> {
> pcwndNext->ShowWindow(SW_MINIMIZE);
> pcwndNext = pcwndNext->GetWindow(GW_HWNDNEXT);
> }

versuche es mal hier mit GetNextWindow.

>und die Kinder minimiere, klappts nicht. In der Hilfe steht, das bei
>SW_MINIMIZE das angegebene Fenster minimiert wird und dann das in der Liste
>folgende aktiviert wird. Das will ich eigenltich gar nicht.
>Hat jemand eine Idee, wie man das Problem lösen kann ?

Das sollte eigentlich egal sein, da du ja aller Fenster der Reihe nach minimierst.

MfG
Martin

Erkan Bostanci

unread,
Apr 18, 2002, 2:58:34 AM4/18/02
to
Hallo Martin,
in der Hilfe steht, dass die Anweisungen:
pcwndNext = pcwndNext->GetWindow(GW_HWNDNEXT);
pcwndNext = pcwndNext->GetNextWindow();
identisch sind. Trotzdem habe ich es probiert, --> keine Veränderung des
Verhaltens.

Tschoe, Erkan.


"Martin Horst" <MHo...@unprotect.de> wrote in message
news:a9hji9$90l$02$1...@news.t-online.com...

Edzard Egberts

unread,
Apr 18, 2002, 7:07:24 AM4/18/02
to
Hallo Erkan,

"Erkan Bostanci" <ebos...@dspace.de> schrieb im Newsbeitrag
news:a9hadm$9pd$1...@desperado.vew-telnet.net...
> pcwndNext->ShowWindow(SW_MINIMIZE);

> und die Kinder minimiere, klappts nicht. In der Hilfe steht, das bei
> SW_MINIMIZE das angegebene Fenster minimiert wird und dann das in der
Liste
> folgende aktiviert wird. Das will ich eigenltich gar nicht.

Was passiert denn mit SW_SHOWMINIMIZED?

Gruß,

Ed

Stefan Kuhr

unread,
Apr 18, 2002, 7:09:30 AM4/18/02
to
Hallo Erkan,

Erkan Bostanci wrote:
>
> Hallo,
> ich möchte alle gerade auf dem Desktop angezeigten Fenster minimieren
> (programmatisch), so ähnlich wie der Button in der Taskleiste "Show
> Desktop".

> <schnipp>


> Hat jemand eine Idee, wie man das Problem lösen kann ?

Folgender Code funktioniert, benoetigt aber Version 4.71 der shell32.dll
(kommt bei IE4 mit):

#include <windows.h>
#include <shlguid.h>
#include <shobjidl.h>

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow )
{
HRESULT sc;
IShellDispatch *pShellDisp = NULL;
CoInitialize(NULL);

sc = CoCreateInstance( CLSID_Shell, NULL, CLSCTX_SERVER,
IID_IDispatch, (LPVOID *) &pShellDisp );
if( FAILED(sc) )
return 255;

pShellDisp->MinimizeAll();
pShellDisp->Release();

CoUninitialize();
return 0;
}


HTH,


--
Stefan Kuhr, Student of Master Course "Software Technology", Stuttgart

The Email adress in the header is a valid address, however I won't read
any mails arriving at this address. Please reply in the newsgroups where
I am posting. If you cannot refrain from sending email, change the host
address in the header's email address to @pandora.rz.fht-stuttgart.de

0 new messages