473,624 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing KeyStrokes Not Relative To The .NET Application.

CMG
There is a program called ShortKey, the basic function of
this program is the following:
Say you define a shortkey called "MSDN". The program will
then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?
Thanx in advance.
Nov 20 '05 #1
10 1667
* "CMG" <vb****@divx-warez.nl> scripsit:
There is a program called ShortKey, the basic function of
this program is the following:
Say you define a shortkey called "MSDN". The program will
then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?


No.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
that's actually a fairly complex finite state machine to start with... can
be very time consumeing to program an execute...

it is possible with VB.NET to do this, but you will need to read all the
keyboard messages sent to the system.. which can get very low level in
windows to do...
"CMG" <vb****@divx-warez.nl> wrote in message
news:02******** *************** *****@phx.gbl.. .
There is a program called ShortKey, the basic function of
this program is the following:
Say you define a shortkey called "MSDN". The program will
then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?
Thanx in advance.

Nov 20 '05 #3
CMG
YEah, i know, that was what i was afraid of... :( in that
case, i am not planning of doing that anny time soon :)

Thanx for your help,

CMG
-----Original Message-----
that's actually a fairly complex finite state machine to start with... canbe very time consumeing to program an execute...

it is possible with VB.NET to do this, but you will need to read all thekeyboard messages sent to the system.. which can get very low level inwindows to do...
"CMG" <vb****@divx-warez.nl> wrote in message
news:02******* *************** ******@phx.gbl. ..
There is a program called ShortKey, the basic function of this program is the following:
Say you define a shortkey called "MSDN". The program will then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?

Thanx in advance.

.

Nov 20 '05 #4
I saw some VB6 code that would raise an event in you application whenever
someone pressed eg. f2 in windows, from whatever location (I'm looking for
VB.Net Code for this).
http://abstractvb.com/code.asp?A=849

If you added a shortcut-key to be pressed first; for pressing example
Ctrl+F12, you application might not need to be impossible.
After that key-combination has been pressed, then the program could start
registering whatever typed, for example: "MSDN". Whenever it recognised a
shortcut, it replaced the text.

