🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

enum windows

#138
From: sa
Date: Sun, 15 Jun 2008 07:22
38 lines
1855 bytes
Hi all
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);
    }
Thanks
SA 
Technical Details
Message-ID: <48541a98@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,880c539bef181b05,start
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "sa" <shaikakbar250281@yahoo.co.in>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: enum windows
Date: Sun, 15 Jun 2008 10:22:34 +0300
Lines: 40
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 62.150.44.162
Message-ID: <48541a98@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1213471384 62.150.44.162 (14 Jun 2008 12:23:04 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 1676