WinSetTrans
设置窗口的透明度.
WinSetTrans ( "title", "text", transparency )
参数
title
|
目标窗口标题, 或句柄, 或类名. 参考 窗口标题与文本.
|
text
|
目标窗口文本. 参考 窗口标题与文本.
|
transparency
|
介于 0 到 255 之间的数值, 数值越大则窗口越不透明. 255 = 不透明,0 = 不可见.
|
返回值
成功:
|
返回值非 0 值.
|
失败:
|
返回 0, @error 设置为非 0 值, 操作系统不支持这个函数.
|
备注
屏幕颜色必须大于或者等于 16 位.
函数示例
Example()
Func Example()
; Run Notepad
Run("notepad.exe")
; Wait 10 seconds for the Notepad window to appear.
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
; Set the transparency of the Notepad window to 170.
WinSetTrans($hWnd, "", 170)
; Wait for 2 seconds to display the Notepad window.
Sleep(2000)
; Close the Notepad window using the handle returned by WinWait.
WinClose($hWnd)
EndFunc ;==>Example
----------------------------------------
该函数可以通过命令调用 exect
exect=$var_h=WinGetHandle('[CLASS:TTOTAL_CMD]')||WinSetTrans(Eval('var_h'),'''',192)||Sleep(3000)||WinSetTrans(Eval('var_h'),'''',255) ;; 持续3秒,使Total Commander窗口透明25%
exect=WinSetTrans('[CLASS:Shell_TrayWnd]','''',128) ;; 将透明度设置为任务栏的50%
© Аверин Андрей для Total Commander Image Averin-And@yandex.ru
|