找回密码
 加入
搜索
查看: 9055|回复: 11

[GUI管理] 【已解决】添加背景图片之后按钮失效,求解决办法。

  [复制链接]
发表于 2012-5-22 19:42:54 | 显示全部楼层 |阅读模式
本帖最后由 拿铁不加糖 于 2012-5-22 21:04 编辑

添加背景图片之后按钮失效,求解决办法。
下面是代码:
#NoTrayIcon
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_icon=pic.ico
#AutoIt3Wrapper_outfile=autorun.exe
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_Comment=http://i.pcbeta.com/?1419113
#AutoIt3Wrapper_Res_Description=http://i.pcbeta.com/?1419113
#AutoIt3Wrapper_Res_Fileversion=1.0.12.20
#AutoIt3Wrapper_Res_LegalCopyright=http://i.pcbeta.com/?1419113
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiStatusBar.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Administrator\桌面\diannaogongsitebiban.kxf
;-------嵌入文件---------
FileInstall("SkinCrafterDll.dll",@tempdir&"SkinCrafterDll.dll",1)
FileInstall("vista.skf",@tempdir&"vista.skf",1)
FileInstall("qiqi.jpg",@tempdir&"qiqi.jpg",1)
;-------定义窗口---------
$Form1 = GUICreate("Windows安装程序", 623, 442, 189, 123)
GUISetCursor (2)

;------定义标签、图片(注意图片与标签位置,不然被覆盖)----------
$Label2 = GUICtrlCreateLabel("http://i.pcbeta.com/?1419113", 368, 72, 229, 25)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0xCC6600)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
GUICtrlSetCursor(-1, 0)

$Pic1 = GUICtrlCreatePic(@tempdir&"qiqi.jpg", 13, 13, 596, 89)
$Label3 = GUICtrlCreateLabel("http://i.pcbeta.com/?1419113", 368, 72, 229, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0x00CCFF)
;-------定义皮肤开始段-------
_SkinGUI(@tempdir&"SkinCrafterDll.dll",@tempdir&"vista.skf", $Form1)
;-----定义菜单-----------
$Button1 = GUICtrlCreateButton("安装Windows XP到C盘", 80, 166, 177, 41)
$Button2 = GUICtrlCreateButton("备份本机硬件驱动", 80, 238, 177, 41)
$Button3 = GUICtrlCreateButton("浏览光盘目录", 80, 310, 177, 41)
$Button4 = GUICtrlCreateButton("安装Windows PE到硬盘", 365, 167, 177, 41)
$Button5 = GUICtrlCreateButton("备份个人资料", 365, 239, 177, 41)
$Button6 = GUICtrlCreateButton("查看系统说明", 365, 313, 177, 41)


GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 500, "long", 0x00090000);定义退出效果
                        Exit
                Case $label2
                        ShellExecute("http://i.pcbeta.com/?1419113")
                Case $button6
                        ShellExecute(@ScriptDir &"\readme.txt")
                       
                Case $Button3
                        ShellExecute(@ScriptDir&"\")
                Case $Button1
                        Run(@ScriptDir &"\OneKey.exe")
                Case $Button2
                        Run(@ScriptDir &"\TOOLS\DRVBAK.EXE")
                Case $Button4
                        Run(@ScriptDir &"\PESetup.exe")
                Case $Button5
                        Run(@ScriptDir &"\TOOLS\BACKUP.EXE")
               
               
               

        EndSwitch
WEnd
;------承接皮肤定义段-------
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
   $Dll = DllOpen($SkincrafterDll)
   DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
   DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
   DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
   DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
   DllCall($Dll, "int:cdecl", "ApplySkin")
   ;------删除嵌入文件---------
   filedelete(@tempdir&"SkinCrafterDll.dll")
   filedelete(@tempdir&"vista.skf")
   filedelete(@tempdir&"qiqi.jpg")
EndFunc
发表于 2012-5-22 20:19:27 | 显示全部楼层
RunWait
Run函数的意义你懂吧
 楼主| 发表于 2012-5-22 20:26:56 | 显示全部楼层
回复 2# ooxxgod


    不懂呀!求指教。
发表于 2012-5-22 20:55:08 | 显示全部楼层
如果图片设置为背景图片, 将会与其它控件交叠, 请先禁用图片控件然后再创建其它控件: GuiCtrlSetState(-1,$GUI_DISABLE). 它不能工作于 标签(Tab) 或者 列表查看(Listview) 控件,因为它们会变化. 你可以在创建图片控件时加上 $WS_CLIPSIBLINGS 样式,如果是 标签(Tab) 或者 列表查看(Listview) 请记得加上 GuiCtrlSetState(-1,$GUI_ONTOP).

扩展样式 $GUI_WS_EX_PARENTDRAG 可以使用于在父窗口中拖放这个控件(父窗口不包括标题栏)(没有 $WS_CAPTION 样式于GUICreate).

背景总是设置为透明时. GUICtrlSetBkColor() 将会在图片控件上无效.
发表于 2012-5-22 20:59:40 | 显示全部楼层
$Pic1 = GUICtrlCreatePic(@tempdir&"qiqi.jpg", 13, 13, 596, 89)
GUICtrlSetState(-1,$GUI_DISABLE)
 楼主| 发表于 2012-5-22 21:01:40 | 显示全部楼层
回复 4# 80ren


    还是不明白,本人第一次使用AU3,可否给直接修改一下代码呢?万分感谢。
 楼主| 发表于 2012-5-22 21:04:18 | 显示全部楼层
回复 5# 3mile


    非常感谢,问题已解决。同时感谢其它热心的朋友。
发表于 2014-4-14 21:51:11 | 显示全部楼层
$Pic1 = GUICtrlCreatePic(@tempdir&"qiqi.jpg", 13, 13, 596, 89)
GUICtrlSetState(-1,$GUI_DISABLE)
3mile 发表于 2012-5-22 20:59

3mile的这个管用。谢谢。
发表于 2014-4-16 21:08:41 | 显示全部楼层
回复 4# 80ren


    牛屄的人儿呀你穷开心呀~~~
发表于 2014-7-21 20:50:04 | 显示全部楼层
试试效果!
发表于 2014-7-22 07:11:49 | 显示全部楼层
GUICtrlSetState(-1,$GUI_DISABLE)
发表于 2014-11-20 16:28:14 | 显示全部楼层
学习收藏了,谢谢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-18 16:38 , Processed in 0.084193 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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