AHK:窗口未激活时如何更改窗口透明度?

时间:2016-10-14 09:09:35

标签: user-interface autohotkey

我想在窗口未激活时将GUI更改为透明。

1 个答案:

答案 0 :(得分:1)

在代码的开头添加:

OnMessage(0x06, "WM_ACTIVATE") ;TRIGGER FUNCTION WHEN WINDOW'S ACTIVE STATUS IS CHANGED

将此功能添加到您的代码中:

WM_ACTIVATE()
{
    IfWinActive, MyWindow
        WinSet, Transparent, 255, MyWindow ; TRANSPARENCY OFF
    else
        WinSet, Transparent, 200, MyWindow ; SET TRANSPARENCY BETWEEN 0-255
}