日期:2008-05-11  浏览次数:20464 次

用记事本打开modMain.bas文件,copy以下内容到其中:



Attribute VB_Name = "modMain"




' ==============================================

' 信息打包与展开 (启动模块)

'

' 功能 :利用系统所存在的资源自作压缩与解压缩程序

'

' 作 者 :谢家峰

' 整理日期 :2004-08-08

' Email :douhapy@sina.com

'

' ==============================================

'

Option Explicit



Public WindowsPath As String

Public WindowsSysPath As String



Sub Main()

Dim BootTrapPath As String

Dim SetupFilePath As String

Dim regExeFilePath As String



Dim regInfo() As String

Dim regStr() As String

Dim regFileName As String

Dim str As String



Dim resultat As Long

Dim resultat2 As Long

Dim res As Double

Dim startinfo As STARTUPINFO

Dim procinfo As PROCESS_INFORMATION

Dim secu As SECURITY_ATTRIBUTES



Dim i As Integer



If App.PrevInstance Then MsgBox "系统已启动!", , App.EXEName: End

'获得系统安装目录

WindowsPath = GetWindowsDir

WindowsSysPath = GetWindowsSysDir



Load frmMain

frmMain.Show

End Sub



用记事本打开modAPI.bas文件,copy以下内容到其中:



Attribute VB_Name = "modAPI"



' ==============================================

' 信息打包与展开 (所调用的API及通用函数模块)

'

' 功能 :利用系统所存在的资源自作压缩与解压缩程序

'

' 作 者 :谢家峰

' 整理日期 :2004-08-08

' Email :douhapy@sina.com

'

' ==============================================

'

Option Explicit



Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long

Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long



Public Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long

Public Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long



Public Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long

Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpbuffer As String, ByVal nSize As Long) As Long

Public Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpbuffer As String, ByVal nSize As Long) As Long