PNG图片背景窗口怎么让窗口和图片一起最小化及隐藏托盘
PNG图片背景窗口,最小化或隐藏托盘时图片还留在画面上,没隐藏。学习到这个比较好用,望高手指教#include <PNGbackgroundUDF.au3>#include <ButtonConstants.au3>
#include <EditConstants.au3>
$PNG_GUI = CreateTransparentGUI("PNG图片显示(透明)", "Background1.png", $WS_POPUP)
$Button1 = GUICtrlCreateButton("最小化窗口", ($PNG_GUI - 115) / 2, $PNG_GUI - 60, 115, 25, 0)
$Button2 = GUICtrlCreateButton("隐藏窗口", ($PNG_GUI - 115) / 2, $PNG_GUI - 25 , 115, 25, 0)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUISetState(@SW_MINIMIZE) ;最小化窗口
Case $Button2
GUISetState(@SW_HIDE) ;隐藏窗口
EndSwitch
WEnd
学习png代码打包
#include <PNGbackgroundUDF.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
$PNG_GUI = CreateTransparentGUI("PNG图片显示(透明)", "Background1.png", $WS_POPUP)
$Button1 = GUICtrlCreateButton("最小化窗口", ($PNG_GUI - 115) / 2, $PNG_GUI - 60, 115, 25, 0)
$Button2 = GUICtrlCreateButton("隐藏窗口", ($PNG_GUI - 115) / 2, $PNG_GUI - 25 , 115, 25, 0)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_WinAPI_ShowWindow($PNG_GUI,@SW_MINIMIZE)
;~ _WinAPI_ShowWindow($PNG_GUI,@SW_MINIMIZE);最小化窗口
Case $Button2
_WinAPI_ShowWindow($PNG_GUI,@SW_HIDE)
_WinAPI_ShowWindow($PNG_GUI,@SW_HIDE) ;隐藏窗口
EndSwitch
WEnd
上面其实是两个窗口,要一齐处理 本帖最后由 xzxnovice 于 2011-4-16 10:38 编辑
#include <PNGbackgroundUDF.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
$PNG_GUI = CreateTransparentGUI("PNG图片显示(透明)", "Background1.png", $WS_POPUP)
$Button1 = GUICtrlCreateButton("最小化窗口", ($PNG_GUI - 115) / 2, $PNG_GUI - 60, 115, 25, 0)
$Button2 = GUICtrlCreateButton("隐藏窗口", ($PNG_GUI - 115) / 2, $PNG_GUI - 25 , 115, 25, 0)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_WinAPI_ShowWindow($PNG_GUI,@SW_MINIMIZE)
;~ _WinAPI_ShowWindow($PNG_GUI,@SW_MINIMIZE);最小化窗口
Case $Button2
_WinAPI_ShowWindow($PNG_GUI,@SW_HIDE)
_WinAPI_ShowWindow($PNG_GUI,@SW_HIDE) ;隐藏窗口
EndSwitch
WEnd
上面其实是两个窗口,要一齐处理 上面的2个答案是不是一样的。受教了,原来是2个窗口,没遇到还真学不会呢。
页:
[1]