GDI hook driver

  • Follow


Hello everyone,

I've been looking around for some printer/display driver which can hook a 
GDI function. I would like to understand how you can 'catch' a function like 
'CDC.LineTo(...)' in an application and do something else like saving these 
instructions to perhaps a textfile.

In the DDK I've found some samples like MSPlot (Printer), Mirror (Video). 
But they're so different from eachother, except from their initialization 
proces.

Now I've read about the Source file, Makefile and the operation when 
createDC(...) is called. 

So the basic idea:

In the application
some_event()
{
  CDC dc = createDC(...);
 dc.LineTo(...);
}

I would like to catch this dc.LineTo() and do something else with it, 
instead of letting it draw on screen.

Does anyone know where I can find easy understandable information? Or where 
the hooking process is broken down in pieces?
0
Reply Utf 3/2/2010 9:54:01 AM

One of the best books on the topic is still
(10+ years after its publication, and despite being out-of-print)
Windows Graphics Programming: Win32 GDI and DirectDraw
Hewlett-Packard Professional Books
Feng Yuan

That will take you in the details of why a driver for a printer and
a display driver are the same (in a given context), and, you'll understand 
why
what you are trying to do can be accomplished with a mirror driver.
-- 

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Metroickha" <Metroickha@discussions.microsoft.com> wrote in message 
news:5FC8E95B-9122-47D8-BBB5-F511FC888F40@microsoft.com...
> Hello everyone,
>
> I've been looking around for some printer/display driver which can hook a
> GDI function. I would like to understand how you can 'catch' a function 
> like
> 'CDC.LineTo(...)' in an application and do something else like saving 
> these
> instructions to perhaps a textfile.
>
> In the DDK I've found some samples like MSPlot (Printer), Mirror (Video).
> But they're so different from eachother, except from their initialization
> proces.
>
> Now I've read about the Source file, Makefile and the operation when
> createDC(...) is called.
>
> So the basic idea:
>
> In the application
> some_event()
> {
>  CDC dc = createDC(...);
> dc.LineTo(...);
> }
>
> I would like to catch this dc.LineTo() and do something else with it,
> instead of letting it draw on screen.
>
> Does anyone know where I can find easy understandable information? Or 
> where
> the hooking process is broken down in pieces? 

0
Reply Ivan 3/2/2010 11:05:03 AM


