关于使用了非数组变量的错误
本帖最后由 lvsea2008 于 2009-8-15 17:26 编辑http://i32.tinypic.com/jsn9mq.jpg
有时打开有有时打开没有
而且出现此提示后再执行下就可以运行且也没有提示了! 这个问题很简单,不过没有源码就无从说起了。一般出错在缺少必要的条件语句 这个是源码
Opt("GUICoordMode",1)
Opt("TrayIconHide",1)
GUICreate("窗口标题",300,19,-1,-1,-1,-1,WinGetHandle(AutoItWinGetTitle()))
WinSetOnTop("窗口标题","",1)
Opt("MouseCoordMode", 1)
$sizeopt = WinGetPos("窗口")
$xsizeopt = $sizeopt+137
$ysizeopt = $sizeopt+100
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 你这很可能是没有获取到目标“窗口”坐标,加个判断: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 + 137
$ysizeopt = $sizeopt + 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 谢谢您的帮助
问题已经解决! 呵呵 感谢。我也遇到了同样的问题。
页:
[1]