Posts: 795
Threads: 136
Joined: Feb 2009
Hi Gintaras, hi all,
I (as far as my tests continue) am likely to clone an old favorite of mine, TapTap (
http://www.donationcoder.com/Software/Mouser/TapTap/).
I use a hook function derivated from Gintaras example (LL keyboard hooks).
Function TapTap contains the hook, SetWindowsHookEx(WH_KEYBOARD_LL &TapTapProc _hinst 0)
TaptapProc handles the keyboard events.
I want the main function which contains the hook to launch and be active for QM life. The message trick
in LL keyboard hooks is obviously not an option there.
I'm stuck there, can you help?
Thanks.
Posts: 12,141
Threads: 143
Joined: Dec 2002
Look in Properties / Triggers / QM.
Posts: 795
Threads: 136
Joined: Feb 2009
Does not work, the function should be monitoring keyboard, you know that better then me,
so I must have it staying loaded in memory, putting it to start with QM just launch it,
and then ends.
I don't want to use a rep function there, and need something as MessageLoop in tray functions....
I did that, not very elegant, i'm sure there is a better way...
SetWindowsHookEx(WH_KEYBOARD_LL &TapTapProc _hinst 0)
str+ Ancienne
int+ TempsAncien
wait 0 WP "QM"
Posts: 12,141
Threads: 143
Joined: Dec 2002
If example was with a message box, look for examples with message loop or wait function.
MessageLoop
or
opt waitmsg 1; wait -1
Posts: 795
Threads: 136
Joined: Feb 2009
Or can I keep my wait function code, what is the most efficient/light in resources,cpu??
edit: (forget that nonsense).....
opt waitmsg 1; wait -1
worked well, thanks
Posts: 12,141
Threads: 143
Joined: Dec 2002
Can use any form of wait function, but if don't need to wait for something, better use MessageLoop or wait -1. With wait need opt waitmsg 1.
Posts: 795
Threads: 136
Joined: Feb 2009
opt waitmsg 1; wait -1 is perfect. Thanks.
Posts: 795
Threads: 136
Joined: Feb 2009
Just a precision:
Indeed, i have a general launch macro at QM startup, and TapTap now.
As I launch several program at QM launch (mostly configuration tweaks or external program
launch), I have an warning message that "a macro use similar trigger".
But launching taptap function from my first QM start trigerred macro does not work, even with
opt waitmsg in it.
Posts: 12,141
Threads: 143
Joined: Dec 2002
Ignore the "similar trigger" message. This trigger can launch many functions and 1 macro.