Advertisement

What are hooks?

Started by April 30, 2001 02:14 AM
40 comments, last by Merge2 23 years, 9 months ago
well you can use:
send_input
sendmessage(WM_KEYDOWN...)
keybd_event

tough, i''m not sure if these functions will feed DI buffer!

Arkon
[QSoft Systems]
I already tried those, and even tried to call interrupt 16,5 it didn''t work.
I guess some answers can be found here:
http://www.microsoft.com/hwdev/driver/hidnonusb.htm
but it is a hard reading, I like to read source code ; )

Advertisement
ofcourse the interrupt won''t work
the virtual device drivers block it...IIRC

Arkon
[QSoft Systems]
OK, sorry about IRQ''s never even touched DDK before.
How about this (getting a bit farout here, but...): can i create my own dinput.dll, put it in my own directory so it doesn''t owervrite MS dll and calls go through my dll first, I get what I need and send it forth to real stuff? Will program call dll from sys directory first or from it''s home directory?
Regards Sasha

first i have to ask if you know COM, as good as DX was done !

second the OS looks for current dir and then system dir IIRC
but what if the code asks the dinput.dll from registry and then loads it etc?

besides, DINPUT.DLL is a .DLL which was created by COM, so i tell you that when you use DX it gets the .dll''s from the registry....

have you tried my hook under direct input?

Arkon
[QSoft Systems]
Ahhh, hook was the first thing that I tried, it even says in MS doc that it doesn''t work, as DI is not using messages. Here is the definitive answer (I think), but I still doubt that''s the way it is done in a proggy that got me curious in a first place:

http://msdn.microsoft.com/chats/directx/directinput_033100.asp
....
eglad
Q: Is there any way to generate a keystroke from a background application so that all other DirectInput applications could get it?

Shane Evans
A: You would need to write a vxd which pumps keyboard events into the VKD (virtual keyboard device). Works on 9x, not available on 2k.



Advertisement
OK, I got it, go to:
http://www.ddj.com/ftp/1996/1996.03/
and get record.xxx files, there is a VxD that create macros, EXE is in WINDEBUG subdirectory of the zip archive. Run it and create some long macro (it records mouse too). Then run Keyboard.exe from mssdk, Direct Input sample and set options to exclusive, foreground, buffered. Nothing happens when you start macro, but notice this, if you switch focus away from Keyboard.exe and then put it back it DOES work. So I''ve created small app that works under timer and five times a second sets focus away from Foreground window sets focus away, then SendInput F1 key (to start macro), then set focus back to foreground window. Voila: IT WORKS-proof of technology is there.
Regards, Sasha

well, good it works...
now i''m going to try writing a .vxd for kb
wish me good luck!
hey, djurovic, why do you want to do a macro prog for DI?

Arkon
[QSoft Systems]
well, good it works...
now i''m going to try writing a .vxd for kb
wish me good luck!
hey, djurovic, why do you want to do a macro prog for DI?

Arkon
[QSoft Systems]
I stumbled upon program called EQ Macro, read features but couldn''t download it so I was just curious how is it done. There is another feature that I have to figure out: overlays. In order to have dynamic overlays you have to intercept DDS Flip, draw your stuff on top and then flip it.
Think of it as a KVM switch, but without the second computer...
Good luck with your VxD, check out HID mini drivers too, it looks promising.
Regards, Sasha


This topic is closed to new replies.

Advertisement