Capture The Print Event of Word

I want a program to be a  kind of service. The Program is sitting on the memory, try to capture the Print Dialog Event  when we choose Print from
file menu inside Word2000.
May be we need to some API function call.
chenhuazhenAsked:
Who is Participating?
 
afzaljConnect With a Mentor Commented:
Easy, hook window / dialog creation. Use
SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC){hookproc}, NULL, 0) to hook windows where {hookproc} is your hook procedure.
0
 
afzaljCommented:
(You could scan the window created for it's title name as it will be a specified title like "Print"). I know it's a bit dodgy, but it'll work.:)
0
 
chenhuazhenAuthor Commented:
Could you E-mail me some source code about how to use SetWindowsHookEx(), I will really be happy. My email address is eric.chen@wang.com.

Could I use some API functin derectly to capture if the print object is working and who use that?

Anyway, thank you very much!


0
 
chenhuazhenAuthor Commented:
SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC){hookproc}, NULL, 0)? NULL and 0 can be used at same time.  If the dwThreadId parameter is zero(track all thread), the lpfn parameter must point to a hook procedure in a dynamic-link library (DLL).
I built DLL, but I can't debug. If I run that, program dies. How to debug the global hook functions. Another isue, should I create a thead to deal with it?
0
All Courses

From novice to tech pro — start learning today.