Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Capture The Print  Event of Word

Posted on 1999-07-29
Medium Priority
Last Modified: 2013-12-03
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.
Question by:chenhuazhen
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
  • 2
  • 2

Accepted Solution

afzalj earned 300 total points
ID: 1404111
Easy, hook window / dialog creation. Use
SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC){hookproc}, NULL, 0) to hook windows where {hookproc} is your hook procedure.

Expert Comment

ID: 1404112
(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.:)

Author Comment

ID: 1404113
Could you E-mail me some source code about how to use SetWindowsHookEx(), I will really be happy. My email address is

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

Anyway, thank you very much!


Author Comment

ID: 1404114
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?

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

721 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