Article View: borland.public.cppbuilder.nativeapi
Article #9492Re: Global Message Hook Problem
From: Remy Lebeau (TeamB)
Date: Mon, 05 Jul 2004 19:02
Date: Mon, 05 Jul 2004 19:02
24 lines
1595 bytes
1595 bytes
"Hugo Dias" <synchron@nospam.synchron-systems.com> wrote in message news:40e96e45@newsgroups.borland.com... > HOOK MsgHook; You need to put that into shared memory so that all instances of your DLL have access to it. > LRESULT CALLBACK Hook(int nCode, WPARAM wParam, LPARAM lParam); You need to export your callback function. > case DLL_PROCESS_DETACH: > UnHook(); The DLL should not be performing the unhooking automatically. The main application that originally set the hook should be the only one that releases the hook as well. This is because your DLL will be loaded by multiple processes, so you don't want the DLL to release the hook every time a process terminates. Gambit
Technical Details
Message-ID:
<40e9a5a3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40e96e45@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2561144f470ed1bd X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <40e96e45@newsgroups.borland.com> Subject: Re: Global Message Hook Problem Date: Mon, 5 Jul 2004 12:02:16 -0700 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 x-mimeole: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.10 Message-ID: <40e9a5a3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1089054115 68.69.17.10 (5 Jul 2004 12:01:55 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail