Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

GDI questions...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Hubbard - 06 Jul 2004 09:08 GMT
Can you use VB.Net to set a system-wide hook to intercept all GDI calls from
GDI to the system's hardware?  I want to intercept all GDI instructions sent
to the system's hardware layer.

As I understand it (and I may be missing something) GDI sends instructions
to a DEVICE (which can be a printer or display unit or any device for which
a device context can be obtained) and the device does the drawing.

Also...if anyone can tell me how the dual (actually up to 9) monitor display
thing works - starting with Win98 - that'd be fantastic.  If I knew how that
works, I think it'd help me in my screen captures.
Lloyd Dupont - 07 Jul 2004 01:23 GMT
for screen capture you might do a BitBlt() with the screen (HWND=0)

> Can you use VB.Net to set a system-wide hook to intercept all GDI calls from
> GDI to the system's hardware?  I want to intercept all GDI instructions sent
[quoted text clipped - 7 lines]
> thing works - starting with Win98 - that'd be fantastic.  If I knew how that
> works, I think it'd help me in my screen captures.
Jim Hubbard - 07 Jul 2004 02:15 GMT
Sure....I could.  But, that'd also require multiple BitBlt() calls, then I'd
have to save the images in a compressed format over and over.

As fast as BitBlt is, writing the images to the hdd is not nearly as fast.
Although I could keep the images in an array and only write every so often,
the array would fill up far faster than the ability to compress them and
write them to disk.

By trapping the GDI stream (basically text) I can compress and hold MUCH
more information than with actual images with no loss of color or size in
the images.

Thanks for the post though!

> for screen capture you might do a BitBlt() with the screen (HWND=0)
>
[quoted text clipped - 14 lines]
> that
> > works, I think it'd help me in my screen captures.
Lloyd Dupont - 07 Jul 2004 05:42 GMT
just an idea (not tested, not even sure it would work)
what about an in-memory picture woth CreateCompatibleDC()
the call BeginPaint() with this HDC and a HWND of ((HWND) 0) ?
and then save the picture ?

you don't get all the internal info but it's simple! it might even work ?!

> for screen capture you might do a BitBlt() with the screen (HWND=0)
>
[quoted text clipped - 14 lines]
> that
> > works, I think it'd help me in my screen captures.
Christoph Lindemann - 07 Jul 2004 11:23 GMT
Hi Jim,

I do not think intercepting GDI calls is the right sollution, especially because dll hooking/interception is mainly provided for debugers, and is by some programs considdered hostile.

A better way would be to build a mirror display driver. You can find samples and documentation for this in the Windows DDK:
http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


Also, I do not think VB.NET is the right tool to use, althoug it might be possible, it would require extensive headerfile conversions and nasty hacks.

Best regards,
Christoph Lindemann

> Can you use VB.Net to set a system-wide hook to intercept all GDI calls from
> GDI to the system's hardware?  I want to intercept all GDI instructions sent
[quoted text clipped - 7 lines]
> thing works - starting with Win98 - that'd be fantastic.  If I knew how that
> works, I think it'd help me in my screen captures.
Jim Hubbard - 07 Jul 2004 13:33 GMT
Mirror display drivers are doing exactly that - capturing (or, more
precisely, duplicating) the GDI calls to the main screen.

You are right to point out that VB.Net is not appropriate for the job.  But,
the samples you have pointed to do me no real good - as I am C/C++
illiterate.

I have (for better or worse) dedicated myself to being the best VB/VB.Net
programmer I can be.  At this point, I can say I wish I had spent some time
learning C++.

Acknowledging the fact that it would take me a year or more to gain the
skills and knowledge to write such a mirror device, it is more prudent to
hire someone to write what I need.

Alas, I cannot find anyone with the skills to do this that also has the time
to take on another project.

My search continues for a competent, proven programmer or company with the
skills, time and will to take on this job.

Know anyone?   ( I have tried Guru.com and Rent-A-Coder with no success.)

> Hi Jim,
>
> I do not think intercepting GDI calls is the right sollution, especially because dll hooking/interception is mainly provided for debugers, and is by
some programs considdered hostile.

> A better way would be to build a mirror display driver. You can find samples and documentation for this in the Windows DDK:

http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


> Also, I do not think VB.NET is the right tool to use, althoug it might be possible, it would require extensive headerfile conversions and nasty hacks.
>
[quoted text clipped - 12 lines]
> > thing works - starting with Win98 - that'd be fantastic.  If I knew how that
> > works, I think it'd help me in my screen captures.
Lloyd Dupont - 08 Jul 2004 00:04 GMT
woaw, amazing.

