Solved

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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