完整的源代码,可以解压龙之谷资源包,打包,定制定,制作自动补丁
严重声明:技术仅用于交流,请勿用于破坏游戏平衡性或谋利。违反者所造成的经济责任与法律责任与本人一概无关,由其承担一切后果。
Global _OpenResName$
Global _SaveResName$
Global _OpenResPath$
Global _SaveResPath$
Global _IsUnPackRun
Global _IsPackRun
Global _IsCloseWin100
Global _IsCloseWin200
;虚拟文件的结构
Structure TypeVirFile
VirName$ ; 虚拟文件的虚拟全路径
VirSize.l ; 虚拟文件的大小
ExtSize.l ; 虚拟文件解压后的大小
KeepSize.l ; 虚拟文件占用的空间的大小
VirAddress.l ; 虚拟文件内容在资源中的指针地址
IdxAddress.l ; 虚拟文件索引在资源文件的指针地址
EndStructure
;虚拟文件的结构
Structure TypeVirFolder
VirPath$ ; 虚拟文件的虚拟路径
StartList.l ; 符合虚拟路径的虚拟文件的开始索引号
EndList.l ; 符合虚拟路径的虚拟文件的结束索引号
EndStructure
Global NewList _ListAllVirFile.TypeVirFile() ;虚拟文件的索引集
Global NewList _ListAllVirFolder.TypeVirFolder() ;虚拟文件的路径集
Global NewList _ResFilesToPacking$() ;虚拟文件的索引集
Global _CountResFilesToPacking ;虚拟文件的索引集
;- 设置集---------------------------------------------------------------------------------------------------------
Procedure UseParserRes_ReadUIPrefs() ;<<<<<<<<<<OK
OnErrorResume() ;出错继续运行程序
OpenPreferences("set.prefs")
PreferenceGroup("FileName")
_OpenResName$ = ReadPreferenceString ("OpenResName", "")
_SaveResName$ = ReadPreferenceString ("SaveResName", "")
_OpenResPath$ = ReadPreferenceString ("OpenResPath", "")
_SaveResPath$ = ReadPreferenceString ("SaveResPath", "")
ClosePreferences()
EndProcedure
;保存UI设置
Procedure UseParserRes_SaveUIPrefs() ;<<<<<<<<<<OK
OnErrorResume() ;出错继续运行程序
If CreatePreferences("set.prefs")
PreferenceGroup("FileName")
WritePreferenceString ("OpenResName", _OpenResName$)
WritePreferenceString ("SaveResName", _SaveResName$)
WritePreferenceString ("OpenResPath", _OpenResPath$)
WritePreferenceString ("SaveResPath", _SaveResPath$)
ClosePreferences()
EndIf
EndProcedure
;- 构建控件---------------------------------------------------------------------------------------------------------
; 构建主窗体控件
Procedure CreateWin_MainWindow()
WinFlags.l = #PB_Window_MinimizeGadget|#PB_Window_SystemMenu|#PB_Window_ScreenCentered
WinHwnd = OpenWindow(0, 0, 0, 620, 200, "迷路[龙之谷]客户端解析器 V1.00", WinFlags )
If WinHwnd = 0 : ProcedureReturn #True : EndIf ;构建主窗体
If CreateGadgetList(WindowID(0)) = 0 : ProcedureReturn #True : EndIf ;构建主窗体
UseParserRes_ReadUIPrefs()
Frame3DGadget(100, 010, 010+000, 600, 080,"解析成明文文件库")
TextGadget (101, 025, 033+000, 080, 020, "资 源 地址:")
StringGadget (103, 100, 030+000, 400, 020, "")
ButtonGadget (105, 510, 030+000, 020, 020, "..")
TextGadget (102, 025, 063+000, 080, 020, "明文库地址:")
StringGadget (104, 100, 060+000, 400, 020, "")
ButtonGadget (106, 510, 060+000, 020, 020, "..")
ButtonGadget (107, 540, 030+000, 055, 050, "解析")
Frame3DGadget(200, 010, 010+100, 600, 080,"打包成资源文件")
TextGadget (201, 025, 033+100, 080, 020, "明文库地址:")
StringGadget (203, 100, 030+100, 400, 020, "")
ButtonGadget (205, 510, 030+100, 020, 020, "..")
TextGadget (202, 025, 063+100, 080, 020, "新资源地址:")
StringGadget (204, 100, 060+100, 400, 020, "")
ButtonGadget (206, 510, 060+100, 020, 020, "..")
ButtonGadget (207, 540, 030+100, 055, 050, "打包")
;ProgressBarGadget(300, 010, 200, 600, 20, 0, 100 )
SetGadgetText(103, _OpenResName$)
SetGadgetText(104, _SaveResPath$)
SetGadgetText(203, _OpenResPath$)
SetGadgetText(204, _SaveResName$)
;SetGadgetState (300, 100)
EndProcedure
Procedure CreateWin_UnPackingWindow()
WinFlags.l = #PB_Window_MinimizeGadget|#PB_Window_SystemMenu|#PB_Window_ScreenCentered
WinHwnd = OpenWindow(100, 0, 0, 400, 110, "正在解析["+GetFilePart(_OpenResName$) + "]资源", WinFlags )
If WinHwnd = 0 : ProcedureReturn #True : EndIf ;构建主窗体
If CreateGadgetList(WindowID(100)) = 0 : ProcedureReturn #True : EndIf ;构建主窗体
Text$ = "[共有: " + Str(CountList(_ListAllVirFolder())) + "个文件夹] 正在创建文件夹..."
TextGadget(1000, 10, 20, 270, 20, Text$)
TextGadget(1001, 280, 20, 110, 20, "[耗时 ms] 0%",#PB_Text_Right)
ProgressBarGadget(1002, 10, 40, 380, 20, 0, 100 )
ButtonGadget (1003, 300, 70, 80, 30, "取消" )
SetGadgetState (1002,0)
DisableWindow(0, 1)
DisableGadget(1003, 1)
EndProcedure
Procedure CreateWin_PackingWindow()
WinFlags.l = #PB_Window_MinimizeGadget|#PB_Window_SystemMenu|#PB_Window_ScreenCentered
WinHwnd = OpenWindow(200, 0, 0, 400, 110, "正在打包["+GetFilePart(_SaveResName$) + "]资源库", WinFlags )
If WinHwnd = 0 : ProcedureReturn #True : EndIf ;构建主窗体
If CreateGadgetList(WindowID(200)) = 0 : ProcedureReturn #True : EndIf ;构建主窗体
Text$ = "正在检测资源库文件..."
TextGadget(2000, 10, 20, 270, 20, Text$)
TextGadget(2001, 280, 20, 110, 20, "[耗时 ms]",#PB_Text_Right)
ProgressBarGadget(2002, 10, 40, 380, 20, 0, 100 )
ButtonGadget (2003, 300, 70, 80, 30, "打包" )
ButtonGadget (2004, 300, 70, 80, 30, "取消" )
CheckBoxGadget (2005, 10, 70, 200, 30, "打包空文件" )
SetGadgetState (2002,0)
DisableWindow(0, 1)
HideGadget(2003, 1) : HideGadget(2004, 1)
EndProcedure
严重声明:技术仅用于交流,请勿用于破坏游戏平衡性或谋利。违反者所造成的经济责任与法律责任与本人一概无关,由其承担一切后果。
;-次级功能--------------------------------------------------------------------------------------------------------
Procedure CreateWin_EventGadget_107_CheckFolder()
ResSize = FileSize(_OpenResName$)
If ResSize <1 : MessageRequester("出错提示", "指定的资源文件不存在,或被另一程序占用 ", 0) : EndIf
ResPath$ = GetGadgetText(104 )
If FileSize(ResPath$) = -1
If CreateDirectory(ResPath$)
_SaveResPath$ = ResPath$
Else
MessageRequester("出错提示", "1.文件夹不存在." + Chr(13)+Chr(10) + "2.自动创建文件夹失败,只能自动创建最后一级的文件夹. ", 0)
ProcedureReturn 1
EndIf
EndIf
UseParserRes_SaveUIPrefs()
EndProcedure
Procedure CreateWin_EventGadget_107_CheckResource()
ResSize = FileSize(_OpenResName$)
*MemTempID = AllocateMemory( ResSize )
FileHandle = CreateFile_( _OpenResName$, $40000000 | $80000000, 3, 0, 3, 0, 0 )
If FileHandle < 0 : ProcedureReturn 1 : EndIf
Paddress = SetFilePointer_(FileHandle, $100, 0, 0 ) ;获取资源文件起始地址的指针
ReadFile_( FileHandle, *MemTempID, $10, @Paddress, 0 ) ;加载资源文件
FileCount = PeekL(*MemTempID + $4) ;获取文件的数量
IndexAddress = PeekL(*MemTempID + $8) ;获取文件索引的起始位置
Size = FileCount * $13C
*MemTempID = ReAllocateMemory(*MemTempID,Size )
Paddress = SetFilePointer_(FileHandle, IndexAddress, 0, 0 ) ;获取资源文件起始地址的指针
ReadFile_( FileHandle, *MemTempID, Size, @Paddress, 0 ) ;加载资源文件
CloseHandle_( FileHandle )
ClearList( _ListAllVirFile() ) ;清空用于存放所有虚拟文件的链表
ClearList( _ListAllVirFolder() ) ;清空用于存放某指定文件夹内虚拟文件的链表
;======== 加载资源中所有虚拟文件的信息
For i = 1 To FileCount
AddElement( _ListAllVirFile() )
_ListAllVirFile()\VirName$ = PeekS(*MemTempID + Pos, $100) ;获取虚拟文件的全名称
;_ListAllVirFile()\IdxAddress = IndexAddress + Pos ;获取虚拟文件解压所的大小
CopyMemory_(@_ListAllVirFile()\VirSize, *MemTempID + Pos + $100, $10 )
Pos = Pos + $13C
Next
SortStructuredList( _ListAllVirFile(), 0, OffsetOf(TypeVirFile\VirName$), #PB_Sort_String ) ;按 VirName$进行链表排序;
;======== 整理文件夹路径;指出文件夹包含的文件的相对起始索引;加速打开文件夹里面的虚拟文件
Index=0
ForEach _ListAllVirFile()
PathPart$ = GetPathPart(_ListAllVirFile()\VirName$) ;获取虚拟文件的路径
If TempPath$ <> PathPart$ ;对比虚拟文件的路径与上一个虚拟文件的路径是否一样
AddElement( _ListAllVirFolder() ) ;添加虚拟文件的路径
_ListAllVirFolder()\VirPath$ = PathPart$
_ListAllVirFolder()\StartList = Index
TempPath$ = PathPart$
EndIf
Index + 1
If _ListAllVirFile()\VirName$ <> "" : _ListAllVirFolder()\EndList = Index : EndIf
Next
EndProcedure
Procedure CreateWin_EventGadget_107_CreateFolders()
Dim TempFolderPath$(9)
GetTickCount = GetTickCount_()
PerFolders = CountList(_ListAllVirFolder())/100 + 1 : Folder = 0 : CountPer = 0
If Right(_SaveResPath$,1) <> "\" : _SaveResPath$ + "\" : EndIf
ForEach _ListAllVirFolder()
Folder + 1
For i = 2 To CountString(_ListAllVirFolder()\VirPath$,"\")
If TempFolderPath$(i) = StringField(_ListAllVirFolder()\VirPath$, i, "\") : Continue : EndIf ;如果节点一样,则转到下一个节点
For k = i To 9 ;如果节点不一样,就对剩下的节点进行操作
TempFolderPath$(k) = StringField(_ListAllVirFolder()\VirPath$, k, "\") ;重新组织一下[临时节点]的内容
If TempFolderPath$(k)<>"" ;节点内容不为空,进行节点加载与着对应的链表也进行加载
TempVirFolderNode$ = _SaveResPath$ : Count + 1
For x = 2 To k : TempVirFolderNode$ = TempVirFolderNode$ + TempFolderPath$(x) +"\" : Next ;获取节点全路径
If CheckFilename(TempVirFolderNode$) = 0 : CreateDirectory( TempVirFolderNode$ ): EndIf
If Folder >= PerFolders
CountPer+1 : Folder = 0
SetGadgetState(1002,CountPer)
SetGadgetText(1001, "[耗时 " +Str( GetTickCount_() - GetTickCount ) + "ms] " + Str(CountPer) + "%" )
EndIf
EndIf
Next
Break ;如遇有节点不一样,就将后面的节点内容加载到临时节点上,所以此处应当退出
Next
Next
SetGadgetState(1002,100)
SetGadgetText(1001, "[耗时 " +Str( GetTickCount_() - GetTickCount ) + "ms] 100%" )
EndProcedure
Procedure CreateWin_EventGadget_107_ParserResource()
OnErrorResume() ;出错继续运行程序
CreateWin_EventGadget_107_CreateFolders()
;MessageRequester("","OK"):End
DisableGadget(1003, 0)
Text$ = "[共有: " + Str(CountList(_ListAllVirFolder())) + "个文件夹/" + Str(CountList(_ListAllVirFile())) + "个文件.] 解析中..."
SetGadgetText(1000, Text$)
GetTickCount = GetTickCount_()
PerFiles = CountList(_ListAllVirFile())/100 + 1 : Files = 0 : CountPer = 0
If OpenLibrary(0, "zlib.dll")
*uncompdll = GetFunction(0, "uncompress")
*MemTempID = AllocateMemory( $100 ) : *MemVirFile = AllocateMemory( $100 )
FileHandle = CreateFile_( _OpenResName$, $40000000 | $80000000, 3, 0, 3, 0, 0 )
If FileHandle < 0 : ProcedureReturn 1 : EndIf
ForEach _ListAllVirFile()
; If GetFilePart(_ListAllVirFile()\VirName$) = "colbuild.ini" Or GetFilePart(_ListAllVirFile()\VirName$) = "heightattribute.ini"
VirSize = _ListAllVirFile()\VirSize : ExtSize = _ListAllVirFile()\ExtSize : Files +1
If _ListAllVirFile()\VirAddress And VirSize And ExtSize
*MemTempID = ReAllocateMemory(*MemTempID, VirSize )
Paddress = SetFilePointer_(FileHandle, _ListAllVirFile()\VirAddress, 0, 0 ) ;获取资源文件起始地址的指针
ReadFile_( FileHandle, *MemTempID, VirSize, @Paddress, 0 ) ;加载资源文件
ExtSize = _ListAllVirFile()\ExtSize : *MemVirFile = ReAllocateMemory(*MemVirFile, ExtSize )
CallFunctionFast( *uncompdll, *MemVirFile , @ExtSize, *MemTempID, VirSize)
VirSize = ExtSize : Swap *MemTempID, *MemVirFile: Count+1
Else
VirSize = 0
EndIf
FileName$ = _SaveResPath$ + _ListAllVirFile()\VirName$
If CreateFile(1, FileName$ ): WriteData(1, *MemTempID, VirSize ) : CloseFile(1) : EndIf
If Files >= PerFiles
CountPer+1 : Files = 0
SetGadgetState(1002,CountPer)
SetGadgetText(1001, "[耗时 " +StrF(( GetTickCount_() - GetTickCount)/1000,2 ) + "s] " + Str(CountPer) + "%" )
EndIf
If _IsUnPackRun = #False : Break : EndIf
;EndIf
Next
EndIf
SetGadgetState(1002,100)
SetGadgetText(1001, "[耗时 " +StrF(( GetTickCount_() - GetTickCount)/1000,2 ) + "s] 100%" )
_IsUnPackRun = #False : _IsCloseWin100 = #True
CloseHandle_( FileHandle )
CloseLibrary(0)
EndProcedure
Procedure CreateWin_EventGadget_207_CheckParserFolder(Dir$)
Protected ID.l, files.l
If Right(Dir$, 1) <> "\" : Dir$ + "\" : EndIf
ID = ExamineDirectory(#PB_Any, Dir$, "")
If ID
While NextDirectoryEntry(ID)
Select DirectoryEntryType(ID)
Case 0
Break
Case #PB_DirectoryEntry_File
files + 1 : AddElement( _ResFilesToPacking$()) : _ResFilesToPacking$() = Dir$ + DirectoryEntryName(ID)
Case #PB_DirectoryEntry_Directory
If DirectoryEntryName(ID) <> "." And DirectoryEntryName(ID) <> ".."
files + CreateWin_EventGadget_207_CheckParserFolder(Dir$ + DirectoryEntryName(ID))
EndIf
EndSelect
Wend
EndIf
ProcedureReturn files
EndProcedure
Procedure CreateWin_EventGadget_207_CreateParserHeader()
HeaderMsg$ = "EyedentityGames Packing File 0.1"
*MemTemp = AllocateMemory($400)
PokeS(*MemTemp, HeaderMsg$)
PokeL(*MemTemp+$100, $B)
If CreateFile(0, _SaveResName$)
WriteData(0, *MemTemp,$400)
CloseFile(0)
EndIf
FreeMemory(*MemTemp)
EndProcedure
Procedure CreateWin_EventGadget_207_PackParser()
GetTickCount = GetTickCount_()
PerFiles = _CountResFilesToPacking/100 + 1 : Files = 0 : CountPer = 0
ResIndexAddress = $400
ResIndexSize = 0
ResDataSize = 0
ResIndexCount = 0
SetGadgetState(2002,CountPer)
If OpenLibrary(0, "zlib.dll")
*compdll = GetFunction(0, "compress2")
*MemTempID = AllocateMemory( $100 ) : *MemVirFile = AllocateMemory( $100 ): *MemIndex = AllocateMemory( $100 )
FileHandle = CreateFile_( _SaveResName$, $40000000 | $80000000, 3, 0, 3, 0, 0 )
If FileHandle < 0 : ProcedureReturn 1 : EndIf
ForEach _ResFilesToPacking$()
FileSize = FileSize(_ResFilesToPacking$())
If FileSize > 0
*MemTempID = ReAllocateMemory(*MemTempID,FileSize)
Else
If GetGadgetState(2005) = 0 : Continue : EndIf
EndIf
Pos = IndexSize : IndexSize + $13C : *MemIndex = ReAllocateMemory(*MemIndex,IndexSize):
ResDataAddress = ResIndexAddress
VirSize = FileSize + $13 : *MemVirFile = ReAllocateMemory(*MemVirFile,VirSize)
If FileSize > 0
If ReadFile(0, _ResFilesToPacking$()) : ReadData(0,*MemTempID,FileSize) : CloseFile(0) : EndIf
CallFunctionFast( *compdll, *MemVirFile, @VirSize, *MemTempID, FileSize, 1)
Else
VirSize = 0
EndIf
ResVirFileName$ = ReplaceString(_ResFilesToPacking$(),_OpenResPath$,"\" )
PokeS( *MemIndex+Pos, ResVirFileName$ )
PokeL( *MemIndex+Pos+$100, VirSize) ;打包文件的大小
PokeL( *MemIndex+Pos+$104, FileSize) ;明件文件的大小
PokeL( *MemIndex+Pos+$108, VirSize) ;预留大小
PokeL( *MemIndex+Pos+$10C, ResDataAddress) ;预留大小
ResIndexAddress + VirSize
FFFFF = 0
If FileSize > 0
Paddress = SetFilePointer_( FileHandle, ResDataAddress, 0, 0) ;获取资源文件起始地址的指针
WriteFile_(FileHandle, *MemVirFile, VirSize, @Paddress, 0) ;向资源文件写入内容
WriteFile_(FileHandle, @FFFFF, VirSize, @Paddress, 0) ;向资源文件写入内容
EndIf
Paddress = SetFilePointer_( FileHandle, ResIndexAddress, 0, 0) ;获取资源文件起始地址的指针
WriteFile_(FileHandle, *MemIndex, IndexSize, @Paddress, 0) ;向资源文件写入内容
ResIndexCount+1
Paddress = SetFilePointer_( FileHandle, $104, 0, 0) ;获取资源文件起始地址的指针
WriteFile_(FileHandle, @ResIndexCount, 4, @Paddress, 0) ;向资源文件写入内容
Paddress = SetFilePointer_( FileHandle, $108, 0, 0) ;获取资源文件起始地址的指针
WriteFile_(FileHandle, @ResIndexAddress, 4, @Paddress, 0) ;向资源文件写入内容
FlushFileBuffers_(FileHandle)
PackedFiles + 1 : Files + 1
If Files >= PerFiles
CountPer+1 : Files = 0
SetGadgetState(2002,CountPer)
EndIf
SetGadgetText(2000, "[已打包: " + Str(PackedFiles) + "/" + Str(_CountResFilesToPacking) + "个文件] 正在打包中...")
SetGadgetText(2001, "[耗时 " +StrF(( GetTickCount_() - GetTickCount)/1000,2 ) + "s] " + Str(CountPer) + "%" )
If _IsPackRun = #False : Break : EndIf
Next
EndIf
SetGadgetState(2002,100)
SetGadgetText(2001, "[耗时 " +StrF(( GetTickCount_() - GetTickCount)/1000,2 ) + "s] 100%" )
_IsPackRun = #False : _IsCloseWin200 = #True
CloseHandle_( FileHandle )
CloseLibrary(0)
EndProcedure
;- 事件过程---------------------------------------------------------------------------------------------------------
Procedure CreateWin_EventGadget_105()
StandardFile$ = _OpenResName$
Pattern$ = "*.Pak|*.Pak"
Pattern = 0
_OpenResName$ = OpenFileRequester("请选择[龙之谷]资源文件", StandardFile$, Pattern$, Pattern)
If _OpenResName$
SetGadgetText(103, _OpenResName$)
Else
MessageRequester("出错提示", "文件不存在.", 0)
EndIf
EndProcedure
Procedure CreateWin_EventGadget_106()
InitialPath$ = _SaveResPath$
_SaveResPath$ = PathRequester("请选择明文文件的路径", InitialPath$)
If _SaveResPath$
SetGadgetText(104,_SaveResPath$)
Else
MessageRequester("出错提示", "文件夹不存在.", 0)
EndIf
EndProcedure
Procedure CreateWin_EventGadget_107()
If CreateWin_EventGadget_107_CheckFolder() : ProcedureReturn : EndIf
If CreateWin_EventGadget_107_CheckResource() : ProcedureReturn : EndIf
CreateWin_UnPackingWindow()
_IsUnPackRun = #True
CreateThread(@CreateWin_EventGadget_107_ParserResource(), 154)
EndProcedure
Procedure CreateWin_EventGadget_205()
InitialPath$ = _OpenResPath$
_OpenResPath$ = PathRequester("请选择明文库的路径", InitialPath$)
If _OpenResPath$
SetGadgetText(203,_OpenResPath$)
Else
MessageRequester("出错提示", "文件夹不存在.", 0)
EndIf
EndProcedure
Procedure CreateWin_EventGadget_206()
StandardFile$ = _SaveResName$
Pattern$ = "*.Pak|*.Pak"
Pattern = 0
_SaveResName$ = SaveFileRequester("请选择[龙之谷]资源文件", StandardFile$, Pattern$, Pattern)
If _SaveResName$
If GetExtensionPart(_SaveResName$) <> "pak" : _SaveResName$ + ".pak" : EndIf
SetGadgetText(204,_SaveResName$)
Else
MessageRequester("出错提示", "文件不存在.", 0)
EndIf
EndProcedure
Procedure CreateWin_EventGadget_207()
UseParserRes_SaveUIPrefs()
CreateWin_PackingWindow()
ClearList(_ResFilesToPacking$() )
_CountResFilesToPacking = CreateWin_EventGadget_207_CheckParserFolder(_OpenResPath$) : GetTickCount = GetTickCount_()
SetGadgetState (2002,100): DisableGadget(2003, 0)
SetGadgetText(2000, "[共扫描到: " + Str(_CountResFilesToPacking) + "个文件] " )
SetGadgetText(2001, "[耗时 " +Str( GetTickCount_() - GetTickCount ) + "ms] ")
HideGadget(2003, 0)
EndProcedure
Procedure CreateWin_EventGadget_1003()
If _IsUnPackRun = #False : CloseWindow(100) : DisableWindow(0, 0) : SetActiveWindow(0): Else : _IsUnPackRun = #False : EndIf
EndProcedure
Procedure CreateWin_EventGadget_2003()
GetTickCount = GetTickCount_()
HideGadget(2003, 1)
SetGadgetText(2000, "正在创建资源文件... " )
SetGadgetText(2001, "[耗时 " +Str( GetTickCount_() - GetTickCount ) + "ms] ")
CreateWin_EventGadget_207_CreateParserHeader()
SetGadgetText(2000, "资源文件创建完成." )
SetGadgetText(2001, "[耗时 " +Str( GetTickCount_() - GetTickCount ) + "ms] ")
HideGadget(2004, 0)
_IsPackRun = #True
CreateThread(@CreateWin_EventGadget_207_PackParser(), 155)
EndProcedure
Procedure CreateWin_EventGadget_2004()
If _IsPackRun = #False : CloseWindow(200) : DisableWindow(0, 0) : SetActiveWindow(0): Else : _IsPackRun = #False : EndIf
EndProcedure
Procedure CreateWin_EventGadget()
Select EventGadget()
Case 105 : CreateWin_EventGadget_105()
Case 106 : CreateWin_EventGadget_106()
Case 107 : CreateWin_EventGadget_107()
Case 205 : CreateWin_EventGadget_205()
Case 206 : CreateWin_EventGadget_206()
Case 207 : CreateWin_EventGadget_207()
Case 1003 : CreateWin_EventGadget_1003()
Case 2003 : CreateWin_EventGadget_2003()
Case 2004 : CreateWin_EventGadget_2004()
EndSelect
EndProcedure
;总的窗体关闭变事件
Procedure CreateWin_CloseWindow(WindowID)
OnErrorResume() ;出错继续运行程序
Select WindowID
Case 0
UseParserRes_SaveUIPrefs()
End
Case 100
CreateWin_EventGadget_1003()
Case 200
CreateWin_EventGadget_2004()
Default : CloseWindow(WindowID)
EndSelect
EndProcedure
;- 主程序---------------------------------------------------------------------
CreateWin_MainWindow(); 构建主窗体控件
Repeat
WinEventID = WaitWindowEvent() : WindowID = EventWindow()
If _IsCloseWin100 = #True And IsWindow(100)
CloseWindow(100)
DisableWindow(0, 0)
SetActiveWindow(0)
_IsCloseWin100 = #False
EndIf
If _IsCloseWin200 = #True And IsWindow(200)
CloseWindow(200)
DisableWindow(0, 0)
SetActiveWindow(0)
_IsCloseWin200 = #False
EndIf
Select WinEventID
Case #PB_Event_CloseWindow
CreateWin_CloseWindow(WindowID)
Case #PB_Event_SizeWindow
Case #PB_Event_Menu
Case #PB_Event_Gadget
CreateWin_EventGadget()
EndSelect
ForEver
© 版权声明
分享是一种美德,转载请保留原链接。
THE END
暂无评论内容