Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
run macro in background (activate chrome window on keypress)
#7
Let other macro post a message to this thread. If using message loop like in previous example, other macro must know thread id. Probably easier to use a hidden dialog instead.
Function dialog_register_hotkey_from_other_macro
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

if(!ShowDialog("" &dialog_register_hotkey_from_other_macro 0 0 128)) ret

;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "dialog_register_hotkey_from_other_macro"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2030601 "*" "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,__RegisterHotKey- hk1.Register(hDlg 1 MOD_CONTROL|MOD_SHIFT VK_F5)
,
,case WM_APP+177
,out "unregister/register hotkey here"
,
,case WM_HOTKEY
,sel wParam
,,case 1
,,out "Ctrl+Shift+F5 pressed"
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
Macro Macro2122
Code:
Copy      Help
int w=win("dialog_register_hotkey_from_other_macro" "#32770")
if(!w) ret
SendMessage w WM_APP+177 0 0


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)