Solved

Windows API Hook Notification when Capturing Display

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

13 Experts available now in Live!

Get 1:1 Help Now