仿快捷方式更改图标_选择图标GUI

Gui, add, text, x0 y10 w400 h20, 查找此文件中的图标:
Gui, add, edit, x0 y30 w300 h20 -Multi vfile,
Gui, add, button, x300 y30 w100 h20 gselect, 浏览(&B)...
Gui, add, text, x0 y50 w400 h20, 从以下列表中选择一个图标:
Gui, Add, ListView, x0 y70 w400 h300 Icon vMyListView gMyListView, id
Gui, add, Button, x0 y380 w195 h20 Default gok, 确定
Gui, add, Button, x205 y380 w195 h20 gcancel, 取消
gui, show, , 选择图标
Return


select:
FileSelectFile, file, , , 请选择图标文件, 图标(*.dll;*.ico;*.exe)
if file
{
	GuiControl, , file, % file
	ImageListID := IL_Create(,,1)
	LV_SetImageList(ImageListID)
	icon_count := GetIconCount(file)
	LV_Delete()
	loop % icon_count
		IL_Add(ImageListID, file, A_Index)
	loop % icon_count
		LV_Add("Icon" . A_Index, A_Index)
}
Return

cancel:
gui, Destroy
Return

ok:
MyListView:
icon := {}
FocusedRowNumber := LV_GetNext(0, "F")
if not FocusedRowNumber
	{
	MsgBox, 4144, 提示, 您未选择任何图标!
	Return
	}
LV_GetText(id, FocusedRowNumber, 1)
icon["file"] := file
icon["id"] := id
MsgBox, 64, 提示, % "你选择了" """" icon["file"] """" "的第" icon["id"] "个图标"
Gui, destroy
Return

GetIconCount(file){
Menu, test, add, test, handle
Loop
{
try {
	id++
	menu, test, Icon, test, % file, % id
} catch error {
	Break
}
}
Return id-1
}

handle:
return

GuiClose:
ExitApp


给TA捐赠
共{{data.count}}人
人已捐赠
其他

仿Listary功能_Quant

2020-3-9 1:04:44

其他

优酷、土豆、爱奇艺提速

2020-3-9 1:06:44

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索