#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <ComboConstants.au3>
#include <GUIListView.au3>
#include <ListViewConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("图标提取工具", 260, 65)
FileInstall("\getico.dll", @ScriptDir & "", 1)
$geticodll=DllOpen(@ScriptDir&"\getico.dll")
$Input = GUICtrlCreateInput("", 5, 10, 200, 20)
$Button1 = GUICtrlCreateButton("浏览", 205, 10, 45, 20)
$Button2 = GUICtrlCreateButton("提取", 205, 38, 45, 20)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $Button1
$exe = FileOpenDialog("请选择提取目标","\","程序文件(*.exe)",1+4)
GUICtrlSetData($Input,$exe)
Case $nMsg = $Button2
ico($exe,@ScriptDir & "\_1.ico")
Form1Close()
Func ico( $t, $e)
Local $dllreturn = DllCall($geticodll,"int","getico","str",$t,"str",$e)
If $dllreturn[0]=1 Then
MsgBox(16,"","未找源文件")
EndIf
If $dllreturn[0]=2 Then
MsgBox(16,"错误","保存为图标文件失败")
EndIf
If $dllreturn[0]=0 Then
MsgBox(0,"","ico保存成功")
EndIf
DllClose($geticodll)
|