Now that I have changed AutoGui for Adventure, I'm not able to make this script work:
viewtopic.php?f=90&t=68521
I tried to simplify it, using the menu's position but it's not returning the checked state properly.
Could somebody help me on this?
Thanks.
Code: Select all
WinGet theApp, ProcessName , A
if theApp != Adventure.exe
SoundBeep, return
WinGet windowID, ID, A
mainMenu := DllCall("GetMenu", "Ptr", windowID, "Ptr")
subMenu := DllCall("GetSubMenu", "Ptr", mainMenu, "UInt", 7, "Ptr")
menuState := DllCall("GetMenuState", "Ptr", subMenu, "UInt", 4, "UInt", 0x400) ; By position
isChecked := menuState & 0x8
if (!isChecked) {
WinMenuSelectItem A,, 8&, 5&
}