Solved

How to debug a Hook procedure

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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 …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now