BTW Jim, I didn't see the source yet, but it's a relativaly new article.
I'll bet you will be able to download a compilable sample in a couple of
days.. (weeks ?) or you could contact microsoft about where are the sources
for this article ?
I had found them very responsive !
and then, with the source, the problem would be almost solved, wouldn't it ?

And if you want to learn C/C++, at work, starting by C, it takes no more
than a couple of weeks (2~3), don't be so impress, C is easy! and C++ is not
that much harder than C!

> Mirror display drivers are doing exactly that - capturing (or, more
> precisely, duplicating) the GDI calls to the main screen.
[quoted text clipped - 27 lines]
> > A better way would be to build a mirror display driver. You can find
> samples and documentation for this in the Windows DDK:

http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


> > Also, I do not think VB.NET is the right tool to use, althoug it might be
> possible, it would require extensive headerfile conversions and nasty hacks.
[quoted text clipped - 19 lines]
> that
> > > works, I think it'd help me in my screen captures.
Jim Hubbard - 08 Jul 2004 02:20 GMT
I will look into studying C/C++....especially if I can grasp it in only a
month.

If you'd like this source code, I can email it to you - send your request to
jFiEm__hEuGbJbBaYrLdE@hotmail.com (ignore all UPPERCASE letters in the email
address and that's 2 underscores between jim and hubbard.)

Thanks for your post.

And props to Christoph for the link!  I have the 2003 SDK, but hadn't seen
this link before.

The one thing that concerns me is that the article says "Note  In Windows
2000 and later, the mirror driver's clip region must include the primary
display device."  I take this to mean that the clip region for 2000 and up
must include the whole desktop.

I think that this means that I would not be able to limit the mirroring to
just one window, unless that window covered the whole screen.
Disappointing.

I'll go get a couple of books today, and let you know how I make out in
about a month.

Thanks again!

> woaw, amazing.
>
[quoted text clipped - 44 lines]
> > > A better way would be to build a mirror display driver. You can find
> > samples and documentation for this in the Windows DDK:

http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


> > > Also, I do not think VB.NET is the right tool to use, althoug it might
> be
[quoted text clipped - 24 lines]
> > that
> > > > works, I think it'd help me in my screen captures.
Lloyd Dupont - 08 Jul 2004 04:37 GMT
no thanks, I'm not much into driver developement myself :)
I just found this interesting, as a... demo.
but good luck!

> I will look into studying C/C++....especially if I can grasp it in only a
> month.
[quoted text clipped - 78 lines]
> > > > A better way would be to build a mirror display driver. You can find
> > > samples and documentation for this in the Windows DDK:

http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


> > > > Also, I do not think VB.NET is the right tool to use, althoug it might
> > be
[quoted text clipped - 25 lines]
> > > that
> > > > > works, I think it'd help me in my screen captures.
Christoph Lindemann - 08 Jul 2004 16:12 GMT
Hi Jim,

I know that some of the VNC flavors include such a mirror driver. You could
possibly get one of the developers to do one for you.

http://ultravnc.sourceforge.net/website/

/christoph

> Mirror display drivers are doing exactly that - capturing (or, more
> precisely, duplicating) the GDI calls to the main screen.
[quoted text clipped - 27 lines]
> > A better way would be to build a mirror display driver. You can find
> samples and documentation for this in the Windows DDK:

http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


> > Also, I do not think VB.NET is the right tool to use, althoug it might be
> possible, it would require extensive headerfile conversions and nasty hacks.
[quoted text clipped - 19 lines]
> that
> > > works, I think it'd help me in my screen captures.
Jim Hubbard - 08 Jul 2004 20:55 GMT
TightVNC has a driver that was donated to be used with TightVNC from
DemoForge.  The TightVNC developers are working on an open source version of
their own, but also need some help.

I'm not a real big believer in Open Source.  And, I'd want my components to
be proprietary - not possible if the TightVNC guys do it as it would come
under the GPL.

DemoForge has given me permission to use their drivers in a new open source
project.  I'll post something here as soon as it is ready.

Thanks for the post.

> Hi Jim,
>
[quoted text clipped - 40 lines]
> > > A better way would be to build a mirror display driver. You can find
> > samples and documentation for this in the Windows DDK:

http://msdn.microsoft.com/library/en-us/graphics/hh/graphics/dpyddi_b57d0d90-5da
e-447d-825f-7d4a05e1e6d0.xml.asp


> > > Also, I do not think VB.NET is the right tool to use, althoug it might
> be
[quoted text clipped - 24 lines]
> > that
> > > > works, I think it'd help me in my screen captures.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.