🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by Zack Wickes Sun, 30 Mar 2003 01:01
Intercepting/Hooking all print messages for the printers
#17223
Author: Zack Wickes
Date: Sun, 30 Mar 2003 01:01
17 lines
1513 bytes
Hi,

I need to have my program hook into Windows such that I know when any print
job (from any and all process spaces) is sent to a printer and how many
pages the job is.

I started down the path of installing a global windows hook using a dll with
SetWindowsHookEx(), but now I am not sure what message to intercept since
WM_PRINT seems to be called whenever a GDI object needs to print itself onto
an HDC.... besides - I dont see any access to a structure that contains the
information I need about the number of pages in the job as a result of the
WM_PRINT message......

All help appreciated.
Builder 6.

Zack.
Re: Intercepting/Hooking all print messages for the printers
#17224
Author: Remy Lebeau (TeamB)
Date: Sun, 30 Mar 2003 01:34
25 lines
1739 bytes
"Zack Wickes" <zwicks@home.com> wrote in message
news:3e863ee4$1@newsgroups.borland.com...

> I need to have my program hook into Windows such that I
> know when any print job (from any and all process spaces)
> is sent to a printer and how many pages the job is.

What you're probably looking for is FindFirstPrinterChangeNotification() and
FindNextPrinterChangeNotification().

> WM_PRINT seems to be called whenever a GDI object needs
> to print itself onto an HDC....

Correct.  WM_PAINT only applies to visual displays, not hardware printers at
all.


Gambit


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.463 / Virus Database: 262 - Release Date: 3/17/03
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads