WinSetOnTop
设置窗口置顶.
WinSetOnTop ( "title", "text", flag )
参数
title
|
目标窗口标题, 或句柄, 或类名. 参考 Title special definition
|
text
|
目标窗口文本. 参考 Text special definition
|
flag
|
决定目标窗口是否具有"置顶"属性.
0 = 取消窗口置顶
1 = 设置窗口置顶
常量定义在 "AutoItConstants.au3"
|
返回值
成功:
|
返回 1.
|
失败:
|
返回 0, 目标窗口不存在
|
备注
某些第三方程序带有"窗口置顶"的上下文菜单, AutoIt 更改其顶层窗口属性时其菜单项将不被更新.
函数示例
#include <AutoItConstants.au3>
Example()
Func Example()
; Retrieve the handle of the active window.
Local $hWnd = WinGetHandle("[ACTIVE]")
; Set the active window as being ontop using the handle returned by WinGetHandle.
WinSetOnTop($hWnd, "", $WINDOWS_ONTOP)
; Wait for 2 seconds to display the change.
Sleep(2000)
; Remove the "topmost" state from the active window.
WinSetOnTop($hWnd, "", $WINDOWS_NOONTOP)
EndFunc ;==>Example
----------------------------------------
该函数可以通过命令调用 exect
参见:
WinSetState
exect=$var_h=WinGetHandle('[CLASS:TTOTAL_CMD]')||WinSetOnTop(Eval('var_h'),'''',1)||Sleep(3000)||WinSetOnTop(Eval('var_h'),'''',0) ;; 启用3秒窗口状态"置顶"Total Commander
exect=WinSetOnTop('[CLASS:Shell_TrayWnd]','''',1) ;; 设置任务栏的"所有窗口"属性
exect=WinSetOnTop('[CLASS:Shell_TrayWnd]','''',0) ;; 删除属性"顶"到任务栏
© Аверин Андрей для Total Commander Image Averin-And@yandex.ru
|