透明效果技术要点:
A: _winapi_SetLayeredWindowAttributes ()这个函数+ $WS_EX_LAYERED +$LWA_COLORKEY 实现透明效果的效果
B:_winapi_SetLayeredWindowAttributes ();这个函数+ $WS_EX_LAYERED -$LWA_COLORKEY 实现半透明效果的效果
A+B 实现控件窗体透明,控件不透明效果
实例代码:
Func _showTask()
$width=@DesktopWidth
$hight=50
$hTabA = GUICreate("tabA", $width, $hight, 0, @DesktopHeight-40, $WS_POPUP+$WS_DISABLED,$WS_EX_LAYERED) ;+$WS_DISABLED 使得透明的窗体不触发按钮事件
GUISetBkColor(0x333333)
_winapi_SetLayeredWindowAttributes ($hTabA, 0x010101, 130);这个函数+ $WS_EX_LAYERED 实现透明度调节效果的效果
$hTab = GUICreate("tab", $width, $hight, 0, @DesktopHeight-40, $WS_POPUP,$WS_EX_LAYERED)
WinSetOnTop("tab","", 1)
GUISetBkColor(0x333333)
_winapi_SetLayeredWindowAttributes ($hTab, 0x333333, 255, $LWA_COLORKEY);这个函数+ $WS_EX_LAYERED +$LWA_COLORKEY 实现透明效果的效果
$wimpath="ico\Windowssetup.ico"
$wimKey=GUICtrlCreateIcon( $wimpath,-1,0, 0, 54, 40) ;GUICtrlCreatePic( "ico\Windowssetup.ico",0,0,$width,$hight)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW,$hTabA)
GUISetState(@SW_SHOW,$hTab)
HotKeySet("{Esc}", _Hello)
EndFunc