本帖最后由 拿铁不加糖 于 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 |