Solved

Windows API Hook Notification when Capturing Display

Posted on 2009-05-09
5
488 Views
Last Modified: 2013-12-03
I am writing a program that writes pixels to the main display background on windows. I can write the pixels, but I also need to know when this information is captured. I have a low level keyboard hook that is triggered when the print key is pressed. Is there any api hook or other way to be notified when any program calls CreateDC("DISPLAY", "", "", "") to get the main display window?
0
Comment
Question by:secondeff
  • 3
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 24348274
Take a look at http://www.codeproject.com/KB/system/hooksys.aspx ("API hooking revealed") - this article explains that in detail and comes with full source code.
0
 
LVL 1

Author Comment

by:secondeff
ID: 24378119
Thanks for the very informative article. However, I did not find anything specific about detecting screen capture type events. Like I said, I can only detect the print screen button. Any suggestions?
0
 
LVL 86

Expert Comment

by:jkr
ID: 24378229
Well, you'd have to detect calls that are typical for screen capture, e.g. as you already mentioned 'CreateDC()'. The problem is now is that these might not necessarily mean screen capturing in each case...
0
 
LVL 1

Author Comment

by:secondeff
ID: 24378284
Do you know which hook type I would use to capture a CreateDC() call? I see the issue of seperating them, but it would be a good start.
0
 
LVL 86

Expert Comment

by:jkr
ID: 24378791
Well, as described in the article, an API hook - unfortunately, the kind of hooks set by 'SetWindowsHookEx()' can't do that, that's where API hooking comes into play.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

861 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now