-
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!
-
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.
-
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
-
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.
-
K, so you're basically telling me I can't do this?