Article View: borland.public.cppbuilder.nativeapi
Article #17202Re: More sending mouse clicks?
From: Chris W
Date: Wed, 02 Apr 2003 19:39
Date: Wed, 02 Apr 2003 19:39
27 lines
1764 bytes
1764 bytes
Does that mean that windows executes simmilar code to your example every time
the user clicks the mouse?
Chris W
"Remy Lebeau (TeamB)" wrote:
> Nope. You have to locate the main window at the desired screen coordinates
> first, and then recursive iterate through its child windows until you find
> the one you are looking for. For example:
>
> POINT p = some screen coordinates;
> HWND hWnd = ::WindowFromPoint(p);
> while( hWnd != NULL )
> {
> POINT p2 = p;
> ::ScreenToClient(hWnd, &p2);
> HWND hChild = ::ChildWindowFromPoint(hWnd, p2);
> if( hChild == NULL || hChild == hWnd )
> break;
> hWnd = hChild;
> }
>
> if( hWnd != NULL )
> // send messages to hWnd as needed
>
> Gambit
Technical Details
Message-ID:
<3E8B3C6D.791BD13D@cox.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3E8B193A.11681D9C@cox.net> <3e8b1fa3$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,a4bcdcbe0081dd78 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-02 11:45:01 PST Message-ID: <3E8B3C6D.791BD13D@cox.net> Date: Wed, 02 Apr 2003 13:39:25 -0600 From: Chris W <chrisw3@cox.net> X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: More sending mouse clicks? References: <3E8B193A.11681D9C@cox.net> <3e8b1fa3$1@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.12.125.52 X-Trace: newsgroups.borland.com 1049312314 68.12.125.52 (2 Apr 2003 11:38:34 -0800) Lines: 31 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail