WinKill
强制关闭窗口.
WinKill ( "title" [, "text"] )
参数
title
|
目标窗口标题, 或句柄, 或类名. 参考 窗口标题与文本.
|
text
|
[可选] 窗口文本. 默认值为空字符串. 参考 窗口标题与文本.
|
返回值
备注
本函数和 WinClose() 的不同之处在于, WinKill 强制立即终止窗口.
因此, 用户将没有机会对可能会出现的提示保存数据对话框作出反应.
尽管 WinKill 能对最小化或隐藏窗口正常工作, 但某些窗口(特别是资源管理器窗口)只能使用 WinClose() 关闭.
函数示例
Example()
Func Example()
; Run Notepad
Run("notepad.exe")
; Wait 10 seconds for the Notepad window to appear.
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
; Wait for 2 seconds before calling the WinKill function.
Sleep(2000)
; Kill the window using the handle returned by WinWait.
WinKill($hWnd, "")
EndFunc ;==>Example
----------------------------------------
该函数可以通过命令调用 exect
参见:
WinActivate, WinClose, WinSetState, ProcessClose
exect=WinKill('[CLASS:Notepad]') ;; 关闭记事本窗口
© Аверин Андрей для Total Commander Image Averin-And@yandex.ru
|