Article View: borland.public.cppbuilder.nativeapi
Article #17410Re: Hooking another application
From: Remy Lebeau (TeamB)
Date: Thu, 27 Mar 2003 01:16
Date: Thu, 27 Mar 2003 01:16
23 lines
1841 bytes
1841 bytes
WH_GETMESSAGE hooks are only called when GetMessage() or PeekMessage() is called for retreiving messages from the calling thread's message queue. But, SendMessage() doesn't use the message queue at all, it sends the message directly to the window procedure of the target window. In order to track the message queue, you need to use PostMessage() instead of SendMessage(). Otherwise, your DLL needs to install a WH_CALLWNDPROC hook at well in order to support messagses sent with SendMessage() in addition to messages posted to the queue with PostMessage(). Gambit "nicolasr" <nicolasrATSIGNgmx.net> wrote in message news:3e824b00@newsgroups.borland.com... > and implements the hook callback function with the > WH_GETMESSAGE hook type. <snip> > SendMessage(hwndServer, HOOK_WM_TEST, 0, 0); > > But this messages does not arrive in the DLL callback > function.
Technical Details
Message-ID:
<3e824e7e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3e824b00@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,c5183b6fe95bcc6 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-03-26 21:04:52 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3e824b00@newsgroups.borland.com> Subject: Re: Hooking another application Date: Wed, 26 Mar 2003 17:16:00 -0800 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3e824e7e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1048727166 207.175.226.26 (26 Mar 2003 17:06:06 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail