Solved

How to debug a Hook procedure

Posted on 2002-06-26
4
262 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 194
ffmpeg - "rtsp://...... Operation not permitted" 4 86
post4 challenge 28 104
abstract class with all non abstract mentods 6 79
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

790 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