Solved

How to debug a Hook procedure

Posted on 2002-06-26
4
254 Views
Last Modified: 2013-11-20
Hi There,

I am experiencing problem of how to debug a hook procedure using WH_DEBUG message in SetWindowsHookEx API
function.

Sample code is highly expected.

Madhu
0
Comment
Question by:madhusr
4 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 20 total points
ID: 7110677
0
 

Expert Comment

by:spanasik
ID: 7139599
You can use registered messages !
Sample:
I use dll which hooks globally with WH_SHELL hook.
When new window created i'm throw message for my host app.
#define UWM_NEW_WINDOW_MSG _T("UWM_NEW_WINDOW_MSG-44E531B1_14D3_11d5_A025_006067718D04")
UWM_NEW_WINDOW=RegisterWindowMessage(UWM_NEW_WINDOW_MSG);
PostMessage(hWndHost,UWM_NEW_WINDOW,0,0);
You can define messages for all types of hooks. Then just post it to host app and you will know what hook intercepted.If you need a DEBUGHOOKINFO, the best way, i think, is to create shared memory object and pass structure elements or whole structure to your host app, then parse it, and write on disk for example. Because dll never don't need to be complex in this case (hooking).
Best regards
Stas
0
 
LVL 11

Expert Comment

by:griessh
ID: 7378766
Dear madhusr

I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity,  I will suggest to accept

     "SteveGTR"

comment(s) as an answer.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7420199
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 176
Different colored text in ComboBox without Subclassing 8 60
xyBalance chalenge 58 93
countEvens challenge 2 98
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question