关于嵌入窗口 背景透明的问题, 哪位帮忙看看为什么嵌入窗口TitleForm 无法透明呢
代码如下:TitleForm 嵌入到SubForm ,原意是想把TitleForm窗口透明,然后在title窗口中添加label实现滚动字幕,各位大侠帮忙看看啊#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
$SubForm = GUICreate("Test Result",@DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
GUISetBkColor ( 0xED74D8 )
$ExpLabel = GUICtrlCreateLabel ("哈哈", 500, 150, 350, 400, 0x00000001) ;分数说明
GUICtrlSetFont(-1, 35, 900, 0, "华文新魏")
GUICtrlSetColor(-1, 0x0000FF)
$TitleForm = GUICreate("", 900, 150, 250,300, $WS_POPUPWINDOW)
GUISetBkColor(0x0000FF)
$Label1 = GUICtrlCreateLabel("Label1", 128, 56, 36, 17)
GUICtrlSetFont(-1, 18, 200, 0, "华文新魏")
GUISetState(@SW_SHOW, $SubForm)
DllCall ( "user32.dll" , "int" , "SetParent" , "hwnd" ,WinGetHandle($TitleForm), "hwnd" , WinGetHandle($SubForm))
_winapi_SetLayeredWindowAttributes($TitleForm, 0x0000FF, 0, $LWA_COLORKEY) ;这个函数实现的效果,窗体透明
GUISetState(@SW_SHOW, $TitleForm)
While 1 ; 死循环,保证脚本不会退出
;GUISetBkColor ( RandomColor () ) ; 随机窗口背景颜色
; 修改窗口背景颜色
Sleep (30000) ; 睡眠 3 秒
WEnd
页:
[1]