Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hotkey in exe macro
#1
Is there a way to have the exe macro perform commands when the "End Hotkey"?
An old blog on QM coding and automation.

The Macro Hook
#2
Can be used atend, or destructor, but exe does not know that it ends due to hotkey. Destructor or function registered by atend can run max 100 ms after hotkey is pressed.

You can use alternative hotkey. Start new thread (mac) with hidden dialog and use RegisterHotKey and WM_HOTKEY. Then you'll have full control.
#3
EXAMPLE

Main macro Macro297
Code:
Copy      Help
#if !EXE
atend exe_end_thread_2
;#else it will end automatically
#endif

mac "exe_thread_2"
15

Function exe_thread_2
Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

int h=ShowDialog("" &exe_thread_2 0 0 1)
RegisterHotKey(h 1000 MOD_CONTROL|MOD_SHIFT VK_END)
MessageLoop
UnregisterHotKey(h 1000)

;BEGIN DIALOG
;0 "" 0xC80044 0x100 0 0 129 99 "Thread2Window"
;END DIALOG
;DIALOG EDITOR: "" 0x2010900 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_HOTKEY
,sel wParam
,,case 1000
,,out "hotkey"
,,PostQuitMessage 0
,,shutdown -6 0 "Macro297"
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

Function exe_end_thread_2
Code:
Copy      Help
shutdown -6 0 "exe_thread_2"

You can also use RegisterHotKey to make global hotkeys for other purposes.
#4
whew....i'll have to mull that over a bit...
thanks.
An old blog on QM coding and automation.

The Macro Hook
#5
in my efforts to implement an "atend" process in a macro i have run into a problem.
does exe support "mes" commands? here is the code that im compiling and it's not showing up when i run the exe.

Code:
Copy      Help
mes("It worked")
An old blog on QM coding and automation.

The Macro Hook
#6
nvrmd: i must have botched the make process; it's working just fine.

thanks anyway. :oops:
An old blog on QM coding and automation.

The Macro Hook


Forum Jump:


Users browsing this thread: 1 Guest(s)