你这很可能是没有获取到目标“窗口”坐标,加个判断:Opt("GUICoordMode", 1)
Opt("TrayIconHide", 1)
GUICreate("窗口标题", 300, 19, -1, -1, -1, -1, WinGetHandle(AutoItWinGetTitle()))
WinSetOnTop("窗口标题", "", 1)
Opt("MouseCoordMode", 1)
$sizeopt = WinGetPos("窗口")
If @error <> 1 Then
$xsizeopt = $sizeopt[0] + 137
$ysizeopt = $sizeopt[1] + 100
Else
$xsizeopt = 0
$ysizeopt = 0
EndIf
WinMove("窗口标题", "", $xsizeopt, $ysizeopt)
GUISetState()
$b1 = GUICtrlCreateButton("WAS", 0, 0, 61, 19)
$b2 = GUICtrlCreateButton("SDCF", 61, 0, 61, 19)
$b3 = GUICtrlCreateButton("ERTY", 122, 0, 61, 19)
$b4 = GUICtrlCreateButton("YTU", 183, 0, 61, 19)
$b5 = GUICtrlCreateButton("TYT", 244, 0, 61, 19)
While 1
$msg = GUIGetMsg()
If $msg = $b1 Then
Run(@ProgramFilesDir & "\123\QWE.exe")
EndIf
If $msg = $b2 Then
Run(@ProgramFilesDir & "\123\Exp.EXE")
EndIf
If $msg = $b3 Then
Run(@ProgramFilesDir & "\123\lVoice.exe")
EndIf
If $msg = $b4 Then
Run(@ProgramFilesDir & "\123\Run.exe")
EndIf
If $msg = $b5 Then
$url = "http://hi.baidu.com/"
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -new " & $url)
EndIf
WEnd
|