Solved

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

Posted on 2006-11-29
2
623 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
2 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 500 total points
Comment Utility
>>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
Comment Utility
Thank you Mahesh.

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

Reshma
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
configuration management 2 99
Named range not carried over 10 57
fizzArray2 challenge 1 55
how to split multiple lines delimiter : 8 53
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

772 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

10 Experts available now in Live!

Get 1:1 Help Now