Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Keyboard triggers in EXE mode
#1
I have 4 macros to be used on online trading terminals. I have made 4 EXE files of them. Now problem with EXE is that they pick only desktop shortcut key triggers. Is there any better way for keyboard triggers in EXE mode as I also tried KT2 triggers of FORUM but that too failed. As an alternative I am using hotkeyp freeware for assigning shortcut keys to my EXE and exceute. Can I make some program in QM which shall load at windows startup and take care for keyboard triggers as I am getting from hotkeyp.
#2
Use RegisterHotKey function. Documented in the MSDN library. You also need a hidden window that will receive WM_HOTKEY messages.
#3
I tried to figure out with Registerkey but was unable to do so. Could you please provide a piece code using Registerkey. It's urgent for me.
#4
This is one of you can find in the forum:
Please "eat" my media keys
#5
The example of Registerkey works fine but a small glitch whenever the dialog box is closed it stops working. I want that once started it should not display any window and it could be stopped only after restart. Also can I share some variable in different macro in EXE mode.
#6
Windowless example.

Macro
Code:
Copy      Help
int hk1=1
RegisterHotKey 0 hk1 MOD_ALT|MOD_CONTROL VK_F2

MSG m
rep
,if(GetMessage(&m 0 0 0)<1) break
,
,sel m.message
,,case WM_HOTKEY
,,if(m.wParam=hk1)
,,,mes "hotkey 1"
,,
,TranslateMessage &m
,DispatchMessage &m

UnregisterHotKey 0 hk1

To share variables between two exe processes can be used registry (rset/rget). It is easiest.
#7
It's working fine, just one query when & how will this macro end.
#8
It does not end itself.


Forum Jump:


Users browsing this thread: 1 Guest(s)