Solved

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

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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

622 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