Article View: borland.public.cppbuilder.nativeapi
Article #7988Re: Using SetWindowsHookEx() to target specific window control
From: KR
Date: Sat, 04 Dec 2004 14:09
Date: Sat, 04 Dec 2004 14:09
34 lines
2441 bytes
2441 bytes
Each control on a window has it's on HWND. You find the edit controls HWND using EnumChildWindows enumeration API, passing the parent window handle along with a callback function that evaluates each child HWND. You'll need to test to see which child is the edit control, because each and every control that the parent window owns will be enumerated. They'll always be passed in the same sequence, so its not so tough. Once you have your edit control's HWND, you SetWindowsHookEx on that. Intercept till your hearts content. On Thu, 18 Nov 2004 19:10:09 -0800, CC wrote: > Hi Remy - Thanks for the info - I almost follow you - > > I understand the part about the application sending custom msg, and the > dll hook function intercepting that message. > > That would at least tell the dll that the application->control is active > to receive messages (edit boxes receiving key messages, etc). > > Is there anyway for the dll hook function to distinguish which of many > controls a particular message is coming from? > > For example - the edit box I want to record info from could receive a > msg, then the user goes to another box, then jumps back to the box I'm > interested in, the recording seems to get jumbled up - which box was a > particular key stroke message intended for? > > I know I missing something still - but its a little clearer. > > Thanks very much, > CurtC
Technical Details
Message-ID:
<pan.2004.12.04.14.08.51.613799@nospamme.net>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<419cdca5$1@newsgroups.borland.com> <419cf263$1@newsgroups.borland.com> <419d476c$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a7b5d77d3a61450f X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: KR <kr@nospamme.net> Subject: Re: Using SetWindowsHookEx() to target specific window control Date: Sat, 04 Dec 2004 09:09:12 -0500 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-ID: <pan.2004.12.04.14.08.51.613799@nospamme.net> Newsgroups: borland.public.cppbuilder.nativeapi References: <419cdca5$1@newsgroups.borland.com> <419cf263$1@newsgroups.borland.com> <419d476c$1@newsgroups.borland.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 24.148.149.154 X-Trace: newsgroups.borland.com 1102169076 24.148.149.154 (4 Dec 2004 06:04:36 -0800) Lines: 34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail