Article View: comp.os.ms-windows.programmer
Article #26calling functions in DLLs from inside a Hook
From: greg.boyko
Date: Mon, 30 Aug 1999 00:00
Date: Mon, 30 Aug 1999 00:00
38 lines
2403 bytes
2403 bytes
Please email a cc of any reply to greg.boyko@zephyrtech.com. Quick version of question: Is it possible to call a function that resides in a DLL from inside a global system hook? Expanded description: I have a global windows hook (intalled using SetWindowsHookEx) of type WH_CALLWNDPROC. In the hook I check for the activation of a certain window. When that window is activated, I want to call a function that resides in a DLL. The function that I'm calling is a debugged module written for a previous application, and is known to work well. When I call it from inside the hook, however, the system crashes badly. Right now I'd settle for being able to call something as simple as MessageBox() from inside the hook. I cannot even do that right now. The system crashes. I've tried linking against the DLL's lib file at hook link time as well as loading the DLL and the function dynamically at runtime. When I try to load the DLL at runtime, I crash upon trying to load it. The DLL's entry point does not execute. I would be absolutely delighted if someone could tell me they have successfully called MessageBox() from inside a hook function! There must be some little trick that I'm missing or some pit I don't know to sidestep. My development environment: I'm using Borland C++ Builder 3.0 under windows 98. Sent via Deja.com http://www.deja.com/ Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7qevoo$dvi$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 165f92,8054b72390b5c110,start X-Google-Attributes: gid165f92,public X-Google-Thread: 1105ff,8054b72390b5c110,start X-Google-Attributes: gid1105ff,public X-Google-Thread: 15be46,8054b72390b5c110,start X-Google-Attributes: gid15be46,public X-Google-Thread: 103bde,8054b72390b5c110,start X-Google-Attributes: gid103bde,public From: greg.boyko@zephyrtech.com Subject: calling functions in DLLs from inside a Hook Date: 1999/08/30 Message-ID: <7qevoo$dvi$1@nnrp1.deja.com> X-Deja-AN: 519006994 X-Http-Proxy: 1.0 x28.deja.com:80 (Squid/1.1.22) for client 207.70.253.66 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Mon Aug 30 22:15:03 1999 GMT X-MyDeja-Info: XMYDJUIDboyko Newsgroups: comp.os.ms-windows.programmer,ms.public.win32.programmer,ms.public.win32.programmer.ui,borland.public.cpp.winapi X-Http-User-Agent: Mozilla/4.61 [en] (Win98; I)