|
本帖最后由 botanycc 于 2009-5-17 07:49 编辑
如果修改这段代码的ICO图标读取方式,现在是从提取的ICO中读取的,如何改成直从exe中读取,其实这点我可以弄出来,但图标不清晰,这改怎么改好呢,高手帮下忙
#AutoIt3Wrapper_UseAnsi=y
#AutoIt3Wrapper_Icon=
#AutoIt3Wrapper_OutFile=
#AutoIt3Wrapper_OutFile_Type=exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Res_Comment=
#AutoIt3Wrapper_Res_Description=
#AutoIt3Wrapper_Res_Fileversion=
#AutoIt3Wrapper_Res_FileVersion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <GuiImageList.au3>
#include <Constants.au3>
#include <Process.au3>
#Include <SendMessage.au3>
#NoTrayIcon
#include <Misc.au3>
_Singleton("test")
$Cfg = @ScriptDir &"\ini\se.ini"
$Lest = IniRead ( $Cfg, "标题", "名称", "" )
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("[" & $Lest & "] ", 805, 512, -1, -1)
$ListView1 = GUICtrlCreateListView("", 120, 8, 670, 413)
GUICtrlSetStyle($ListView1, $LVS_ICON)
$LHand = GUICtrlGetHandle ($ListView1)
$Group1 = GUICtrlCreateGroup("", 0, 0, 105, 421)
$Hei = 15
$Car = IniReadSection($Cfg, "菜单分类")
IF $Car[0][0] > 0 Then
For $i = 1 To $Car[0][0]
;Msgbox ("","",$Car[$i][1])
$Button = GUICtrlCreateButton($Car[$i][1], 5, $Hei, 85, 35, 0)
$Hei = $Hei +45
Next
Endif
$hImage = _GUIImageList_Create()
_GUIImageList_SetIconSize($hImage,32,32)
$Game = @ScriptDir & "\ini\" & $Car[1][1] &".ini"
IF FileExists ($Game) Then
$var = IniReadSectionNames($Game)
If @error Then
Else
For $i = 1 To $var[0]
_GUIImageList_SetBkColor($hImage,0xFFFFFF)
$Ico = IniRead ($Game, $var[$i], "图标", "" )
_GUIImageList_AddIcon($hImage, @ScriptDir & "\Icon\"& $Ico) ;读取图标
_GUICtrlListView_SetImageList($ListView1, $hImage, 0)
$List = _GUICtrlListView_AddItem($ListView1, $var[$i], $i - 1)
Next
Endif
Else
MsgBox (0,"提示","读取配制文件出错,请检查配制文件.")
Endif
_GUICtrlListView_SetIconSpacing($ListView1, 72, 72)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Label1 = GUICtrlCreateLabel("", 850, 570, 852, 25,$SS_CENTERIMAGE)
$a = 1
$b = 1
While 1
$a +=1
$b +=1
$nMsg = GUIGetMsg()
For $i = 5 to $Button
Switch $nMsg
Case $i
_SendMessage($LHand,$LVM_DELETEALLITEMS)
$hImage = _GUIImageList_Create()
_GUIImageList_SetIconSize($hImage,32,32)
$Game = @ScriptDir & "\ini\" & GUICtrlRead ($i) &".ini"
IF FileExists ($Game) Then
$var = IniReadSectionNames($Game)
If @error Then
Else
For $a = 1 To $var[0]
_GUIImageList_SetBkColor($hImage,0xFFFFFF)
$Ico = IniRead ($Game, $var[$a], "图标", "" )
_GUIImageList_AddIcon($hImage, @ScriptDir & "\Icon\"& $Ico) ;读取图标
_GUICtrlListView_SetImageList($ListView1, $hImage, 0)
$List = _GUICtrlListView_AddItem($ListView1, $var[$a], $a - 1)
Next
Endif
Else
MsgBox (0,"提示","读取配制文件出错,请检查配制文件.")
Endif
EndSwitch
Next
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|