GUISetIcon
设置窗口图标.
GUISetIcon ( iconfile [, iconID [, winhandle]] )
参数
iconfile
|
包含图标的文件名称.
|
iconID
|
[可选] 图标文件中的图标 ID. (Default(默认) -1).
|
winhandle
|
[可选] 由 GUICreate() 函数返回的窗口句柄 (默认为先前使用的窗口).
|
返回值
备注
正数引用表示图标名的字符串.
负数引用基于 1 的图标索引,一些 DLL 图标只能用负数提取
仅支持负数.
相关
GUICreate
函数示例
#include <GUIConstantsEx.au3>
Example()
Func Example()
; X64 running support
Local $sWow64 = ""
If @AutoItX64 Then $sWow64 = "\Wow6432Node"
; Retrieve the following ico file. This can be found in the include folder which is in the installation path of AutoIt.
Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE" & $sWow64 & "\AutoIt v3\AutoIt", "InstallDir") & "\icons\au3.ico"
GUICreate("My GUI new icon") ; will create a dialog box that when displayed is centered
GUISetIcon($sFile) ; will change icon
GUISetState(@SW_SHOW); will display an empty dialog box
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
GUIDelete()
EndFunc ;==>Example
----------------------------------------
|