Article View: borland.public.cppbuilder.nativeapi
Article #140Re: enum windows
From: Ed Mulroy [TeamB]
Date: Sat, 14 Jun 2008 21:39
Date: Sat, 14 Jun 2008 21:39
50 lines
2447 bytes
2447 bytes
> ...i need to find the left and top position of the window. How can i find
> the positin of the window...
RECT r;
GetWindowRect(hwnd, &r);
// left is r.left, top is r.top
If the window is a client window then coordinates will be with respect to
the parent. In that case you can use MapWindowPoints to express them in
screen coordinates.
. Ed
> sa wrote in message
> news:48541a98@newsgroups.borland.com...
>
> i am using code from previous posting to enumerate opened windows and
> minimize.
>
>
> BOOL CALLBACK MinimizeAllWindows(HWND hwnd,LPARAM lParam)
> {
> // determine if the window is owned by anyone
> HWND hParent = GetWindow(hwnd, GW_OWNER);
>
> // if the window is ownerless, and if it is visible,
> // then minimize it to the desktop
> if((hParent == NULL) && IsWindowVisible(hwnd))
> {
> ShowWindow(hwnd, SW_MINIMIZE);
> }
>
> // return true to continue the enumeration
> return TRUE;
> }
>
> void __fastcall TForm1::Button1Click(TObject *Sender)
> {
> // enumerate the desktop windows
> EnumWindows((WNDENUMPROC)MinimizeAllWindows, 0);
> }
>
> 1.Before minimzing, i need to find the left and top position of the
> window. How can i find the positin of the window here.
>
> if((hParent == NULL) && IsWindowVisible(hwnd))
> {
> ShowWindow(hwnd, SW_MINIMIZE);
> }
Technical Details
Message-ID:
<48543aaa$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!ecngs!feeder2.ecngs.de!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<48541a98@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,880c539bef181b05 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Ed Mulroy [TeamB]" <dont_email_me@bitbuc.ket> Newsgroups: borland.public.cppbuilder.nativeapi References: <48541a98@newsgroups.borland.com> Subject: Re: enum windows Date: Sat, 14 Jun 2008 17:39:55 -0400 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 NNTP-Posting-Host: 69.142.0.27 Message-ID: <48543aaa$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1213479594 69.142.0.27 (14 Jun 2008 14:39:54 -0700) X-Authenticated-User: edmulroy Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!ecngs!feeder2.ecngs.de!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail