回复 8# chzj589
;你的意思是用Label来响应关闭事件,
;如果使用纯色背景没有问题,好设置,但如果使用图片做背景,这个label怎么设置透明
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#include <WinAPI.au3>
$Form1 = GUICreate("test", 600, 480, -1, -1, BitOR($WS_EX_LAYERED, $WS_POPUP))
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $form1, "int", _
500, "long", 0x00000010);主窗口打开效果;参数 1000 为调整渐大渐小(扩大/缩小)的效果速度
;~ $Pic1 = GUICtrlCreatePic("D:\zhihua\Pictures\sltkjmbz\sltk04.jpg", 0, 0, 600, 480)
;~ GUICtrlSetState(-1, $GUI_DISABLE)
$Labelb1 = GUICtrlCreateLabel('x', 565, 0, 30, 35,$SS_CENTER)
;~ GUICtrlSetBkColor(-1, 0x605f99)
;~ GUICtrlSetColor(-1, 0xEFEFEF)
GUICtrlSetFont(-1, 20, 400, 0, 'Verdana')
GUICtrlSetCursor($Labelb1, "SIZEALL") ;鼠标指针
$Labelb2 = GUICtrlCreateLabel('-', 530, 0, 30, 35,$SS_CENTER)
;~ GUICtrlSetBkColor(-1, 0x605f99)
;~ GUICtrlSetColor(-1, 0xEFEFEF)
GUICtrlSetFont(-1, 20, 400, 0, 'Verdana')
GUICtrlSetCursor($Labelb2, "SIZEALL") ;鼠标指针
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg(1)
If $nMsg[1] == $Form1 Then ;and $nMsg[0] == $WM_LBUTTONDOWN Then
DllCall("user32.dll", "BOOL", "ReleaseCapture")
DllCall("user32.dll", "LRESULT", "SendMessage", "HWND", $Form1, "UINT", $WM_SYSCOMMAND, "WPARAM", 0xF010 + 2, "LPARAM", 0)
EndIf
Switch $nMsg[0]
Case $Labelb1
Exit
Case $Labelb2
GUISetState(@SW_HIDE)
EndSwitch
WEnd |