修改文件透明度 无反应求教 已解决
本帖最后由 ainizm 于 2013-4-30 12:13 编辑HotKeySet("!1", "tmd")
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
修改文件透明度,为何没反应,请教 文件透明度? 修改指定程序的窗口透明度
$title1 是程序窗口标题 你确定窗体是ansi?不是unicode?为什么要用GetWindowLongA? api的不会WinSetTrans 本帖最后由 xms77 于 2012-6-10 20:36 编辑
回复 1# ainizm
楼主,你的代码是可以文件透明的。
楼主的代码可行啊#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
页:
[1]