Solved

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

Posted on 2006-11-29
2
632 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 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to retreive data from .TFS file exported by DVR 8 244
Adapt this command to show who installed 29 112
Folder Comparison 12 55
Path of Workbook 3 86
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…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 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