🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: about get window by pos.

#15460
From: Remy Lebeau (TeamB)
Date: Sun, 29 Jun 2003 04:54
36 lines
2126 bytes
"Siney San" <siney@yeah.net> wrote in message
news:3efe571b@newsgroups.borland.com...

> your code is also useless

I did say the code was untested.

> i copy-paste it into bcb ide,compiled,linked and
> ran it,but can't alow get disabled window.

I finally got around to testing the code I posted earlier, and it worked
fine for me, with a couple of minor changes.  The following code worked fine
for me in locating both disabled top-level windows and disabled child
windows:

    HWND TMainForm::GetRealWindow(POINT ptPoint)
    {
        HWND hParent = ::GetDesktopWindow();
        HWND hChild = ::ChildWindowFromPoint(hParent, ptPoint);

        while( (hChild) && (hChild != hParent) )
        {
            ::MapWindowPoints(hParent, hChild, &ptPoint, 1);
            hParent = hChild;

            hChild = ::ChildWindowFromPoint(hParent, ptPoint);
            if( !hChild )
                return hParent;
        }

        return hChild;
    }


Gambit
Technical Details
Message-ID: <3efe7016@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3efbf96b@newsgroups.borland.com> <3efc70d0@newsgroups.borland.com> <3efd6a06@newsgroups.borland.com> <3efdf892@newsgroups.borland.com> <3efe571b@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,5a7ad1e748c52c2b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-28 21:58:13 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3efbf96b@newsgroups.borland.com> <3efc70d0@newsgroups.borland.com> <3efd6a06@newsgroups.borland.com> <3efdf892@newsgroups.borland.com> <3efe571b@newsgroups.borland.com>
Subject: Re: about get window by pos.
Date: Sat, 28 Jun 2003 21:54:54 -0700
Lines: 38
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.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3efe7016@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1056862230 207.175.226.26 (28 Jun 2003 21:50:30 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail