About
Pricing
Community
Teams
Start Free Trial
Log in
Alexandre Fernandes
asked on
10/1/2015
Visual Basic Console Application Keyboard Hook
Hello, I'm looking for an example on how to implement a keyboard hook to capture certain keys in my CONSOLE app, not forms,
For example: F1 to Help or F10 to exit the app from anywhere.
I found C# examples and Form examples. Can anyone help?
Thanks
Alex
Visual Basic.NET
4
1
Last Comment
ste5an
8/22/2022 - Mon
ste5an
10/1/2015
developerFusion - Convert C# to VB.NET
Telerik - Code Converter
PInvoke.net
ASKER CERTIFIED SOLUTION
it_saige
10/1/2015
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Alexandre Fernandes
10/1/2015
ASKER
Excelent! Thanks
ste5an
10/1/2015
Caveat: a console has not necessarily a keyboard associated. Because it has also not always a window associated
See
How To Obtain a Console Window Handle (HWND)
,
GetConsoleWindow function
.
You need to "hook" into stdin instead to be save.
See
Console Handles
.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Telerik - Code Converter
PInvoke.net