找回密码
 加入
搜索
查看: 4397|回复: 3

[AU3基础] PNG图片背景窗口怎么让窗口和图片一起最小化及隐藏托盘

[复制链接]
发表于 2011-4-15 21:29:25 | 显示全部楼层 |阅读模式
悬赏30金钱已解决
PNG图片背景窗口,最小化或隐藏托盘时图片还留在画面上,没隐藏。学习到这个比较好用,望高手指教
#include <PNGbackgroundUDF.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>

$PNG_GUI = CreateTransparentGUI("PNG图片显示(透明)", "Background1.png", $WS_POPUP)
$Button1 = GUICtrlCreateButton("最小化窗口", ($PNG_GUI[2] - 115) / 2, $PNG_GUI[3] - 60, 115, 25, 0)
$Button2 = GUICtrlCreateButton("隐藏窗口", ($PNG_GUI[2] - 115) / 2, $PNG_GUI[3] - 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代码打包
附件: 您需要 登录 才可以下载或查看,没有账号?加入

最佳答案

查看完整内容

上面其实是两个窗口,要一齐处理
发表于 2011-4-15 21:29:26 | 显示全部楼层
#include <PNGbackgroundUDF.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>

$PNG_GUI = CreateTransparentGUI("PNG图片显示(透明)", "Background1.png", $WS_POPUP)
$Button1 = GUICtrlCreateButton("最小化窗口", ($PNG_GUI[2] - 115) / 2, $PNG_GUI[3] - 60, 115, 25, 0)
$Button2 = GUICtrlCreateButton("隐藏窗口", ($PNG_GUI[2] - 115) / 2, $PNG_GUI[3] - 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[0],@SW_MINIMIZE)
;~                         _WinAPI_ShowWindow($PNG_GUI[1],@SW_MINIMIZE);最小化窗口
                Case $Button2
                        _WinAPI_ShowWindow($PNG_GUI[0],@SW_HIDE)
                        _WinAPI_ShowWindow($PNG_GUI[1],@SW_HIDE)        ;隐藏窗口
        EndSwitch
WEnd
上面其实是两个窗口,要一齐处理

评分

参与人数 1金钱 +20 收起 理由
guang19831217 + 20 学到好东西,另外再加悬赏金额,谢谢哦

查看全部评分

发表于 2011-4-16 10:32:48 | 显示全部楼层
本帖最后由 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[2] - 115) / 2, $PNG_GUI[3] - 60, 115, 25, 0)
$Button2 = GUICtrlCreateButton("隐藏窗口", ($PNG_GUI[2] - 115) / 2, $PNG_GUI[3] - 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[0],@SW_MINIMIZE)
;~                         _WinAPI_ShowWindow($PNG_GUI[1],@SW_MINIMIZE);最小化窗口
                Case $Button2
                        _WinAPI_ShowWindow($PNG_GUI[0],@SW_HIDE)
                        _WinAPI_ShowWindow($PNG_GUI[1],@SW_HIDE)        ;隐藏窗口
        EndSwitch
WEnd
上面其实是两个窗口,要一齐处理
 楼主| 发表于 2011-4-16 12:13:35 | 显示全部楼层
上面的2个答案是不是一样的。受教了,原来是2个窗口,没遇到还真学不会呢。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-10 04:05 , Processed in 0.108110 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表