Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make F10 start myprog.exe?

Status
Not open for further replies.

Gerrit Broekhuis

Programmer
Aug 16, 2004
316
NL
I want to use F10 to start a certain program. I tried with the KeyPress event:

LPARAMETERS nKeyCode, nShiftAltCtrl

IF nKeyCode == -9 && F10
thisform.command.click()
ENDIF

What happens is that F10 displays my menu. For all other function keys the KeyPress code works find. What should I change for F10 in order to make it start the right program?

Regards,

Gerrit
 
Gerrit,

Create a desktop shortcut to your exe, right click to the shortcut properties and place your mouse cursot in the 'shortcut key' on the shortcut tab and press F10. Click apply and it should be set.

Ralph
 
Ralph,

This would only be a solution for a particular desktop. Since this is a network application this is not an option. I have to find a way within my app to make this work.

Regards,

Gerrit
 
Craig,

I already thougt so, but I was wondering if a workaround would be possible.

Microsoft is already dictating enough on my desktop....

Regards,

Gerrit
 
Gerrit,
Unfortunately Windows doesn't pass that keystroke into VFP, so you can't override the "Select Menu" action. If you wrote some API based code that accessed the main Windows Event handler (NOT in VFP), then you could do what you wanted to do with any and all keystrokes. Unfortunately then this would apply to the whole OS environment - not just your program!

Rick
 
Gerrit,

Seems to me the obvious solution would be to use a different function key. As well as being easier to program, it will make your program better behaved, since F10 is reservered by Windows.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Try the following in VFP command window and then press F10...

ON KEY LABEL F10 MESSAGEBOX("Hello World")


boyd.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top