DetectHiddenWindows,on
SetTitleMatchMode, Fast

;主程序
IfWinExist,ahk_class #32770 ahk_exe xiadan.exe
	ToolTip,找到下单窗口
else{
	open_xiadan()
	loop{
			Sleep,1000
			if A_index>20
			{
				MsgBox 下单窗口呼叫失败
				break
			}
		}Until WinExist(ahk_class #32770 ahk_exe xiadan.exe)
	}


return

;辅助函数
open_xiadan()
{
	;~ ths:="同花顺(v8.60.13) - 首页"
	ths:="ahk_exe hexin.exe"
	WinActivate, %ths%, 
	WinWaitActive, %ths%, 
	Sleep, 100
	Send, {F12}
	return
}