"XY_Send script.exe" $r = popupmenu("a|b"); e $r;leads to an hourglass?
That you need to select an entry is normal.
Using
SendMessage() (in my program) is waiting for a return, PostMessage() would have a whole world of other problems "XY_Send script.exe" $r = popupmenu("a|b"); e $r;SendMessage() (in my program) is waiting for a return, PostMessage() would have a whole world of other problems If I run that from internally from "Run script" in XY it works with no hourglass. I can't get it to run from AHK or from the command line. Syntax or quoting issues. I tried putting that one liner script in a script file to run it but had no luck with that either.
Could it not detect an Esc or a click outside or anywhere else but the menu and exit.
MessagetoXYplorer := "::load 'D:\Tools\XYplorer\Scripts\XYmenu_NESTED.xys';" and then sending MessagetoXYplorer := "::perm $rmb=1;"end 1;"D:\Tools\XYplorer\Scripts\XY_Send script.exe" "D:\Tools\XYplorer\Scripts\XYmenu_NESTED.xys" from a command prompt - no hourglass and that worked with my AHK startup file still enabled. I was opening the menu using AHK with a command, ^q:: run "D:\Tools\XYplorer\Scripts\XY_Send script.exe D:\Tools\XYplorer\Scripts\XYmenu_NESTED.xys" I'd like to still use AHK as the starter for the exe though. Would there be an alternate way to start the exe still using AHK via a command or am I tied to using a Windows link?"D:\Tools\XYplorer\Scripts\XY_Send script.exe" "D:\Tools\XYplorer\Scripts\XYmenu_NESTED.xys" It was much slower as well. The command prompt method was immediate.MessagetoXYplorer or sequnce or active window issue. I've extracted the applicable protions from my AHK startup file, but the following does work with AHK version2. Of course you have to change the script refered to.Code: Select all
KeyHistory 0
ListLines false
#SingleInstance force
;SetTitleMatchMode 2
Persistent true
DetectHiddenWindows true
; using AHK only method
#HotIf WinExist("ahk_class ThunderRT6FormDC")
^o::
{
MessagetoXYplorer := "::load 'D:\Tools\XYplorer\Scripts\XYmenu_NESTED.xys';"
SendFunction(MessagetoXYplorer)
return
}
#HotIf
#HotIf WinExist("ahk_class ThunderRT6FormDC") ; using highend's exe
^q::
{
run "D:\Tools\XYplorer\Scripts\XY_Send script.exe D:\Tools\XYplorer\Scripts\XYmenu_NESTED.xys"
return
}
#HotIf
#HotIf ((DetectContextMenu() = 1) && NOT(isMouseOver("ThunderRT6PictureBoxDC", [66,67,72,73])))
RButton::
{
MessagetoXYplorer := "::perm $rmb=1;"
SendFunction(MessagetoXYplorer)
Click
return
}
#HotIf
SendFunction(MessagetoXYplorer) {
hWnd := WinExist("ahk_class ThunderRT6FormDC") ;ORIG and right click works with highend's exe
size := StrLen(MessagetoXYplorer)
if !(StrLen(Chr(0xFFFF))) {
data := Buffer(size * 2, 0)
StrPut(MessagetoXYplorer, &data, size, "UTF-16")
} else {
data := MessagetoXYplorer
}
COPYDATA := Buffer(A_PtrSize * 3) ; Allocate memory
NumPut("Ptr", 4194305, COPYDATA, 0) ; Store msgType in : COPYDATASTRUCT.dwData
NumPut("UInt", size * 2, COPYDATA, A_PtrSize) ; Store size in : COPYDATASTRUCT.cbData
NumPut("Ptr", StrPtr(data), COPYDATA, A_PtrSize * 2) ; Store data (message) in: COPYDATASTRUCT.lpData
return DllCall("User32.dll\SendMessageW", "Ptr", hWnd, "UInt", 74, "Ptr", 0, "Ptr", COPYDATA, "Ptr")
}
DetectContextMenu() { ; Detects context menu, but for use only in XYplorer
If (WinExist("ahk_exe XYplorer.exe") && WinExist("ahk_class #32768")) { ;works with highend's exe and using AHK method
return 1 ; We've found a context menu in XYplorer
} else {
return 0
}
}
isMouseOver(controlName, controlNums) {
MouseGetPos ,,, &controlNameUnderMouse
for each, controlNum in controlNums
{
if (controlNameUnderMouse = controlName . controlNum)
return 1
}
return 0
}