-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommand.ahk
More file actions
32 lines (29 loc) · 964 Bytes
/
Command.ahk
File metadata and controls
32 lines (29 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#SingleInstance,Force
#NoTrayIcon
INIRead,mzhwnd,%A_Temp%\mzc,auto,hwnd,%A_Space%
v := %0%
If RegExMatch(v,"i)\-r")
string := "reload"
If RegExMatch(v,"i)\-c")
string := "conf"
If RegExMatch(v,"i)\-i")
string := "init"
If not v
string := "init"
Send_WM_COPYDATA(string,mzhwnd)
Send_WM_COPYDATA(ByRef StringToSend, hwnd)
{
VarSetCapacity(CopyDataStruct, 3*A_PtrSize, 0)
SizeInBytes := (StrLen(StringToSend) + 1) * (A_IsUnicode ? 2 : 1)
NumPut(SizeInBytes, CopyDataStruct, A_PtrSize)
NumPut(&StringToSend, CopyDataStruct, 2*A_PtrSize)
Prev_DetectHiddenWindows := A_DetectHiddenWindows
Prev_TitleMatchMode := A_TitleMatchMode
DetectHiddenWindows On
SetTitleMatchMode 2
;SendMessage, 0x4a, 0, &CopyDataStruct,, %TargetScriptTitle%
SendMessage, 0x4a, 0, &CopyDataStruct,, ahk_id %hwnd%
DetectHiddenWindows %Prev_DetectHiddenWindows%
SetTitleMatchMode %Prev_TitleMatchMode%
return ErrorLevel
}