楼主的代码可行啊#include <WinAPI.au3>
Global $title1
HotKeySet("!1", "tmd")
HotKeySet("{esc}", "_exit")
While 1
$title1 = _WinAPI_GetForegroundWindow()
Sleep(100)
WEnd
Func tmd()
If @HotKeyPressed = "!1" Then
$L = DllCall("user32.dll", "long", "GetWindowLongA", "hwnd", $title1, "int", -20);
$L = BitOR($L, 0x00080000);
$Result = DllCall("user32.dll", "long", "SetWindowLongA", "hwnd", $title1, "int", -20, "long", $L);
$Result = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $title1, "int", 0, "int", 100, "int", 0x00000002);
EndIf
EndFunc ;==>tmd
Func _exit()
Exit
EndFunc ;==>_exit
|