|
-
Apr 18th, 2000, 06:57 AM
#1
I've been told i can create a sort of 'global keypress interception' program using subclassing and various api calls and things, but most of whats out there is WAY over my head, so if anyone could give me any help on this, it would be MUCH appreciated!
Thanks!
-
Apr 18th, 2000, 07:03 AM
#2
Frenzied Member
You can't do a global one using VB alone, You can do a threadwide one but that will only work for windows in your app, in fact ther'll be some controls you won't catch this way. Doing this sort of thing you do have to do some of the code in VC++ (Anyone wanna throw some code this way, my C++ is limited) You'll probably have to look for another solution.
-
Apr 18th, 2000, 08:03 AM
#3
OK, could you define 'threadwise' please? And do you mean that i can't get computer-wide keypresses, just those in my VB-created form windows?
Thx
-
Apr 18th, 2000, 08:30 AM
#4
Frenzied Member
Oh Christ define threadwide, You know how windows can do loads of things at once (Multi-Tasking) the way it does this is by dividing everything up into threads, Ie your VB App is one thread, Word is a different thread, anything else running is a different thread, some programs use several threads but it's damned hard in VB. When you set a hook you need to give it a procedure to run when the hook is called, (ie the procedure you want to process all the keypresses in) If you want to sed a global hook you have to get a different thread to run your code, but it can't get at the memory because that memory is assigned to a different thread. If you wan't to set a global hook you have to make a standard dll which can be run from all threads, which you can't do in VB because they're seen as a bit old fashioned.
NB I've oversimplified this, there's something called a process which is like a container for threads but in VB you can only really have one thread per process so it doesn't matter.
-
Apr 18th, 2000, 08:41 AM
#5
K, so you're basically telling me I can't do this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|