How to replace the text is another problem, that i can't see a solution to
since there place the text has been written could be anything, a CMD-window,
a Textbox, Listbox, Notepad-window and so on (if someone got some VB.Net
code for this, i'd be interested too :) .

Maybe pasting the text "http://www.msdn.com" into the clipboard and then let
the user replace the MSDN manually would be easier?
"CMG" <vb****@divx-warez.nl> wrote in message
news:07******** *************** *****@phx.gbl.. .
YEah, i know, that was what i was afraid of... :( in that
case, i am not planning of doing that anny time soon :)

Thanx for your help,

CMG
-----Original Message-----
that's actually a fairly complex finite state machine to

start with... can
be very time consumeing to program an execute...

it is possible with VB.NET to do this, but you will need

to read all the
keyboard messages sent to the system.. which can get

very low level in
windows to do...
"CMG" <vb****@divx-warez.nl> wrote in message
news:02******* *************** ******@phx.gbl. ..
There is a program called ShortKey, the basic function of this program is the following:
Say you define a shortkey called "MSDN". The program will then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?

Thanx in advance.

.

Nov 20 '05 #5
I saw some VB6 code that would raise an event in you application whenever
someone pressed eg. f2 in windows, from whatever location (I'm looking for
VB.Net Code for this). http://abstractvb.com/code.asp?A=849

If you added a shortcut-key to be pressed first; for pressing example
Ctrl+F12, you application might not need to be impossible. After that
key-combination has been pressed, then the program could start registering
whatever typed, for example: "MSDN". Whenever it recognised a shortcut, it
replaced the text.

How to replace the text is another problem, that i can't see a solution to
since there place the text has been written could be anything, a CMD-window,
a Textbox, Listbox, Notepad-window and so on (if someone got some VB.Net
code for this, i'd be interested too :) .

Maybe pasting the text "http://www.msdn.com" into the clipboard and then let
the user replace the MSDN manually would be easier?
"CMG" <vb****@divx-warez.nl> wrote in message
news:07******** *************** *****@phx.gbl.. .
YEah, i know, that was what i was afraid of... :( in that
case, i am not planning of doing that anny time soon :)

Thanx for your help,

CMG
-----Original Message-----
that's actually a fairly complex finite state machine to

start with... can
be very time consumeing to program an execute...

it is possible with VB.NET to do this, but you will need

to read all the
keyboard messages sent to the system.. which can get

very low level in
windows to do...
"CMG" <vb****@divx-warez.nl> wrote in message
news:02******* *************** ******@phx.gbl. ..
There is a program called ShortKey, the basic function of this program is the following:
Say you define a shortkey called "MSDN". The program will then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?

Thanx in advance.

.



Nov 20 '05 #6
I found a control and complete source code to making a global hotkey
http://www.merrioncomputing.com/Down...LHotkeyNet.htm

"Jarod_24" <ja******@hotma il.com> wrote in message
news:f9******** *************** *******@news.te ranews.com...
I saw some VB6 code that would raise an event in you application whenever
someone pressed eg. f2 in windows, from whatever location (I'm looking for
VB.Net Code for this). http://abstractvb.com/code.asp?A=849

If you added a shortcut-key to be pressed first; for pressing example
Ctrl+F12, you application might not need to be impossible. After that
key-combination has been pressed, then the program could start registering
whatever typed, for example: "MSDN". Whenever it recognised a shortcut, it
replaced the text.

How to replace the text is another problem, that i can't see a solution to
since there place the text has been written could be anything, a CMD-window, a Textbox, Listbox, Notepad-window and so on (if someone got some VB.Net
code for this, i'd be interested too :) .

Maybe pasting the text "http://www.msdn.com" into the clipboard and then let the user replace the MSDN manually would be easier?
"CMG" <vb****@divx-warez.nl> wrote in message
news:07******** *************** *****@phx.gbl.. .
YEah, i know, that was what i was afraid of... :( in that
case, i am not planning of doing that anny time soon :)

Thanx for your help,

CMG
-----Original Message-----
that's actually a fairly complex finite state machine to

start with... can
be very time consumeing to program an execute...

it is possible with VB.NET to do this, but you will need

to read all the
keyboard messages sent to the system.. which can get

very low level in
windows to do...
"CMG" <vb****@divx-warez.nl> wrote in message
news:02******* *************** ******@phx.gbl. ..
> There is a program called ShortKey, the basic function

of
> this program is the following:
> Say you define a shortkey called "MSDN". The program

will
> then, everytime you type MSDN replace MSDN with
> http://msdn.micosoft.com/. I thought this should not be
> so hard to make, i was wrong (or at least, i think).
>
> My question is, is there a way to make this in Visual
> Basic.NET without having to use low level keyboard

hooks?
>
>
> Thanx in advance.
.


Nov 20 '05 #7
CMG
Mega Nice Dude! Owe you one! Going to check it out now,
hope it's what i am looking for...
-----Original Message-----
I found a control and complete source code to making a global hotkeyhttp://www.merrioncomputing.com/Down...LHotkeyNet.htm

"Jarod_24" <ja******@hotma il.com> wrote in message
news:f9******* *************** ********@news.t eranews.com.. ..
I saw some VB6 code that would raise an event in you application whenever someone pressed eg. f2 in windows, from whatever location (I'm looking for VB.Net Code for this). http://abstractvb.com/code.asp? A=849
If you added a shortcut-key to be pressed first; for pressing example Ctrl+F12, you application might not need to be impossible. After that key-combination has been pressed, then the program could start registering whatever typed, for example: "MSDN". Whenever it recognised a shortcut, it replaced the text.

How to replace the text is another problem, that i can't see a solution to since there place the text has been written could be anything, aCMD-window,
a Textbox, Listbox, Notepad-window and so on (if
someone got some VB.Net code for this, i'd be interested too :) .

Maybe pasting the text "http://www.msdn.com" into the

clipboard and thenlet
the user replace the MSDN manually would be easier?
"CMG" <vb****@divx-warez.nl> wrote in message
news:07******** *************** *****@phx.gbl.. .
> YEah, i know, that was what i was afraid of... :( in that > case, i am not planning of doing that anny time soon :) >
> Thanx for your help,
>
> CMG
> >-----Original Message-----
> >that's actually a fairly complex finite state machine to > start with... can
> >be very time consumeing to program an execute...
> >
> >it is possible with VB.NET to do this, but you will need > to read all the
> >keyboard messages sent to the system.. which can get
> very low level in
> >windows to do...
> >
> >
> >"CMG" <vb****@divx-warez.nl> wrote in message
> >news:02******* *************** ******@phx.gbl. ..
> >> There is a program called ShortKey, the basic function > of
> >> this program is the following:
> >> Say you define a shortkey called "MSDN". The program > will
> >> then, everytime you type MSDN replace MSDN with
> >> http://msdn.micosoft.com/. I thought this should not be > >> so hard to make, i was wrong (or at least, i think). > >>
> >> My question is, is there a way to make this in Visual > >> Basic.NET without having to use low level keyboard
> hooks?
> >>
> >>
> >> Thanx in advance.
> >
> >
> >.
> >


.

Nov 20 '05 #8
CMG
Just Checked it out. Prolly is of use to me in some
applications, so thank you for that. I also see that it
is made in C++ (Why do i get the feeling only good things
are written in C++?, is it just that C++ is more commenly
accepted, is it more powerfull or what? As far as i can
tell, VB and C++ in .NET are verry much alike, and the
code is just different syntax mostly... and on top of
that, if you tell ppl you program Visual Basic, the
usually just start laughing like you are some lamer... Oh
well, just gotta live with it i think :-/). So, to sum it
all up:

Thanx everyone, i had given up hope on this subject, but
there maybe light at the end of the tunnel ;)
-----Original Message-----
Mega Nice Dude! Owe you one! Going to check it out now,
hope it's what i am looking for...
-----Original Message-----
I found a control and complete source code to making aglobal hotkey
http://www.merrioncomputing.com/Down...CLHotkeyNet.ht m

"Jarod_24" <ja******@hotma il.com> wrote in message
news:f9****** *************** *********@news. teranews.com.

.... I saw some VB6 code that would raise an event in youapplication whenever someone pressed eg. f2 in windows, from whateverlocation (I'm looking for VB.Net Code for this). http://abstractvb.com/code.asp?A=849
If you added a shortcut-key to be pressed first; forpressing example Ctrl+F12, you application might not need to beimpossible. After that key-combination has been pressed, then the programcould start registering whatever typed, for example: "MSDN". Whenever itrecognised a shortcut, it replaced the text.

How to replace the text is another problem, that ican't see a solution to since there place the text has been written could beanything, a
CMD-window,
a Textbox, Listbox, Notepad-window and so on (if
someone got some VB.Net code for this, i'd be interested too :) .

Maybe pasting the text "http://www.msdn.com" into theclipboard and then
let
the user replace the MSDN manually would be easier?
"CMG" <vb****@divx-warez.nl> wrote in message
news:07******** *************** *****@phx.gbl.. .
> YEah, i know, that was what i was afraid of... :( inthat > case, i am not planning of doing that anny timesoon :) >
> Thanx for your help,
>
> CMG
> >-----Original Message-----
> >that's actually a fairly complex finite statemachine to > start with... can
> >be very time consumeing to program an execute...
> >
> >it is possible with VB.NET to do this, but you
will
need > to read all the
> >keyboard messages sent to the system.. which can
get > very low level in
> >windows to do...
> >
> >
> >"CMG" <vb****@divx-warez.nl> wrote in message
> >news:02******* *************** ******@phx.gbl. ..
> >> There is a program called ShortKey, the basic

function > of
> >> this program is the following:
> >> Say you define a shortkey called "MSDN". Theprogram > will
> >> then, everytime you type MSDN replace MSDN with
> >> http://msdn.micosoft.com/. I thought this shouldnot be > >> so hard to make, i was wrong (or at least, ithink). > >>
> >> My question is, is there a way to make this inVisual > >> Basic.NET without having to use low level keyboard > hooks?
> >>
> >>
> >> Thanx in advance.
> >
> >
> >.
> >

.

.

Nov 20 '05 #9
In article <02************ *************** *@phx.gbl>, CMG wrote:
There is a program called ShortKey, the basic function of
this program is the following:
Say you define a shortkey called "MSDN". The program will
then, everytime you type MSDN replace MSDN with
http://msdn.micosoft.com/. I thought this should not be
so hard to make, i was wrong (or at least, i think).

My question is, is there a way to make this in Visual
Basic.NET without having to use low level keyboard hooks?
Thanx in advance.

Does this application have to run on 9x (98 and ME)? If it does, then
your pretty much stuck doing the actuall hook procedure in
C/C++/Pascal/PowerBasic/etc that support the creation of standard
windows dlls and then calling your dll via P/Invoke. If it only
needs to run on NT based systems (actually NT4 SP3 and up), then you
can do it completely in VB.NET with P/Invoke using the WH_KEYBOARD_LL
hook type.

Either way, global hooks are not an easy task.
--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2455
by: Bilal | last post by:
Hi, Is there any way to capture the action Ctrl+N (whether it in a hidden button or keyword - doesn't matter) in html, javascript or php? I appreciate any suggestions. Thank you and kind regards Bils
1
2578
by: Pjotr Wedersteers | last post by:
Hi I want to write a small prog/applet that does nothing but the following: Display icons representing the keys pressed on the keyboard in a small "always on top" but transparent window. The keys must always be read - even when the proggy has no focus- but not erased from the keyboard buffer so the active app still catches them. I don't want you to do the work for me, but some good pointers or tips would be very nice! I am a novice+...
14
2532
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the internet, they have to login. I want to be able to capture that login versus their Windows login because I need to know who they are from any computer rather than only their computer. Any ideas? Thanks
1
1505
by: Rob T | last post by:
In the past, I've made several poor attempts at capturing keyboard strokes with JS. Mostly, I would want to hit something like ALT-H or F1 for a help screen.... Hitting the Alt key usually kicks you into the IE menu and doesn't really allow me to trap the keystrokes. So....on our new Exchange 2003 web interface, MS has a great interface with it. It allows you to hit ALT-S for send, F7 for spell check, and other strokes that a...
5
2723
by: Lucas Tam | last post by:
Hi all, Has anyone done this before? Send client side keystrokes to an application from a webpapge? This maybe more of a Javascript question. In short, I have an application on the client's desktop that needs to communicate with an ASP.NET application. The only interface into the application are keystrokes and DDE.
2
10175
by: Tim Diggle | last post by:
I'm trying to enter data into a database application running under Citrix ICA Client. I'm doing it from a VBA macro running under Microsoft Excel 2000 (although it may need to be backwardly compatible with '97). I'm doing this by using appactivate to activate the database application, then sendkeys to send strings of data and tab characters to fill up a series of data fields. Now, this works if Excel is running under Citrix, but if...
14
1749
by: @sh | last post by:
Has anyone a function handy that I can apply to various textboxes within a form, each textbox will permit most characters but I want to ban certain characters from each textbox. Therefore I need a function that I can put into the <text area> tag of each box, something like... <text area onKeyPress="BanCharacters('a','<','>','b','u','i');"> Is this possible easily?
3
5037
by: Gunnar Syren | last post by:
I'm trying to implement a macro feature in my application by recording and playing back keystrokes. At first I thought it would be enough to catch KeyDown in my main form, but I soon realized that I needed to catch keystrokes in menues and other forms in my app as well. I realize I can implement a keyboard hook that catches keystrokes globally, but I only want the keystrokes that are sent to my application. Any suggestions on how to...
1
3736
by: zanthor | last post by:
Ok... so call me crazy, but I have an idea and I'm looking for where to start... I want to write an application that catches keystrokes and then either redirects them to the in focus window or another window based on some simple rules... in some cases the keystrokes would need to be sent out to multiple windows. I've done part of this in the past using a C++ application to hook the Win32 keyboard API and dispose of unwanted keystrokes...
0
8242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8177
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8681
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8629
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6112
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.