翻了下以前的旧帖,http://www.autoitx.com/forum.php ... amp;fromuid=7644923
改了下~$title = 'C:\Program Files\aaa'
_Winkill($title, 'Windows ')
ShellExecute($title)
If $__Exists Then MsgBox(262144 + 64, 'ok文件夹存在', '文件夹存在')
Func _Winkill($title, $text)
Global $__title = $title, $__text = $text, $__Exists = True
Global $__Timer = DllCallbackRegister('_Timer', 'int', 'hwnd;uint;uint;dword')
Global $__TimerDLL = DllCall('user32.dll', 'uint', 'SetTimer', 'hwnd', 0, 'uint', _
0, 'int', 100, 'ptr', DllCallbackGetPtr($__Timer))
EndFunc ;==>_Winkill
Func _Timer($hwnd, $uiMsg, $idEvent, $dwTime)
If $idEvent = $__TimerDLL[0] Then
If WinExists($__title, $__text) Then
DllCallbackFree($__Timer)
$__Exists = False
WinClose($__title, $__text)
MsgBox(262144 + 48, '文件夹不存在', $title & ' 不存在 ')
ElseIf WinExists('ok文件夹存在') Then
DllCallbackFree($__Timer)
EndIf
EndIf
EndFunc ;==>_Timer
|