Solved

Windows API Hook Notification when Capturing Display

Posted on 2009-05-09
5
494 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

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 …
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…

829 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