SendKeys Confusion

J

Jon Berry

I've assigned Alt + F1 as a shortcut key to an application.
This works fine to launch the program from the keyboard.

Now I want to use SendKeys to do the same thing.

So I sent Alt+F1 like so:

SendKeys.SendWait("%{F1}");

This doesn't appear to do anything.

As a test I sent Alt+F4 to close the window like so:

SendKeys.SendWait("%{F4}");

This works to close the Window.

Why doesn't the Alt+F1 work to launch the app with SendKeys?

Thanks.
 
J

Jon Berry

Probably because you haven't activated a window that is responsible for
handling your Alt-F1 shortcut.

Ohh...I just wanted the OS to handle it.
I've just got the desktop open which handles Alt-F1 if I use the keyboard.
You don't say _how_ you've made that shortcut the "launch" command for
your program, but it's possible you've done it in a way that isn't
compatible with SendKeys at all.

I created a shortcut, right click, properties, and edit the "Shortcut key:"
in the Shortcut tab.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top