?
Solved

Need to obtain 'Print Screen' event before it goes to Visual FoxPro application

Posted on 2006-11-29
2
Medium Priority
?
646 Views
Last Modified: 2013-11-20
Hello All,

All help is appriciated.

Okay. I was not very clear about my problem in the title.
Anyways here is elaborate description.

We have a Visual Foxpro 9.0 Application. Users want Print Screen functionality to work is specific way. Means when they hit Print Screen then whatever is captured on Clipboeard should automatically be (either be displayed in seperate window or ) be printed.

I am not Visual Foxpro Expert. But the one expert in my team says that Visual Foxpro cannot catch 'Print Screen' keyboard event. So this has to be done with MFC, SDK or .net.

So I came in picture cause I have little knowledge about MFC and SDK.

Now I tried this thing using .NET (used Clipboard class and GetData() function.). My application caught 'Prnt Scrn' and printed it to printer. But i have a empty form and I m using it's KeyUP event. This is not right way. Plus when my form is minimized or hidden it does not receive any keyboard input so my code doesnt run.

So I need something that I can install with my VFP application, that will catch keyboard event before they go to VFP application and if it is print screen then process it Or an application that runs in the background and only gets activated when Print screen key is hit.

Can anybody tell me what is the best method to do this?? Do I need to create a window service for this? Or Keyboard Hook? I have never done both of them so please guide me what to do and how to do it.

I thought that second option is more suitable (Hooks).

Please reply
Regards
Resham
0
Comment
Question by:resham
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 2000 total points
ID: 18038553
>>So I need something that I can install with my VFP application, that will catch keyboard event before they go to VFP application

So what you need is called as "Keyboard Hook" with which you can trap keyboard even before your foxpro application receive it. Its like you can trap keys "Globally" independent of process context.

Here is link to article with sample srccode which Capture Screen to Clipboard including dropdown menu..it Hooks keyboard and when user clicks "PrintScreen", application will be notified.

http://www.codeproject.com/clipboard/hscr2clp.asp <=====

Other keyboard hook applications :
http://www.codeproject.com/dll/keyboardhook.asp
http://www.codeproject.com/dll/trackuseridle.asp

So you may install such application with your fox application ( may be windowless or which sits in system tray ) to watch key for Printscreen.

Hope this helps
-MAHESH
0
 

Author Comment

by:resham
ID: 18038944
Thank you Mahesh.

I am looking through it. Looks like this is what I want.
Will let you know.

Reshma
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

719 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