Solved

How to debug a Hook procedure

Posted on 2002-06-26
4
274 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

734 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