Thanks, but this books seems out-of-print. And not available here in the 
Netherlands. :( Any other options?

"Ivan Brugiolo [MSFT]" wrote:

> One of the best books on the topic is still
> (10+ years after its publication, and despite being out-of-print)
> Windows Graphics Programming: Win32 GDI and DirectDraw
> Hewlett-Packard Professional Books
> Feng Yuan
> 
> That will take you in the details of why a driver for a printer and
> a display driver are the same (in a given context), and, you'll understand 
> why
> what you are trying to do can be accomplished with a mirror driver.
> -- 
> 
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> 
> 
> "Metroickha" <Metroickha@discussions.microsoft.com> wrote in message 
> news:5FC8E95B-9122-47D8-BBB5-F511FC888F40@microsoft.com...
> > Hello everyone,
> >
> > I've been looking around for some printer/display driver which can hook a
> > GDI function. I would like to understand how you can 'catch' a function 
> > like
> > 'CDC.LineTo(...)' in an application and do something else like saving 
> > these
> > instructions to perhaps a textfile.
> >
> > In the DDK I've found some samples like MSPlot (Printer), Mirror (Video).
> > But they're so different from eachother, except from their initialization
> > proces.
> >
> > Now I've read about the Source file, Makefile and the operation when
> > createDC(...) is called.
> >
> > So the basic idea:
> >
> > In the application
> > some_event()
> > {
> >  CDC dc = createDC(...);
> > dc.LineTo(...);
> > }
> >
> > I would like to catch this dc.LineTo() and do something else with it,
> > instead of letting it draw on screen.
> >
> > Does anyone know where I can find easy understandable information? Or 
> > where
> > the hooking process is broken down in pieces? 
> 
> .
> 
0
Reply Utf 3/4/2010 11:28:01 AM

You can try to find the book as used in the Amazon Marketplace,
or equivalent services.

That said, the landscape for mirror drivers is, more or less, the following:
There are about 70+ commercial solutions that I know of
built on the WDK 'mirror' example.
(Anything from screen reader, screen magnifier, accessibility application,
network projector, wannabe TS replacement, remote-access solutions).
All of them seems to suffer from common classes of problems
(device bitmap support, alphablend/transparentblt support) but,
they get the job done.
You can start from there, and, forget about intercepting NtGdi
at a higher level in the stack.

-- 

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"Metroickha" <Metroickha@discussions.microsoft.com> wrote in message 
news:9270E9BF-8E8C-43BF-84A7-B21A38FAA254@microsoft.com...
> Thanks, but this books seems out-of-print. And not available here in the
> Netherlands. :( Any other options?
>
> "Ivan Brugiolo [MSFT]" wrote:
>
>> One of the best books on the topic is still
>> (10+ years after its publication, and despite being out-of-print)
>> Windows Graphics Programming: Win32 GDI and DirectDraw
>> Hewlett-Packard Professional Books
>> Feng Yuan
>>
>> That will take you in the details of why a driver for a printer and
>> a display driver are the same (in a given context), and, you'll 
>> understand
>> why
>> what you are trying to do can be accomplished with a mirror driver.
>> -- 
>>
>> --
>> This posting is provided "AS IS" with no warranties, and confers no 
>> rights.
>> Use of any included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>>
>>
>> "Metroickha" <Metroickha@discussions.microsoft.com> wrote in message
>> news:5FC8E95B-9122-47D8-BBB5-F511FC888F40@microsoft.com...
>> > Hello everyone,
>> >
>> > I've been looking around for some printer/display driver which can hook 
>> > a
>> > GDI function. I would like to understand how you can 'catch' a function
>> > like
>> > 'CDC.LineTo(...)' in an application and do something else like saving
>> > these
>> > instructions to perhaps a textfile.
>> >
>> > In the DDK I've found some samples like MSPlot (Printer), Mirror 
>> > (Video).
>> > But they're so different from eachother, except from their 
>> > initialization
>> > proces.
>> >
>> > Now I've read about the Source file, Makefile and the operation when
>> > createDC(...) is called.
>> >
>> > So the basic idea:
>> >
>> > In the application
>> > some_event()
>> > {
>> >  CDC dc = createDC(...);
>> > dc.LineTo(...);
>> > }
>> >
>> > I would like to catch this dc.LineTo() and do something else with it,
>> > instead of letting it draw on screen.
>> >
>> > Does anyone know where I can find easy understandable information? Or
>> > where
>> > the hooking process is broken down in pieces?
>>
>> .
>> 
0
Reply Ivan 3/5/2010 6:51:44 PM

can you explain a bit more the "common classes of problems"...I didn't get 
that part?


"Ivan Brugiolo [MSFT]" wrote:

> You can try to find the book as used in the Amazon Marketplace,
> or equivalent services.
> 
> That said, the landscape for mirror drivers is, more or less, the following:
> There are about 70+ commercial solutions that I know of
> built on the WDK 'mirror' example.
> (Anything from screen reader, screen magnifier, accessibility application,
> network projector, wannabe TS replacement, remote-access solutions).
> All of them seems to suffer from common classes of problems
> (device bitmap support, alphablend/transparentblt support) but,
> they get the job done.
> You can start from there, and, forget about intercepting NtGdi
> at a higher level in the stack.
> 
> -- 
> 
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> 
> 
> "Metroickha" <Metroickha@discussions.microsoft.com> wrote in message 
> news:9270E9BF-8E8C-43BF-84A7-B21A38FAA254@microsoft.com...
> > Thanks, but this books seems out-of-print. And not available here in the
> > Netherlands. :( Any other options?
> >
> > "Ivan Brugiolo [MSFT]" wrote:
> >
> >> One of the best books on the topic is still
> >> (10+ years after its publication, and despite being out-of-print)
> >> Windows Graphics Programming: Win32 GDI and DirectDraw
> >> Hewlett-Packard Professional Books
> >> Feng Yuan
> >>
> >> That will take you in the details of why a driver for a printer and
> >> a display driver are the same (in a given context), and, you'll 
> >> understand
> >> why
> >> what you are trying to do can be accomplished with a mirror driver.
> >> -- 
> >>
> >> --
> >> This posting is provided "AS IS" with no warranties, and confers no 
> >> rights.
> >> Use of any included script samples are subject to the terms specified at
> >> http://www.microsoft.com/info/cpyright.htm
> >>
> >>
> >> "Metroickha" <Metroickha@discussions.microsoft.com> wrote in message
> >> news:5FC8E95B-9122-47D8-BBB5-F511FC888F40@microsoft.com...
> >> > Hello everyone,
> >> >
> >> > I've been looking around for some printer/display driver which can hook 
> >> > a
> >> > GDI function. I would like to understand how you can 'catch' a function
> >> > like
> >> > 'CDC.LineTo(...)' in an application and do something else like saving
> >> > these
> >> > instructions to perhaps a textfile.
> >> >
> >> > In the DDK I've found some samples like MSPlot (Printer), Mirror 
> >> > (Video).
> >> > But they're so different from eachother, except from their 
> >> > initialization
> >> > proces.
> >> >
> >> > Now I've read about the Source file, Makefile and the operation when
> >> > createDC(...) is called.
> >> >
> >> > So the basic idea:
> >> >
> >> > In the application
> >> > some_event()
> >> > {
> >> >  CDC dc = createDC(...);
> >> > dc.LineTo(...);
> >> > }
> >> >
> >> > I would like to catch this dc.LineTo() and do something else with it,
> >> > instead of letting it draw on screen.
> >> >
> >> > Does anyone know where I can find easy understandable information? Or
> >> > where
> >> > the hooking process is broken down in pieces?
> >>
> >> .
> >> 
> .
> 
0
Reply Utf 3/23/2010 7:01:01 AM

4 Replies
609 Views

(page loaded in 0.677 seconds)

10/21/2014 8:43:42 AM


Reply: