其实跟按钮是一样的
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $LblACNLink
ShellExecute("www.autoit.cn")
EndSwitch
WEnd
自定义皮肤的话,给你实例吧。
ACN软件专题站
http://www.autoit.org.cn/column/zhongwen-forum/au3VistaSkin.html
当然论坛里面也有很多例子,可以看下。
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
Opt("OnExitFunc","Quit");设置在 AutoIt 退出时将调用的函数(Quit)
$Form = GUICreate("Vista皮肤", 180, 66, 192, 124)
;加载皮肤
Dim $Dll
FileInstall("SkinCrafterDll.dll", @TempDir& "\SkinCrafterDll.dll",1)
FileInstall("vista_style.skf", @TempDir& "\vista_style.skf",1)
$Dll = DllOpen(@TempDir& "\SkinCrafterDll.dll")
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", @TempDir& "\vista_style.skf")
DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Form, "int", 25)
DllCall($Dll, "int:cdecl", "ApplySkin")
$Button = GUICtrlCreateButton("关于", 45, 8, 91, 49, 0)
GUICtrlSetFont(-1, 24, 800, 0, "仿宋_GB2312")
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Quit()
Case $Button
MsgBox(0,"关于","Autoit软件专题站" & @CRLF & "" & @CRLF & "www.autoit.org.cn")
If MouseDown("left")=1 Then
$url="http://www.autoit.org.cn"
Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe -new " & $url)
EndIf
EndSwitch
WEnd
;退出加载皮肤
Func Quit()
GUISetState(@SW_HIDE)
DllCall($dll, "int", "DeInitDecoration")
DllCall($dll, "int", "RemoveSkin")
DllClose($dll)
FileDelete ( @TempDir&"\SkinCrafterDll.dll" )
FileDelete ( @TempDir&"\vista_style.skf" )
Exit
EndFunc |