[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to debug a Hook procedure

Posted on 2002-06-26
4
Medium Priority
?
296 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 80 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 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