Danke, Erkan.
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
Tschoe, Erkan.
"Martin Horst" <MHo...@unprotect.de> wrote in message
news:a9hji9$90l$02$1...@news.t-online.com...
"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
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