473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1643
* "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******@hotmail.com> wrote in message
news:f9******************************@news.teranew s.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******@hotmail.com> wrote in message
news:f9******************************@news.terane ws.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******@hotmail.com> wrote in message
news:f9******************************@news.teran ews.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
CMG
Thanx for your reply.

My skills in VB.NET are not so advanced, and i am sad to
say my programming languages are limited (started with
QBASIC, then VB6, VB.NET 2K2 and now 2K3, but i havn't
done that much so far...) so even the WH_KEYBOARD_LL
hooks would prolly be to complicated for me (sad to admit
it). I am currently doing a self study of VB.NET 2K2 with
the MSPRESS book, but i did some stuff on my own for
about 6 months befor that. So i know some shit, most of
which i learned myself thru the study of MSDN (that's a
bitch) and a lot of source code. So far, the things i
have no are for example: a TV Guide (which parses a HTML
file (http://www.tvgids.nl/nustraks.php which took me
quite some time cuz mastering regular expressions when u
know shit about it is pretty hard.), a new installer for
a game that does some basic file functions, check
registry key's, calculate a CRC32 value, and so on, a
Flash player, a torrent downloader, a Kind of LiveUpdate
for my programs, a FTP Client (that i can not get to work
correctly with listing, works half the time, other half
it doesn't). Stuff like that. Fun to make, but not really
advanced. Tried to fuck around with text2speach (wrote a
SFV checker that would talk the results back to me, but
it would lock up, check all the files, and then read the
results, in stead of after each file, that way i
discovered multi-threading :P). That's just some shit i
have done. So as u can see, i am no where near ready to
do hooks. I am just a little dissapointed, there are a
lot of things i want to make, but afterwards, i find out
some things are just not possible for me. And i have a
pretty hard time dealing with that, since i love
programming so much :)
-----Original Message-----
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, thenyour pretty much stuck doing the actuall hook procedure inC/C++/Pascal/PowerBasic/etc that support the creation of standardwindows dlls and then calling your dll via P/Invoke. If it onlyneeds to run on NT based systems (actually NT4 SP3 and up), then youcan do it completely in VB.NET with P/Invoke using the WH_KEYBOARD_LLhook type.

Either way, global hooks are not an easy task.
--
Tom Shelton
MVP [Visual Basic]
.

Nov 20 '05 #11

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

Similar topics

5
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...
1
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...
14
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...
1
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...
5
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...
2
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...
14
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...
3
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.