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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keystrokes at start up?

Status
Not open for further replies.

KenWK

Programmer
May 25, 2001
76
US
Hi guys,

I have a VB6 app that will perform different functions based on which keys are pressed when it starts. The only other thread I found is from Feb. '07 in which the user ended up using the GetKeyState API as I am now.

I can trap the Control and Shift keys but I can't see that there is a way to trap the Alt key. I'm using the "VK_" constants as definded in the API viewer that comes with VB 6 but there is no listing for the alt key. I've also searched Visual Studio help file but found only references to Java stuff.

I'm now going to experiment with putting a form on the screen.

Any other ideas?

Thanks,
Ken
 
Why can't you just use the KeyDown or KeyUp events on a form?
 
I checked those just briefly and didn't see a way to make a form work.

I don't acually want the user to have to select anything when they run the app, just have some combination of shift, alt, control (or none) and have the appropriate thing happen.

Playing with the form I didn't find a way to envoke the form key routines without actually hitting keys.
 
VK_MENU = &H12 - either Alt key
VK_LMENU = &HA4 - Left Alt key
VK_RMENU = &HA5 - Right Alt key


 
Y'know, I SAW that "MENU" key but it didn't dawn on me what it was.

Thanks a bunch.
 
<I didn't find a way to envoke the form key routines without actually hitting keys

Oh, I didn't realize that was a requirement. Strongm's is the way to go.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top