home *** CD-ROM | disk | FTP | other *** search
Wrap
Attribute VB_Name = "basCommon" Option Explicit Option Compare Text ' ' ╚½╛╓│ú╩² ' Global Const gstrNULL$ = "" ' ┐╒╫╓╖√┤« Global Const gstrSEP_DIR$ = "\" ' ─┐┬╝╖╓╕⌠╖√ Public Const gstrSEP_REGKEY$ = "\" ' ╫ó▓ß╣╪╝ⁿ╫╓╖╓╕⌠╖√ Global Const gstrSEP_DRIVE$ = ":" ' ╟²╢»╞≈╖╓╕⌠╖√,└²╚τ C:\ Global Const gstrSEP_DIRALT$ = "/" ' ▒╕╙├─┐┬╝╖╓╕⌠╖√ Global Const gstrSEP_EXT$ = "." ' ╬─╝■└⌐╒╣├√╖╓╕⌠╖√ Public Const gstrSEP_PROGID = "." Public Const gstrSEP_FILE$ = "|" ' ╬─╝■├√┴╨▒φ╓╨╡─╖╓╕⌠╖√ú¼╒Γ╩╟╥≥╬¬╦ⁿ╘┌╬─╝■├√╓╨▓╗╩╟╥╗╕÷╙╨╨º╫╓╖√íú Public Const gstrSEP_LIST = "|" Public Const gstrSEP_URL$ = "://" ' ╘┌ URL ╡╪╓╖╓╨╜╙╘┌ HPPT ╓«║≤╡─╖╓╕⌠╖√ Public Const gstrSEP_URLDIR$ = "/" ' ╘┌ URL ╡╪╓╖╓╨╗«╖╓─┐┬╝╡─╖╓╕⌠╖√íú Global Const gstrUNC$ = "\\" ' UNC ╦╡├≈╖√ \\ Global Const gstrCOLON$ = ":" Global Const gstrSwitchPrefix1 = "-" Global Const gstrSwitchPrefix2 = "/" Global Const gstrCOMMA$ = "," Global Const gstrDECIMAL$ = "." Global Const gstrQUOTE$ = """" Public Const gstrCCOMMENT$ = "//" ' C ╡╚╙∩╤╘╓╨╩╣╙├╡─╫ó╩═╦╡├≈╖√ Public Const gstrASSIGN$ = "=" Global Const gstrINI_PROTOCOL = "Protocol" Public Const gstrREMOTEAUTO = "RA" Public Const gstrDCOM = "DCOM" Global Const gintMAX_SIZE% = 255 ' ╫ε┤≤╗║│σ╟°┤≤╨í Global Const gintMAX_PATH_LEN% = 260 ' ╦∙╘╩╨φ╡─╫ε┤≤┬╖╛╢│ñ╢╚ú¼░ⁿ└¿ NT (Intel) ║═ Win95 ╡─┬╖╛╢íó╬─╝■├√ú¼ ' ║═├ⁿ┴ε╨╨▓╬╩²íú Global Const gintMAX_GROUPNAME_LEN% = 30 ' ╦∙╘╩╨φ╡─ NT 3.51 ╫Θ├√╡─╫ε┤≤│ñ╢╚íú Global Const gintMIN_BUTTONWIDTH% = 1200 Global Const gsngBUTTON_BORDER! = 1.4 Global Const intDRIVE_REMOVABLE% = 2 ' GetDriveType ╡─│ú╩² Global Const intDRIVE_FIXED% = 3 Global Const intDRIVE_REMOTE% = 4 Global Const intDRIVE_CDROM% = 5 Global Const intDRIVE_RAMDISK% = 6 Global Const gintNOVERINFO% = 32767 '▒Ω╓╛ú¼╓╕╩╛╬▐░µ▒╛╨┼╧ó '╬─╝■├√│╞ Global Const gstrFILE_SETUP$ = "SETUP.LST" '░▓╫░╨┼╧ó╬─╝■╡─├√│╞ Public Const gstrTEMP_DIR$ = "TEMP" Public Const gstrTMP_DIR$ = "TMP" '╬─╝■╡─ Share └α╨═║Ω Global Const mstrPRIVATEFILE = "" Global Const mstrSHAREDFILE = "$(Shared)" 'INI ╬─╝■╝ⁿ Global Const gstrINI_SETUP$ = "Setup" Global Const gstrINI_APPNAME$ = "Title" Global Const gstrINI_APPDIR$ = "DefaultDir" Global Const gstrINI_APPEXE$ = "AppExe" Public Const gstrINI_APPTOUNINSTALL = "AppToUninstall" Global Const gstrINI_APPPATH$ = "AppPath" Global Const gstrINI_FORCEUSEDEFDEST = "ForceUseDefDir" Global Const gstrINI_DEFGROUP$ = "DefProgramGroup" Public Const gstrEXT_DEP$ = "DEP" '░▓╫░╨┼╧ó╬─╝■║Ω Global Const gstrAPPDEST$ = "$(AppPath)" Global Const gstrWINDEST$ = "$(WinPath)" Global Const gstrWINSYSDEST$ = "$(WinSysPath)" Global Const gstrWINSYSDESTSYSFILE$ = "$(WinSysPathSysFile)" Global Const gstrPROGRAMFILES$ = "$(ProgramFiles)" Global Const gstrCOMMONFILES$ = "$(CommonFiles)" Global Const gstrCOMMONFILESSYS$ = "$(CommonFilesSys)" Global Const gstrDAODEST$ = "$(MSDAOPath)" Public Const gstrDONOTINSTALL$ = "$(DoNotInstall)" '╩≤▒Ω╓╕╒δ│ú╩² Global Const gintMOUSE_DEFAULT% = 0 Global Const gintMOUSE_HOURGLASS% = 11 'MsgError() │ú╩² Global Const MSGERR_ERROR = 1 Global Const MSGERR_WARNING = 2 'MsgBox │ú╩² Global Const MB_OK = 0 '╜÷í░╚╖╢¿í▒░┤┼Ñ Global Const MB_OKCANCEL = 1 'í░╚╖╢¿í▒║═í░╚í╧√í▒░┤┼Ñ Global Const MB_ABORTRETRYIGNORE = 2 'í░╓╨╓╣í▒íóí░╓╪╩╘í▒íóí░║÷┬╘í▒░┤┼Ñ Global Const MB_YESNO = 4 'í░╩╟í▒║═í░╖±í▒░┤┼Ñ Global Const MB_RETRYCANCEL = 5 'í░╓╪╩╘í▒║═í░╚í╧√í▒░┤┼Ñ Global Const MB_ICONSTOP = 16 '╤╧╓╪┤φ╬≤╧√╧ó Global Const MB_ICONQUESTION = 32 '╛»╕µ╤»╬╩ Global Const MB_ICONEXCLAMATION = 48 '╛»╕µ╧√╧ó Global Const MB_ICONINFORMATION = 64 '╨┼╧ó╧√╧ó Global Const MB_DEFBUTTON1 = 0 '╡┌╥╗╕÷░┤┼Ñ╩╟╚▒╩í╡─ Global Const MB_DEFBUTTON2 = 256 '╡┌╢■╕÷░┤┼Ñ╩╟╚▒╩í╡─ Global Const MB_DEFBUTTON3 = 512 '╡┌╚²╕÷░┤┼Ñ╩╟╚▒╩í╡─ 'MsgBox ╖╡╗╪╓╡ Global Const IDOK = 1 '░┤╧┬í░╚╖╢¿í▒░┤┼Ñ Global Const IDCANCEL = 2 '░┤╧┬í░╚í╧√í▒░┤┼Ñ Global Const IDABORT = 3 '░┤╧┬í░╓╨╓╣í▒░┤┼Ñ Global Const IDRETRY = 4 '░┤╧┬í░╓╪╩╘í▒░┤┼Ñ Global Const IDIGNORE = 5 '░┤╧┬í░║÷┬╘í▒░┤┼Ñ Global Const IDYES = 6 '░┤╧┬í░╩╟í▒░┤┼Ñ Global Const IDNO = 7 '░┤╧┬í░╖±í▒░┤┼Ñ ' '└α╨═╔∙├≈ ' Type OFSTRUCT cBytes As Byte fFixedDisk As Byte nErrCode As Integer nReserved1 As Integer nReserved2 As Integer szPathName As String * 256 End Type Type VERINFO '░µ▒╛ FIXEDFILEINFO strPad1 As Long '│Σ╠ε╜ß╣╣╡─░µ▒╛ strPad2 As Long '│Σ╠ε╜ß╣╣╡─▒Ω╓╛╫╓ nMSLo As Integer '░µ▒╛║┼╡─╡═╬╗╫╓ MS DWord nMSHi As Integer '░µ▒╛║┼╡─╕▀╬╗╫╓ MS DWord nLSLo As Integer '░µ▒╛║┼╡─╡═╬╗╫╓ LS DWord nLSHi As Integer '░µ▒╛║┼╡─╕▀╬╗╫╓ LS DWord strPad3(1 To 16) As Byte '╠°╣² VERINFO ╜ß╣╣╡─╥╗╨⌐╫╓╜┌ (16 ╫╓╜┌) FileOS As Long '╣╪╙┌▒╛╬─╝■├µ╧≥╡─▓┘╫≈╧╡═│╡─╨┼╧óíú strPad4(1 To 16) As Byte '│Σ╠ε VERINFO ╜ß╣╣╡─╞Σ╦√▓┐╖╓ (16 ╫╓╜┌) End Type Type PROTOCOL strName As String strFriendlyName As String End Type Type OSVERSIONINFO '╙├╙┌ GetVersionEx API ╡≈╙├ dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 End Type Global Const OF_EXIST& = &H4000& Global Const OF_SEARCH& = &H400& Global Const HFILE_ERROR% = -1 ' '╚½╛╓▒Σ┴┐ ' Global LF$ '╡Ñ╨╨╢╧┐¬ Global LS$ '╦½╨╨╢╧┐¬ Public CRLF As String ' ╗╪│╡/╗╗╨╨ ' ' ╙├╙┌░▓╛▓╡─║═ SMS ░▓╫░╡─╚½╛╓▒Σ┴┐ ' Public gfSilent As Boolean ' ╩╟╖±╒²╘┌╜°╨╨░▓╛▓╡─░▓╫░ Public gstrSilentLog As String ' ╘┌░▓╛▓╡─░▓╫░╓╨╩Σ│÷╡─╬─╝■├√ Public gfSMS As Boolean ' ╩╟╖±╒²╘┌╜°╨╨ SMS ░▓╛▓╡─░▓╫░ Public gstrMIFFile As String ' SMS ╡─╫┤╠¼╩Σ│÷╬─╝■ Public gfSMSStatus As Boolean ' SMS ░▓╫░╡─╫┤╠¼ Public gstrSMSDescription As String ' ╬¬ SMS ░▓╫░╢°╨┤╡╜ MIF ╬─╝■╡─├Φ╩÷╫╓╖√┤« Public gfNoUserInput As Boolean ' ╚τ╣√ gfSMS ╗≥ gfSilent ╬¬ True ╩▒╬¬ True Public gfDontLogSMS As Boolean ' ╠ß╣⌐▒╗╡╟┬╝╡╜ SMS ╡─ MsgFunc (└²╚τú¼╬¬╚╖╚╧╧√╧ó) Public Const MAX_SMS_DESCRIP = 255 ' SMS ▓╗╘╩╨φ├Φ╩÷╫╓╖√┤«│¼╣² 255 ╕÷╫╓╖√íú ' '┴╨│÷┐╔╙├╡─╨¡╥Θ ' Global gProtocol() As PROTOCOL Global gcProtocols As Integer ' ' ╨Φ╥¬ AXDist.exe ║═ wint351.exeíú ' ╒Γ╨⌐╩╟╫╘╜Γ╤╣╦⌡╡─┐╔╓┤╨╨╬─╝■ú¼░▓╫░╞Σ╦√▓╗╙╔ setup1 ░▓╫░╡─╬─╝■íú ' Public gfAXDist As Boolean Public Const gstrFILE_AXDIST = "AXDIST.EXE" Public gstrAXDISTInstallPath As String Public gfAXDistChecked As Boolean Public gfWINt351 As Boolean Public Const gstrFILE_WINT351 = "WINt351.EXE" Public gstrWINt351InstallPath As String Public gfWINt351Checked As Boolean ' '╬¬ 32 ╬╗░▓╫░╣ñ╛▀╡─ API/DLL ╔∙├≈ ' Declare Function DiskSpaceFree Lib "VB5STKIT.DLL" Alias "DISKSPACEFREE" () As Long Declare Function SetTime Lib "VB5STKIT.DLL" (ByVal strFileGetTime As String, ByVal strFileSetTime As String) As Integer Declare Function AllocUnit Lib "VB5STKIT.DLL" () As Long Declare Function GetWinPlatform Lib "VB5STKIT.DLL" () As Long Declare Function fNTWithShell Lib "VB5STKIT.DLL" () As Boolean Declare Function FSyncShell Lib "VB5STKIT.DLL" Alias "SyncShell" (ByVal strCmdLine As String, ByVal intCmdShow As Long) As Long Declare Function DLLSelfRegister Lib "VB5STKIT.DLL" (ByVal lpDllName As String) As Integer Declare Function GetClsidFromActXFile Lib "VB5STKIT.DLL" (ByVal pszFilename As String, ByVal pszProgID As String, ByVal pszClsid As String) As Long Declare Function RegisterTLB Lib "VB5STKIT.DLL" (ByVal lpTLBName As String) As Integer Declare Sub lmemcpy Lib "VB5STKIT.DLL" (strDest As Any, ByVal strSrc As Any, ByVal lBytes As Long) Declare Function OSfCreateShellGroup Lib "VB5STKIT.DLL" Alias "fCreateShellFolder" (ByVal lpstrDirName As String) As Long Declare Function OSfCreateShellLink Lib "VB5STKIT.DLL" Alias "fCreateShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String) As Long Declare Function OSfRemoveShellLink Lib "VB5STKIT.DLL" Alias "fRemoveShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String) As Long Private Declare Function OSGetLongPathName Lib "VB5STKIT.DLL" Alias "GetLongPathName" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Declare Function OpenFile Lib "kernel32" (ByVal lpFilename As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long Declare Function GetFullPathName Lib "kernel32" Alias "GetFullPathNameA" (ByVal lpFilename As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal lSize As Long, ByVal lpFilename As String) As Long Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As Any, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFilename As String) As Long Declare Function GetPrivateProfileSection Lib "kernel32" Alias "GetPrivateProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFilename As String) As Long Declare Function GetPrivateProfileSectionNames Lib "kernel32" Alias "GetPrivateProfileSectionNamesA" (ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFilename As String) As Long Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long Declare Function GetDriveType32 Lib "kernel32" Alias "GetDriveTypeA" (ByVal strWhichDrive As String) As Long Declare Function GetTempFilename32 Lib "kernel32" Alias "GetTempFileNameA" (ByVal strWhichDrive As String, ByVal lpPrefixString As String, ByVal wUnique As Integer, ByVal lpTempFilename As String) As Long Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Declare Function SendMessageString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long Public Const LB_FINDSTRINGEXACT = &H1A2 Public Const LB_ERR = (-1) Declare Function VerInstallFile Lib "VERSION.DLL" Alias "VerInstallFileA" (ByVal Flags&, ByVal SrcName$, ByVal DestName$, ByVal SrcDir$, ByVal DestDir$, ByVal CurrDir As Any, ByVal TmpName$, lpTmpFileLen&) As Long Declare Function GetFileVersionInfoSize Lib "VERSION.DLL" Alias "GetFileVersionInfoSizeA" (ByVal strFilename As String, lVerHandle As Long) As Long Declare Function GetFileVersionInfo Lib "VERSION.DLL" Alias "GetFileVersionInfoA" (ByVal strFilename As String, ByVal lVerHandle As Long, ByVal lcbSize As Long, lpvData As Byte) As Long Declare Function VerQueryValue Lib "VERSION.DLL" Alias "VerQueryValueA" (lpvVerData As Byte, ByVal lpszSubBlock As String, lplpBuf As Long, lpcb As Long) As Long Private Declare Function OSGetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long '----------------------------------------------------------- ' ╫╙│╠╨≥: AddDirSep ' ╠φ╝╙╥╗╕÷╬▓╦µ╡──┐┬╝┬╖╛╢╖╓╕⌠╖√ (╖┤╨▒╕▄) ╡╜┬╖╛╢├√─⌐╢╦ú¼│²╖╟╥╤╛¡┤µ╘┌╖╓╕⌠╖√ ' ' ╚δ┐┌/│÷┐┌: [strPathName] - ╥¬╠φ╝╙╖╓╕⌠╖√╡─┬╖╛╢ '----------------------------------------------------------- ' Sub AddDirSep(strPathName As String) If Right(Trim(strPathName), Len(gstrSEP_URLDIR)) <> gstrSEP_URLDIR And _ Right(Trim(strPathName), Len(gstrSEP_DIR)) <> gstrSEP_DIR Then strPathName = RTrim$(strPathName) & gstrSEP_DIR End If End Sub '----------------------------------------------------------- ' ╫╙│╠╨≥: AddURLDirSep ' ╠φ╝╙╥╗╕÷╬▓╦µ╡─ URL ┬╖╛╢╖╓╕⌠╖√ (╒²╨▒╕▄) ╡╜ URL ─⌐╢╦ú¼ ' │²╖╟╥╤╛¡┤µ╘┌╖╓╕⌠╖√ (╗≥╖┤╨▒╕▄) ' ' ╚δ┐┌/│÷┐┌: [strPathName] - ╥¬╠φ╝╙╖╓╕⌠╖√╡─┬╖╛╢ '----------------------------------------------------------- ' Sub AddURLDirSep(strPathName As String) If Right(Trim(strPathName), Len(gstrSEP_URLDIR)) <> gstrSEP_URLDIR And _ Right(Trim(strPathName), Len(gstrSEP_DIR)) <> gstrSEP_DIR Then strPathName = Trim(strPathName) & gstrSEP_URLDIR End If End Sub '----------------------------------------------------------- ' ║»╩²: FileExists ' ┼╨╢╧╩╟╖±┤µ╘┌╓╕╢¿╡─╬─╝■ ' ' ╚δ┐┌: [strPathName] - ╥¬╝∞▓Θ╡─╬─╝■ ' ' ╖╡╗╪: Trueú¼╚τ╣√╬─╝■┤µ╘┌ú╗╖±╘≥╬¬ False '----------------------------------------------------------- ' Function FileExists(ByVal strPathName As String) As Integer Dim intFileNum As Integer On Error Resume Next ' ' ╚τ╣√╥²╙├┴╦╫╓╖√┤«ú¼╔╛│²╥²╙├ ' strPathName = strUnQuoteString(strPathName) ' '╔╛│²╦∙╙╨╬▓╦µ╡──┐┬╝╖╓╕⌠╖√ ' If Right$(strPathName, 1) = gstrSEP_DIR Then strPathName = Left$(strPathName, Len(strPathName) - 1) End If ' '╩╘═╝┤≥┐¬╬─╝■ú¼▒╛║»╩²╡─╖╡╗╪╓╡╬¬ False '╚τ╣√┤≥┐¬╩▒│÷┤φú¼╖±╘≥╬¬ True ' intFileNum = FreeFile Open strPathName For Input As intFileNum FileExists = IIf(Err = 0, True, False) Close intFileNum Err = 0 End Function '----------------------------------------------------------- ' ║»╩²: DirExists ' ' ┼╨╢╧╩╟╖±┤µ╘┌╓╕╢¿╡──┐┬╝├√íú ' ▒╛║»╩²╙├╙┌ (└²╚τ) ═¿╣²┤½╡▌╡─╚τ 'A:\'ú¼┼╨╢╧░▓╫░╚φ┼╠╩╟╖±╘┌╟²╢»╞≈╓╨íú ' ' ╚δ┐┌: [strDirName] - ╥¬╝∞▓Θ╡──┐┬╝├√ ' ' ╖╡╗╪: Trueú¼╚τ╣√─┐┬╝┤µ╘┌ú╗╖±╘≥╬¬ False '----------------------------------------------------------- ' Public Function DirExists(ByVal strDirName As String) As Integer Const strWILDCARD$ = "*.*" Dim strDummy As String On Error Resume Next AddDirSep strDirName strDummy = Dir$(strDirName & strWILDCARD, vbDirectory) DirExists = Not (strDummy = gstrNULL) Err = 0 End Function '----------------------------------------------------------- ' ║»╩²: GetDriveType ' ═¿╣²╡≈╙├ Windows GetDriveType()ú¼┼╨╢╧┤┼┼╠╩╟╖±╣╠╢¿┼╠ú¼╩╟╖±┐╔╥╞╢»┼╠ú¼╡╚╡╚íú '----------------------------------------------------------- ' Function GetDriveType(ByVal intDriveNum As Integer) As Integer ' ' ▒╛║»╩²╘┌ Win16 ╓╨╨Φ╥¬▒φ╩╛╟²╢»╞≈║┼╡─╒√╩²ú¼╘┌ Win32 ╓╨╨Φ╥¬╫╓╖√┤« ' Dim strDriveName As String strDriveName = Chr$(Asc("A") + intDriveNum) & gstrSEP_DRIVE & gstrSEP_DIR GetDriveType = CInt(GetDriveType32(strDriveName)) End Function '----------------------------------------------------------- ' ║»╩²: ReadProtocols ' ┤╙╓╕╢¿╬─╝■╓╨╢┴╚í┐╔╚▌╨φ╡─╨¡╥Θíú ' ' ╚δ┐┌: [strInputFilename] - INI ╬─╝■├√ú¼┤╙╓╨╢┴╚í╨¡╥Θ ' [strINISection] - INI ╜┌╡─├√│╞ '----------------------------------------------------------- Function ReadProtocols(ByVal strInputFilename As String, ByVal strINISection As String) As Boolean Dim intIdx As Integer Dim fOk As Boolean Dim strInfo As String Dim intOffset As Integer intIdx = 0 fOk = True Erase gProtocol gcProtocols = 0 Do strInfo = ReadIniFile(strInputFilename, strINISection, gstrINI_PROTOCOL & Format$(intIdx + 1)) If strInfo <> gstrNULL Then intOffset = InStr(strInfo, gstrCOMMA) If intOffset > 0 Then '"│≤┬¬" ├√╜½╩╫╧╚│÷╧╓ ReDim Preserve gProtocol(intIdx + 1) gcProtocols = intIdx + 1 gProtocol(intIdx + 1).strName = Left$(strInfo, intOffset - 1) '... ╜╙╫┼╩╟í░╙╤║├í▒├√ gProtocol(intIdx + 1).strFriendlyName = Mid$(strInfo, intOffset + 1) If (gProtocol(intIdx + 1).strName = "") Or (gProtocol(intIdx + 1).strFriendlyName = "") Then fOk = False End If Else fOk = False End If If Not fOk Then Exit Do Else intIdx = intIdx + 1 End If End If Loop While strInfo <> gstrNULL ReadProtocols = fOk End Function '----------------------------------------------------------- ' ║»╩²: ResolveResString ' ╢┴╚í╫╩╘┤▓ó╙├╕°╢¿╓╡╠µ╗╗╕°╢¿║Ω ' ' └²╚τú¼╕°╢¿╥╗╕÷╫╩╘┤║┼ 14: ' "╬▐╖¿╢┴╚í╟²╢»╞≈ |2 ╓╨╡─ '|1'" ' ╡≈╙├ ResolveResString(14, "|1", "TXTFILE.TXT", "|2", "A:") ' ╜½╖╡╗╪╫╓╖√┤« "╬▐╖¿╢┴╚í╟²╢»╞≈ A:╓╨╡─ 'TXTFILE.TXT'╬─╝■" ' ' ╚δ┐┌: [resID] - ╫╩╘┤▒Ω╩╢╖√ ' [varReplacements] - │╔╢╘╡─║Ω/╠µ╗╗╓╡ '----------------------------------------------------------- ' Public Function ResolveResString(ByVal resID As Integer, ParamArray varReplacements() As Variant) As String Dim intMacro As Integer Dim strResString As String strResString = LoadResString(resID) ' For each ╤¡╗╖╢┴╚δ│╔╢╘╡─║Ω/╓╡... For intMacro = LBound(varReplacements) To UBound(varReplacements) Step 2 Dim strMacro As String Dim strValue As String strMacro = varReplacements(intMacro) On Error GoTo MismatchedPairs strValue = varReplacements(intMacro + 1) On Error GoTo 0 ' ╦∙╙╨│÷╧╓╡─ strMacro ╠µ╗╗╬¬ strValue Dim intPos As Integer Do intPos = InStr(strResString, strMacro) If intPos > 0 Then strResString = Left$(strResString, intPos - 1) & strValue & Right$(strResString, Len(strResString) - Len(strMacro) - intPos + 1) End If Loop Until intPos = 0 Next intMacro ResolveResString = strResString Exit Function MismatchedPairs: Resume Next End Function '----------------------------------------------------------- ' ╫╙│╠╨≥: GetLicInfoFromVBL ' ╖╓╬÷ VBL ╬─╝■├√▓ó│Θ╚í╫ó▓ß▒φ╡─╨φ┐╔╓ñ║┼╝░╨φ┐╔╓ñ╨┼╧óíú ' ' ╚δ┐┌: [strVBLFile] - ▒╪╨δ╩╟╙╨╨º╡─ VBLíú ' ' │÷┐┌: [strLicKey] - ╨┤╨φ┐╔╓ñ╨┼╧ó╡─╫ó▓ß▒φ╣╪╝ⁿ╫╓íú ' ╕├╣╪╝ⁿ╫╓╜½▒╗╠φ╝╙╡╜ HKEY_CLASSES_ROOT\Licenses ╓╨íú╒Γ╩╟╓╕─╧íú ' │÷┐┌: [strLicVal] - ╨φ┐╔╓ñ╨┼╧óíú═¿│ú╥╘╛▀╙╨╥■║¼╫╓╖√╡─╫╓╖√┤«╡─╨╬╩╜│÷╧╓íú '----------------------------------------------------------- ' Public Sub GetLicInfoFromVBL(strVBLFile As String, strLicKey As String, strLicVal As String) Dim fn As Integer Const strREGEDIT = "REGEDIT" Const strLICKEYBASE = "HKEY_CLASSES_ROOT\Licenses\" Dim strTemp As String Dim posEqual As Integer Dim fLicFound As Boolean fn = FreeFile Open strVBLFile For Input Access Read Lock Read Write As #fn ' ' ╢┴╬─╝■ú¼╓▒╡╜╒╥╡╜╥╗╨╨ strLICKEYBASE ╥╘┐¬╩╝íú ' fLicFound = False Do While Not EOF(fn) Line Input #fn, strTemp strTemp = Trim(strTemp) If Left$(strTemp, Len(strLICKEYBASE)) = strLICKEYBASE Then ' ' ╥╤╛¡╗±╡├╦∙╨Φ╨╨íú ' fLicFound = True Exit Do End If Loop Close fn If fLicFound Then ' ' ╖╓╬÷╕├╨╨╓╨╡─╩²╛▌ú¼╖╓└δ╣╪╝ⁿ╫╓╙δ╨φ┐╔╓ñ╨┼╧óíú ' ╕├╨╨╕±╩╜╚τ╧┬ú║ ' "HKEY_CLASSES_ROOT\Licenses\<lickey> = <licval>" ' posEqual = InStr(strTemp, gstrASSIGN) If posEqual > 0 Then strLicKey = Mid$(Trim(Left$(strTemp, posEqual - 1)), Len(strLICKEYBASE) + 1) strLicVal = Trim(Mid$(strTemp, posEqual + 1)) End If Else strLicKey = gstrNULL strLicVal = gstrNULL End If End Sub '----------------------------------------------------------- ' ║»╩² GetLongPathName ' ' ╝∞╦≈╥╗╕÷┐╔─▄░ⁿ║¼╢╠╡─╫╙─┐┬╝║═╬─╝■├√╡─┬╖╛╢╡─│ñ┬╖╛╢├√░µ▒╛ '----------------------------------------------------------- ' Function GetLongPathName(ByVal strShortPath As String) As String Const cchBuffer = 300 Dim strLongPath As String Dim lResult As Long On Error GoTo 0 strLongPath = String(cchBuffer, Chr$(0)) lResult = OSGetLongPathName(strShortPath, strLongPath, cchBuffer) If lResult = 0 Then Error 53 ' ╬─╝■╬┤╒╥╡╜ Else GetLongPathName = StripTerminator(strLongPath) End If End Function '----------------------------------------------------------- ' ║»╩² GetShortPathName ' ' ╝∞╦≈╥╗╕÷┐╔─▄░ⁿ║¼│ñ╡─╫╙─┐┬╝║═╬─╝■├√╡─┬╖╛╢╡─╢╠┬╖╛╢├√░µ▒╛ '----------------------------------------------------------- ' Function GetShortPathName(ByVal strLongPath As String) As String Const cchBuffer = 300 Dim strShortPath As String Dim lResult As Long On Error GoTo 0 strShortPath = String(cchBuffer, Chr$(0)) lResult = OSGetShortPathName(strLongPath, strShortPath, cchBuffer) If lResult = 0 Then Error 53 ' ╬─╝■╬┤╒╥╡╜ Else GetShortPathName = StripTerminator(strShortPath) End If End Function '----------------------------------------------------------- ' ║»╩²: GetTempFilename ' ╬¬╓╕╢¿╡─╟²╢»╞≈║═╬─╝■├√╟░╫║╗±╚í╥╗╕÷┴┘╩▒╬─╝■├√ ' ▓╬╩²: ' strDestPath - ┤┤╜¿┴┘╩▒╬─╝■╡─╬╗╓├íú╚τ╣√╩╟┐╒╫╓╖√┤«ú¼╜½╩╣╙├╙╔╗╖╛│▒Σ┴┐ tmp ╗≥ temp ╓╕╢¿╡─╬╗╓├íú ' lpPrefixString - ╫╓╖√┤«╡─╟░╚²╕÷╫╓╖√╜½╫≈╬¬┴┘╩▒╬─╝■├√╡─╥╗▓┐╖╓╖╡╗╪íú ' wUnique - ╔Φ╬¬ 0ú¼┤┤╜¿╬¿╥╗╡─╬─╝■├√íú╥▓┐╔╥╘╔Φ╬¬╒√╩²ú¼╘┌╒Γ╓╓╟Θ┐÷╧┬ú¼╖╡╗╪ tmp ╬─╝■├√ú¼ ' ╒Γ╕÷╒√╩²╫≈╬¬╬─╝■├√╡─╥╗▓┐╖╓íú ' lpTempFilename - ┴┘╩▒╬─╝■├√╫≈╬¬▒Σ┴┐╖╡╗╪íú ' ╖╡╗╪: ' Trueú¼╚τ╣√╡≈╙├│╔╣ªú╗╖±╘≥╬¬ false '----------------------------------------------------------- ' Function GetTempFilename(ByVal strDestPath As String, ByVal lpPrefixString As String, ByVal wUnique As Integer, lpTempFilename As String) As Boolean If strDestPath = gstrNULL Then ' ' ├╗╙╨╓╕╢¿─┐▒Ωú¼╩╣╙├ temp ─┐┬╝íú ' strDestPath = String(gintMAX_PATH_LEN, vbNullChar) If GetTempPath(gintMAX_PATH_LEN, strDestPath) = 0 Then GetTempFilename = False Exit Function End If End If lpTempFilename = String(gintMAX_PATH_LEN, vbNullChar) GetTempFilename = GetTempFilename32(strDestPath, lpPrefixString, wUnique, lpTempFilename) > 0 lpTempFilename = StripTerminator(lpTempFilename) End Function '----------------------------------------------------------- ' ║»╩²: GetDefMsgBoxButton ' ╜Γ┬δ┤½╡▌╡╜ MsgBox ║»╩²╡─▒Ω╓╛ú¼╛÷╢¿╚▒╩í░┤┼Ñ╩╟╩▓├┤íú╙├╙┌░▓╛▓╡─░▓╫░íú ' ' ╚δ┐┌: [intFlags] - ┤½╡▌╡╜ MsgBox ╡─▒Ω╓╛ ' ' ╖╡╗╪: VB ╕°░┤┼Ñ╢¿╥σ║┼ ' vbOK 1 ░┤╧┬í░╚╖╢¿í▒░┤┼Ñíú ' vbCancel 2 ░┤╧┬í░╚í╧√í▒░┤┼Ñíú ' vbAbort 3 ░┤╧┬í░╓╨╓╣í▒░┤┼Ñíú ' vbRetry 4 ░┤╧┬í░╓╪╩╘í▒░┤┼Ñíú ' vbIgnore 5 ░┤╧┬í░║÷┬╘í▒░┤┼Ñíú ' vbYes 6 ░┤╧┬í░╩╟í▒░┤┼Ñíú ' vbNo 7 ░┤╧┬í░╖±í▒░┤┼Ñíú '----------------------------------------------------------- ' Function GetDefMsgBoxButton(intFlags) As Integer ' ' ╩╫╧╚┼╨╢╧╧√╧ó┐≥╓╨╚▒╩í░┤┼Ñ╡─╨≥║┼íú ' Dim intButtonNum As Integer Dim intDefButton As Integer If (intFlags And vbDefaultButton2) = vbDefaultButton2 Then intButtonNum = 2 ElseIf (intFlags And vbDefaultButton3) = vbDefaultButton3 Then intButtonNum = 3 Else intButtonNum = 1 End If ' ' ┼╨╢╧╒²╘┌┤ª└φ╡─╧√╧ó┐≥└α╨═▓ó╖╡╗╪╚▒╩í░┤┼Ñíú ' If (intFlags And vbRetryCancel) = vbRetryCancel Then intDefButton = IIf(intButtonNum = 1, vbRetry, vbCancel) ElseIf (intFlags And vbYesNoCancel) = vbYesNoCancel Then Select Case intButtonNum Case 1 intDefButton = vbYes Case 2 intDefButton = vbNo Case 3 intDefButton = vbCancel '╜ß╩° Case End Select ElseIf (intFlags And vbOKCancel) = vbOKCancel Then intDefButton = IIf(intButtonNum = 1, vbOK, vbCancel) ElseIf (intFlags And vbAbortRetryIgnore) = vbAbortRetryIgnore Then Select Case intButtonNum Case 1 intDefButton = vbAbort Case 2 intDefButton = vbRetry Case 3 intDefButton = vbIgnore '╜ß╩° Case End Select ElseIf (intFlags And vbYesNo) = vbYesNo Then intDefButton = IIf(intButtonNum = 1, vbYes, vbNo) Else intDefButton = vbOK End If GetDefMsgBoxButton = intDefButton End Function '----------------------------------------------------------- ' ║»╩²: GetDiskSpaceFree ' ╗±╚í╓╕╢¿╟²╢»╞≈╡─╩ú╙α┤┼┼╠┐╒╝Σíú ' ' ╚δ┐┌: [strDrive] - ╨Φ╝∞▓Θ┤┼┼╠┐╒╝Σ╡─╟²╢»╞≈ ' ' ╖╡╗╪: ╩ú╙α┤┼┼╠┐╒╝Σ┴┐ú¼│÷┤φ╘≥╖╡╗╪ -1 '----------------------------------------------------------- ' Function GetDiskSpaceFree(ByVal strDrive As String) As Long Dim strCurDrive As String Dim lDiskFree As Long On Error Resume Next ' '▒ú┤µ╡▒╟░╟²╢»╞≈ ' strCurDrive = Left$(CurDir$, 2) ' '╒√└φ╟²╢»╞≈╕±╩╜ú¼╩╣╓«╓╗░ⁿ└¿╥╗╕÷▒φ╩╛╡─╟²╢»╞≈╫╓─╕║═╥╗╕÷├░║┼ ' If InStr(strDrive, gstrSEP_DRIVE) = 0 Or Len(strDrive) > 2 Then strDrive = Left$(strDrive, 1) & gstrSEP_DRIVE End If ' '╟╨╗╗╡╜╨Φ╝∞▓Θ┤┼┼╠┐╒╝Σ╡─╟²╢»╞≈íú 'API ║»╩² DiskSpaceFree() ╓╗╣ñ╫≈╙┌╡▒╟░╟²╢»╞≈íú ' ChDrive strDrive ' '╚τ╣√▓╗─▄╟╨╗╗╡╜╦∙╨Φ╡─╟²╢»╞≈ú¼╘≥╬¬│÷┤φú¼╖±╘≥╖╡╗╪╩ú╙α┤┼┼╠┐╒╝Σ┴┐ ' If Err <> 0 Or (strDrive <> Left$(CurDir$, 2)) Then lDiskFree = -1 Else lDiskFree = DiskSpaceFree() If Err <> 0 Then '╚τ╣√╒╥▓╗╡╜░▓╫░╣ñ╛▀░ⁿ╡─ DLL lDiskFree = -1 End If End If If lDiskFree = -1 Then MsgError Error$ & LS$ & ResolveResString(resDISKSPCERR) & strDrive, MB_ICONEXCLAMATION, gstrTitle End If GetDiskSpaceFree = lDiskFree ' '╜½╡▒╟░╟²╢»╞≈╔Φ╗╪╘¡╩╝╡─ú¼╟σ│² ' ChDrive strCurDrive Err = 0 End Function '----------------------------------------------------------- ' ║»╩²: GetUNCShareName ' ' ╕°╢¿ UNC ├√│╞ú¼╖╡╗╪─┐┬╝╡─▒φ╩╛╗·╞≈├√║═╣▓╧φ├√╡─╫ε╫≤▒▀╡─▓┐╖╓íú ' └²╚τú¼╕°╢¿ "\\SCHWEIZ\PUBLIC\APPS\LISTING.TXT"ú¼╖╡╗╪╫╓╖√┤«"\\SCHWEIZ\PUBLIC" ' ' ╚τ╣√┬╖╛╢├√╙╨╨ºú¼╖╡╗╪▒φ╩╛╗·╞≈├√║═╣▓╧φ├√╡─╫╓╖√┤«ú¼╖±╘≥╖╡╗╪ NULL '----------------------------------------------------------- ' Function GetUNCShareName(ByVal strFN As String) As Variant GetUNCShareName = Null If IsUNCName(strFN) Then Dim iFirstSeparator As Integer iFirstSeparator = InStr(3, strFN, gstrSEP_DIR) If iFirstSeparator > 0 Then Dim iSecondSeparator As Integer iSecondSeparator = InStr(iFirstSeparator + 1, strFN, gstrSEP_DIR) If iSecondSeparator > 0 Then GetUNCShareName = Left$(strFN, iSecondSeparator - 1) Else GetUNCShareName = strFN End If End If End If End Function '----------------------------------------------------------- ' ║»╩²: GetWindowsSysDir ' ' ╡≈╙├ windows API ║»╩²╗±╚í windows\SYSTEM ─┐┬╝▓ó▒ú╓ñ┤µ╘┌╥╗╕÷╬▓╦µ╡──┐┬╝╖╓╕⌠╖√ ' ' ╖╡╗╪: windows\SYSTEM ─┐┬╝ '----------------------------------------------------------- ' Function GetWindowsSysDir() As String Dim strBuf As String strBuf = Space$(gintMAX_SIZE) ' '╗±╚í system ─┐┬╝▓ó╡≈╒√╗║│σ╟°╡╜╖╡╗╪╡─╚╖╩╡│ñ╢╚ú¼╚τ╣√├╗╙╨╖╡╗╪─┐┬╝╖╓╕⌠╖√(\)ú¼╝╙╥╗╕÷ ' If GetSystemDirectory(strBuf, gintMAX_SIZE) > 0 Then strBuf = StripTerminator(strBuf) AddDirSep strBuf GetWindowsSysDir = strBuf Else GetWindowsSysDir = gstrNULL End If End Function '----------------------------------------------------------- ' ╫╙│╠╨≥: TreatAsWin95 ' ' ╖╡╗╪ Trueú¼╚τ╣√╘╦╨╨╙┌ Windows 95 ╗≥╒Γ╥╗░µ▒╛╡─ NTú¼ ' ║├╧≤╦ⁿ╩╟╬¬╫ó▓ß▒φíó╙ª╙├│╠╨≥╡╟┬╝╥╘╝░╔╛│²─┐╡─╡─ Windows 95íú '----------------------------------------------------------- ' Function TreatAsWin95() As Boolean If IsWindows95() Then TreatAsWin95 = True ElseIf fNTWithShell() Then TreatAsWin95 = True Else TreatAsWin95 = False End If End Function '----------------------------------------------------------- ' ║»╩²: IsDepFile ' ' ╚τ╣√┤½╡▌╡╜╒Γ╕÷╫╙│╠╨≥╡─╬─╝■╩╟┤╙╩⌠╬─╝■ (*.dep)ú¼╖╡╗╪ trueíú ' ╫÷│÷╒Γ╓╓┼╨╢╧╗∙╙┌╚╖╚╧╬─╝■└⌐╒╣├√╩╟ .dep ╥╘╝░╦ⁿ╦∙░ⁿ║¼╡─░µ▒╛╨┼╧óíú '----------------------------------------------------------- ' Function fIsDepFile(strFilename As String) As Boolean Const strEXT_DEP = "DEP" fIsDepFile = False If UCase(Extension(strFilename)) = strEXT_DEP Then If GetFileVersion(strFilename) <> gstrNULL Then fIsDepFile = True End If End If End Function '----------------------------------------------------------- ' ║»╩²: IsWin32 ' ' ╚τ╣√│╠╨≥╘╦╨╨╙┌ Win32 (╝┤╚╬║╬ 32 ╬╗▓┘╫≈╧╡═│)ú¼╖╡╗╪ true '----------------------------------------------------------- ' Function IsWin32() As Boolean IsWin32 = (IsWindows95() Or IsWindowsNT()) End Function '----------------------------------------------------------- ' ║»╩²: IsWindows95 ' ' ╚τ╣√│╠╨≥╘╦╨╨╙┌ Windows 95 ╗≥║≤╨°░µ▒╛ú¼╖╡╗╪ true '----------------------------------------------------------- ' Function IsWindows95() As Boolean Const dwMask95 = &H2& If GetWinPlatform() And dwMask95 Then IsWindows95 = True Else IsWindows95 = False End If End Function '----------------------------------------------------------- ' ║»╩²: IsWindowsNT ' ' ╚τ╣√│╠╨≥╘╦╨╨╙┌ Windows NTú¼╖╡╗╪ true '----------------------------------------------------------- ' Function IsWindowsNT() As Boolean Const dwMaskNT = &H1& If GetWinPlatform() And dwMaskNT Then IsWindowsNT = True Else IsWindowsNT = False End If End Function '----------------------------------------------------------- ' ║»╩²: IsWindowsNT4WithoutSP2 ' ' ┼╨╢╧╩╟╖±╙├╗º╘╦╨╨╙┌ Windows NT 4.0ú¼╡½├╗╙╨ Service Pack 2 (SP2)íú ' ╚τ╣√╘╦╨╨╙┌╞Σ╦√╚╬║╬╞╜╠¿ú¼╖╡╗╪ Falseíú ' ' ╚δ┐┌: [╬▐] ' ' ╖╡╗╪: Trueú¼╚τ╣√╓╗╘╦╨╨╙┌ Windows NT 4.0 ╢°├╗╙╨░▓╫░ Service Pack 2íú '----------------------------------------------------------- ' Function IsWindowsNT4WithoutSP2() As Boolean IsWindowsNT4WithoutSP2 = False If Not IsWindowsNT() Then Exit Function End If Dim osvi As OSVERSIONINFO Dim strCSDVersion As String osvi.dwOSVersionInfoSize = Len(osvi) If GetVersionEx(osvi) = 0 Then Exit Function End If strCSDVersion = StripTerminator(osvi.szCSDVersion) '╩╟ Windows NT 4.0 ┬≡ú┐ Const NT4MajorVersion = 4 Const NT4MinorVersion = 0 If (osvi.dwMajorVersion <> NT4MajorVersion) Or (osvi.dwMinorVersion <> NT4MinorVersion) Then '▓╗ú¼╖╡╗╪ Falseíú Exit Function End If '╚τ╣√├╗╙╨░▓╫░ service packú¼╗≥░▓╫░┴╦ service Pack 1ú¼╖╡╗╪ Trueíú Const strSP1 = "SERVICE PACK 1" If strCSDVersion = "" Then IsWindowsNT4WithoutSP2 = True '├╗╙╨░▓╫░ service pack ElseIf strCSDVersion = strSP1 Then IsWindowsNT4WithoutSP2 = True '╓╗░▓╫░┴╦ SP1 End If End Function '----------------------------------------------------------- ' ║»╩²: IsUNCName ' ' ┼╨╢╧╓╕╢¿╡─┬╖╛╢├√╩╟╖±╩╟ UNC ├√íú ' UNC (═¿╙├╡─├ⁿ├√╘╝╢¿) ├√═¿│ú╙├╙┌╓╕╢¿╗·╞≈╫╩╘┤ú¼╚τ╘╢│╠═°┬τ╣▓╧φíó├ⁿ├√╣▄╡└╡╚íú ' ╥╗╕÷ UNC ├√╡─└²╫╙╩╟ "\\SERVER\SHARE\FILENAME.EXT"íú ' ' ╚δ┐┌: [strPathName] - ╥¬╝∞▓Θ╡─┬╖╛╢├√ ' ' ╖╡╗╪: Trueú¼╚τ╣√┬╖╛╢├√╩╟ UNC ├√ú¼╖±╘≥╬¬ False '----------------------------------------------------------- ' Function IsUNCName(ByVal strPathName As String) As Integer Const strUNCNAME$ = "\\//\" '╦∙╥╘┐╔╥╘╝∞▓Θ \\, //, \/, /\ IsUNCName = ((InStr(strUNCNAME, Left$(strPathName, 2)) > 0) And _ (Len(strPathName) > 1)) End Function '----------------------------------------------------------- ' ║»╩²: LogSilentMsg ' ' ╚τ╣√╩╟░▓╛▓╡─░▓╫░ú¼▒╛╫╙│╠╨≥╨┤╥╗╠⌡╧√╧ó╡╜╬─╝■ gstrSilentLogíú ' ' ╚δ┐┌: [strMsg] - ╧√╧ó ' ' ═¿│ú╡╪ú¼╘┌╧▀╡≈╙├▒╛╫╙│╠╨≥╧╘╩╛╥╗╕÷ MsgBoxú¼strMsg ╙δ╜½╘┌ MsgBox ╓╨╧╘╩╛╡─╧√╧ó╥╗╤∙íú ' (╫ó╥Γ: ╝╠╨°╓º│╓í░░▓╛▓í▒─ú╩╜┬≡ú┐ Rick Andrews) '----------------------------------------------------------- ' Sub LogSilentMsg(strMsg As String) If Not gfSilent Then Exit Sub Dim fn As Integer On Error Resume Next fn = FreeFile Open gstrSilentLog For Append As fn Print #fn, strMsg Close fn Exit Sub End Sub '----------------------------------------------------------- ' ║»╩²: LogSMSMsg ' ' ╚τ╣√╩╟ SMS ░▓╫░ú¼▒╛╫╙│╠╨≥╠φ╝╙╥╗╕÷╧√╧ó╡╜ gstrSMSDescription ╫╓╖√┤«íú ' ╡▒░▓╫░═Ω│╔╓«║≤(│╔╣ª╗≥╩º░▄)ú¼╒Γ╕÷╫╓╖√┤«╔╘║≤╜½▒╗╨┤╡╜╫┤╠¼╬─╝■ (*.MIF) ╓╨íú ' ' ╫ó╥Γú¼╚τ╣√ gfSMS = Falseú¼, ╘≥╩╟├╗╙╨╡╟┬╝╧√╧óíú ' ╥≥┤╦ú¼╥¬▒ú╗ñ─│╨⌐╧√╧ó▓╗▒╗╡╟┬╝(╚τ ╜÷╚╖╚╧╧√╧ó)ú¼┴┘╩▒╡╪╔Φ gfSMS = Falseíú ' ' ╚δ┐┌: [strMsg] - ╧√╧ó ' ' ═¿│ú╡╪ú¼╘┌╧▀╡≈╙├▒╛╫╙│╠╨≥╧╘╩╛╥╗╕÷ MsgBoxú¼strMsg ╙δ╜½╘┌ MsgBox ╓╨╧╘╩╛╡─╧√╧ó╥╗╤∙íú '----------------------------------------------------------- ' Sub LogSMSMsg(strMsg As String) If Not gfSMS Then Exit Sub ' ' ╫╖╝╙╒Γ╕÷╧√╧óíú╫ó╥Γú¼╫▄│ñ╢╚▓╗─▄│¼╣² 255 ╕÷╫╓╖√ú¼╦∙╥╘╜╪╢╧│¼│ñ╡─╦∙╙╨▓┐╖╓íú ' gstrSMSDescription = Left(gstrSMSDescription & strMsg, MAX_SMS_DESCRIP) End Sub '----------------------------------------------------------- ' ║»╩²: MakePathAux ' ' ┤┤╜¿╓╕╢¿╡──┐┬╝┬╖╛╢íú ' ' ╚τ╣√╙÷╡╜┤φ╬≤ú¼╘≥├╗╙╨╙├╗º╜╗╗Ñ╖ó╔·íú ' ╚τ╣√╧ú═√╙├╗º╜╗╗Ñú¼╩╣╙├╧α╣╪║»╩² MakePathAux()íú ' ' ╚δ┐┌: [strDirName] - ╥¬╔·│╔╡──┐┬╝┬╖╛╢ ' ' ╖╡╗╪: Trueú¼╚τ╣√│╔╣ªú╗╚τ╣√│÷┤φú¼╖╡╗╪ Falseíú '----------------------------------------------------------- ' Function MakePathAux(ByVal strDirName As String) As Boolean Dim strPath As String Dim intOffset As Integer Dim intAnchor As Integer Dim strOldPath As String On Error Resume Next ' '╠φ╝╙╬▓╦µ╡─╖┤╨▒╕▄ ' If Right$(strDirName, 1) <> gstrSEP_DIR Then strDirName = strDirName & gstrSEP_DIR End If strOldPath = CurDir$ MakePathAux = False intAnchor = 0 ' '╤¡╗╖▓ó╩╣├┐╕÷╫╙─┐┬╝╕≈╫╘╢└┴óíú ' intOffset = InStr(intAnchor + 1, strDirName, gstrSEP_DIR) intAnchor = intOffset '┤╙╓┴╔┘╥╗╕÷╖┤╨▒╕▄┤ª┐¬╩╝ú¼╝┤ "C:\FirstDir" Do intOffset = InStr(intAnchor + 1, strDirName, gstrSEP_DIR) intAnchor = intOffset If intAnchor > 0 Then strPath = Left$(strDirName, intOffset - 1) ' ┼╨╢╧╒Γ╕÷─┐┬╝╩╟╖±╥╤╛¡┤µ╘┌ Err = 0 ChDir strPath If Err Then ' ▒╪╨δ┤┤╜¿╒Γ╕÷─┐┬╝ Err = 0 #If LOGGING Then NewAction gstrKEY_CREATEDIR, """" & strPath & """" #End If MkDir strPath #If LOGGING Then If Err Then LogError ResolveResString(resMAKEDIR) & " " & strPath AbortAction GoTo Done Else CommitAction End If #End If End If End If Loop Until intAnchor = 0 MakePathAux = True Done: ChDir strOldPath Err = 0 End Function '----------------------------------------------------------- ' ║»╩²: MsgError ' ' ╟┐╓╞╩≤▒Ω╓╕╒δ╬¬╚▒╩í└α╨═ú¼╡≈╙├ VB ╡─ MsgBox ║»╩²ú¼ ' ╡╟┬╝╒Γ╕÷┤φ╬≤ú¼▓ó(╜÷ 32 ╬╗)╨┤╧┬╧√╧ó║═╙├╗º╧∞╙ª╡─╚╒╓╛╬─╝■(╜÷ 32 ╬╗)íú ' ' ╚δ┐┌: [strMsg] - ╥¬╧╘╩╛╡─╧√╧ó ' [intFlags] - MsgBox ║»╩²└α╨═▒Ω╓╛ ' [strCaption] - ╬¬╧√╧ó┐≥╩╣╙├╡─▒Ω╠Γ ' [intLogType] (┐╔╤í╡─) - ╔·│╔╡─╚╒╓╛╬─╝■╧ε└α╨═íú ' ╚▒╩í╡╪ú¼┤┤╜¿╥╗╕÷┤φ╬≤╧εíú╙├║»╩²┤┤╜¿╛»╕µíú ' ╙╨╨º└α╨═╬¬ú║MSGERR_ERROR ║═ MSGERR_WARNING ' ' ╖╡╗╪: MsgBox ║»╩²╡─╜ß╣√ '----------------------------------------------------------- ' Function MsgError(ByVal strMsg As String, ByVal intFlags As Integer, ByVal strCaption As String, Optional ByVal intLogType As Variant) As Integer Dim iRet As Integer iRet = MsgFunc(strMsg, intFlags, strCaption) MsgError = iRet #If LOGGING Then ' ╨Φ╥¬╡╟┬╝╒Γ╕÷┤φ╬≤▓ó╜Γ┬δ╙├╗º╧∞╙ªíú Dim strID As String Dim strLogMsg As String Select Case iRet Case IDOK strID = ResolveResString(resLOG_IDOK) Case IDCANCEL strID = ResolveResString(resLOG_IDCANCEL) Case IDABORT strID = ResolveResString(resLOG_IDABORT) Case IDRETRY strID = ResolveResString(resLOG_IDRETRY) Case IDIGNORE strID = ResolveResString(resLOG_IDIGNORE) Case IDYES strID = ResolveResString(resLOG_IDYES) Case IDNO strID = ResolveResString(resLOG_IDNO) Case Else strID = ResolveResString(resLOG_IDUNKNOWN) '╜ß╩° Case End Select strLogMsg = strMsg & LF$ & "(" & ResolveResString(resLOG_USERRESPONDEDWITH, "|1", strID) & ")" If IsMissing(intLogType) Then intLogType = MSGERR_ERROR End If Select Case intLogType Case MSGERR_WARNING LogWarning strLogMsg Case MSGERR_ERROR LogError strLogMsg Case Else LogError strLogMsg '╜ß╩° Case End Select #End If End Function '----------------------------------------------------------- ' ║»╩²: MsgFunc ' ' ╟┐╓╞╩≤▒Ω╓╕╒δ╬¬╚▒╩í└α╨═ú¼╡≈╙├ VB ╡─ MsgBox ║»╩²ú¼▓╬╝√ MsgErroríú ' ' ╚δ┐┌: [strMsg] - ╥¬╧╘╩╛╡─╧√╧ó ' [intFlags] - MsgBox ║»╩²└α╨═▒Ω╓╛ ' [strCaption] - ╬¬╧√╧ó┐≥╩╣╙├╡─▒Ω╠Γ ' ╖╡╗╪: MsgBox ║»╩²╡─╜ß╣√ '----------------------------------------------------------- ' Function MsgFunc(ByVal strMsg As String, ByVal intFlags As Integer, ByVal strCaption As String) As Integer Dim intOldPointer As Integer intOldPointer = Screen.MousePointer If gfNoUserInput Then MsgFunc = GetDefMsgBoxButton(intFlags) If gfSilent = True Then LogSilentMsg strMsg End If If gfSMS = True Then LogSMSMsg strMsg gfDontLogSMS = False End If Else Screen.MousePointer = gintMOUSE_DEFAULT MsgFunc = MsgBox(strMsg, intFlags, strCaption) Screen.MousePointer = intOldPointer End If End Function '----------------------------------------------------------- ' ║»╩²: MsgWarning ' ' ╟┐╓╞╩≤▒Ω╓╕╒δ╬¬╚▒╩í└α╨═ú¼╡≈╙├ VB ╡─ MsgBox ║»╩²ú¼ ' ╡╟┬╝╒Γ╕÷┤φ╬≤ú¼▓ó(╜÷ 32 ╬╗)╨┤╧┬╧√╧ó║═╙├╗º╧∞╙ª╡─╚╒╓╛╬─╝■(╜÷ 32 ╬╗)íú ' ╚δ┐┌: [strMsg] - ╥¬╧╘╩╛╡─╧√╧ó ' [intFlags] - MsgBox ║»╩²└α╨═▒Ω╓╛ ' [strCaption] - ╬¬╧√╧ó┐≥╩╣╙├╡─▒Ω╠Γ ' ' ╖╡╗╪: MsgBox ║»╩²╡─╜ß╣√ '----------------------------------------------------------- ' Function MsgWarning(ByVal strMsg As String, ByVal intFlags As Integer, ByVal strCaption As String) As Integer MsgWarning = MsgError(strMsg, intFlags, strCaption, MSGERR_WARNING) End Function '----------------------------------------------------------- ' ╫╙│╠╨≥: SetFormFont ' ' ▒Θ└·╓╕╢¿┤░╠σ╔╧╡─╦∙╙╨┐╪╝■ú¼▓ó╘┌╫╩╘┤(Resource)╬─╝■╓╨╡─╩⌠╨╘╝»╔╧╔Φ╓├ Fontíú ' ' ╚δ┐┌: [frm] - ╨Φ╥¬╔Φ╓├╫╓╠σ╡─┐╪╝■╦∙╘┌╡─┤░╠σíú '----------------------------------------------------------- ' Public Sub SetFormFont(frm As Form) Dim ctl As Control Dim fntSize As Integer Dim fntName As String Dim fntBold As Boolean ' ' ▒╛╣²│╠╜½╘┌╫╩╘┤╬─╝■╡─╫╓╠σ┴╨▒φ╓╨╔Φ╓├├┐╕÷┐╪╝■╡─╫╓╠σíú ' ' ─│╨⌐┐╪╝■┐╔─▄╩º░▄ú¼╦∙╥╘╜½┤╙╧┬╥╗╕÷╓╪╨┬┐¬╩╝... ' On Error Resume Next ' ' ┤╙╫╩╘┤╬─╝■╗±╚í╫╓╠σ├√║═┤≤╨í ' fntSize = CInt(LoadResString(resFONTSIZE)) fntBold = (LoadResString(resFONTBOLD) = Format(True)) fntName = LoadResString(resFONTNAME) ' ' ╔Φ╓├┤░╠σ╫╓╠σ ' frm.FontSize = fntSize frm.FontBold = fntBold frm.FontName = fntName If Err.Number <> 0 Then ' ' ╔Φ╓├╫╓╠σ╩º░▄ú¼┐╔─▄╙╔╙┌╫╓╠σ╬┤▒╗░▓╫░íú ' ╘┌╫╩╘┤╬─╝■╓╨┤µ╙╨┴╜╕÷▒╕╙├╡─╫╓╠σ├√ú¼╩╘╩╘╦ⁿ├╟íú ' Err.Number = 0 fntName = LoadResString(resFONTNAMEBACKUP1) frm.FontName = fntName If Err.Number <> 0 Then ' ' ╚╘╚╗╬▐╖¿╣ñ╫≈íú╥╗╕÷╫ε║≤╡─╗·╗ß╩╟ú¼│ó╩╘╡┌╢■╕÷▒╕╙├╫╓╠σíú ' ╚τ╣√╒Γ╥╗┤╬╩º░▄┴╦ú¼╜½╙├╚▒╩í╫╓╠σ╝╠╨°╧┬╚Ñíú ' Err.Number = 0 fntName = LoadResString(resFONTNAMEBACKUP2) frm.FontName = fntName Err.Number = 0 End If End If ' ' ╤¡╗╖├┐╕÷┐╪╝■▓ó╩╘═╝╔Φ╓├╞Σ╫╓╠σ╩⌠╨╘ú¼╒Γ┐╔─▄╡╝╓┬│÷┤φú¼╡½┤φ╬≤┤ª└φ╣²│╠╥╤╛¡╣╪▒╒ ' For Each ctl In frm.Controls ctl.FontSize = fntSize ctl.FontName = fntName ctl.FontBold = fntBold Next ' ' ═╦│÷└┤ú¼╓╪╨┬╔Φ┤φ╬≤┤ª└φ╣²│╠ ' Set ctl = Nothing On Error GoTo 0 Exit Sub End Sub '----------------------------------------------------------- ' ╫╙│╠╨≥: SetMousePtr ' ' ╠ß╣⌐╥╗╓╓╜÷╡▒╩≤▒Ω╓╕╒δ╫┤╠¼╕─▒Σ╩▒ú¼╔Φ╓├╩≤▒Ω╓╕╒δ╡─╖╜╖¿íú ' ╢╘╙┌├┐╥╗╕÷ HOURGLASS ╡≈╙├ú¼╢╝╙ª╙╨╥╗╕÷╧α╙ª╡─ DEFAULT ╡≈╙├íú ' ╞Σ╦√└α╨═╡─╩≤▒Ω╓╕╒δ┐╔╥╘╓▒╜╙╔Φ╓├íú ' ' ╚δ┐┌: [intMousePtr] - ╧ú═√╡─╩≤▒Ω╓╕╒δ└α╨═ '----------------------------------------------------------- ' Sub SetMousePtr(intMousePtr As Integer) Static intPtrState As Integer Select Case intMousePtr Case gintMOUSE_HOURGLASS intPtrState = intPtrState + 1 Case gintMOUSE_DEFAULT intPtrState = intPtrState - 1 If intPtrState < 0 Then intPtrState = 0 End If Case Else Screen.MousePointer = intMousePtr Exit Sub '╜ß╩° Case End Select Screen.MousePointer = IIf(intPtrState > 0, gintMOUSE_HOURGLASS, gintMOUSE_DEFAULT) End Sub '----------------------------------------------------------- ' ║»╩²: StripTerminator ' ' ╖╡╗╪╖╟┴π╜ß╬▓╡─╫╓╖√┤«íú╡Σ╨═╡╪ú¼╒Γ╩╟╥╗╕÷╙╔ Windows API ╡≈╙├╖╡╗╪╡─╫╓╖√┤«íú ' ' ╚δ┐┌: [strString] - ╥¬╔╛│²╜ß╩°╖√╡─╫╓╖√┤« ' ' ╖╡╗╪: ┤½╡▌╡─╫╓╖√┤«╝⌡╚Ñ╬▓▓┐┴π╥╘║≤╡─╓╡íú '----------------------------------------------------------- ' Function StripTerminator(ByVal strString As String) As String Dim intZeroPos As Integer intZeroPos = InStr(strString, Chr$(0)) If intZeroPos > 0 Then StripTerminator = Left$(strString, intZeroPos - 1) Else StripTerminator = strString End If End Function '----------------------------------------------------------- ' ║»╩²: GetFileVersion ' ' ╬¬╓╕╢¿╡─╬─╝■╖╡╗╪─┌▓┐╬─╝■░µ▒╛║┼íú ' ╒Γ╥▓╨φ╙δ╘┌í░╬─╝■╣▄└φ╞≈í▒╡─╬─╝■╩⌠╨╘╢╘╗░┐≥╓╨╧╘╩╛╡─░µ▒╛║┼╙╨╦∙▓╗═¼íú ' ╦ⁿ╙δ╘┌ VB5 í░░▓╫░│╠╨≥╧≥╡╝í▒╡─í░╬─╝■╧╕╜┌í▒╥╗╞┴╓╨╧╘╩╛╡─║┼╧α═¼íú ' ╒Γ╕÷║┼╩╟╘┌▒╚╜╧╬─╝■░µ▒╛╩▒╙╔ Windows VerInstallFile API ╦∙╩╣╙├╡─íú ' ' ╚δ┐┌: [strFilename] - ╧ú═√╡├╡╜╞Σ╡─░µ▒╛║┼╬─╝■ ' [fIsRemoteServerSupportFile] - ╩╟╖±╕├╬─╝■╩╟╥╗╕÷╘╢│╠ ActiveX ▓┐╝■╓º│╓╬─╝■ (.VBR)ú¼ ' ╜÷╞≤╥╡░µíú╚τ╣√▓╗╩╟ú¼╝┘╔Φ╬¬ Falseíú ' ' ╖╡╗╪: ╚τ╣√╒╥╡╜┴╦ú¼╖╡╗╪░µ▒╛║┼╫╓╖√┤«ú╗╖±╘≥ gstrNULL '----------------------------------------------------------- ' Function GetFileVersion(ByVal strFilename As String, Optional ByVal fIsRemoteServerSupportFile) As String Dim sVerInfo As VERINFO Dim strVer As String On Error GoTo GFVError If IsMissing(fIsRemoteServerSupportFile) Then fIsRemoteServerSupportFile = False End If ' '╜½╡├╡╜╡─╬─╝■░µ▒╛╨┼╧ó╖┼╡╜ VERINFO ╜ß╣╣╓╨ú¼▓ó┤╙╩╩║╧╡─╘¬╦╪╓╨╩╒╝»░µ▒╛╫╓╖√┤«íú ' If GetFileVerStruct(strFilename, sVerInfo, fIsRemoteServerSupportFile) = True Then strVer = Format$(sVerInfo.nMSHi) & gstrDECIMAL & Format$(sVerInfo.nMSLo) & gstrDECIMAL strVer = strVer & Format$(sVerInfo.nLSHi) & gstrDECIMAL & Format$(sVerInfo.nLSLo) GetFileVersion = strVer Else GetFileVersion = gstrNULL End If Exit Function GFVError: GetFileVersion = gstrNULL Err = 0 End Function '----------------------------------------------------------- ' ║»╩²: GetFileVerStruct ' ' ╜½╡├╡╜╡─╬─╝■░µ▒╛╨┼╧ó╖┼╡╜ VERINFO TYPE ▒Σ┴┐╓╨ ' ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í░µ▒╛╨┼╧ó╡─╬─╝■├√ ' [fIsRemoteServerSupportFile] - ╩╟╖±╕├╬─╝■╩╟╥╗╕÷╘╢│╠ ActiveX ▓┐╝■╓º│╓╬─╝■ (.VBR)ú¼ ' ╜÷╞≤╥╡░µíú╚τ╣√▓╗╩╟ú¼╝┘╔Φ╬¬ Falseíú ' │÷┐┌: [sVerInfo] - ╥¬╠ε│Σ░µ▒╛╨┼╧ó╡─ VERINFO └α╨═ ' ' ╖╡╗╪: Trueú¼╚τ╣√╒╥╡╜░µ▒╛╨┼╧óú╗╖±╘≥╬¬ False '----------------------------------------------------------- ' Function GetFileVerStruct(ByVal strFilename As String, sVerInfo As VERINFO, Optional ByVal fIsRemoteServerSupportFile) As Boolean Const strFIXEDFILEINFO$ = "\" Dim lVerSize As Long Dim lVerHandle As Long Dim lpBufPtr As Long Dim byteVerData() As Byte Dim fFoundVer As Boolean GetFileVerStruct = False fFoundVer = False If IsMissing(fIsRemoteServerSupportFile) Then fIsRemoteServerSupportFile = False End If If fIsRemoteServerSupportFile Then GetFileVerStruct = GetRemoteSupportFileVerStruct(strFilename, sVerInfo) fFoundVer = True Else ' '╗±╚í╬─╝■░µ▒╛╨┼╧ó╡─┤≤╨íú¼╕°╦ⁿ╖╓┼Σ╥╗╕÷╗║│σ╟°ú¼▓ó╗±╚í░µ▒╛╨┼╧óíú '╜╙╫┼ú¼╬╥├╟▓Θ╤»╣╠╢¿╡─╬─╝■╨┼╧ó▓┐╖╓ú¼╘┌─╟└∩ú¼╙╔ Windows VerInstallFile API ╩╣╙├╡──┌▓┐╬─╝■░µ▒╛▒╗▒ú│╓íú '╬╥├╟┐╔╥╘╕│╓╡╣╠╢¿╡─╬─╝■╨┼╧ó╡╜ VERINFO ╜ß╣╣╓╨íú ' lVerSize = GetFileVersionInfoSize(strFilename, lVerHandle) If lVerSize > 0 Then ReDim byteVerData(lVerSize) If GetFileVersionInfo(strFilename, lVerHandle, lVerSize, byteVerData(0)) <> 0 Then ' (Pass byteVerData array via reference to first element) If VerQueryValue(byteVerData(0), strFIXEDFILEINFO & "", lpBufPtr, lVerSize) <> 0 Then lmemcpy sVerInfo, lpBufPtr, lVerSize fFoundVer = True GetFileVerStruct = True End If End If End If End If If Not fFoundVer Then ' ' ┤╙╬─╝■╓╨▓Θ╒╥░µ▒╛╨┼╧ó▓╗│╔╣ªíú ' ╥╗╕÷┐╔─▄╩╟╦ⁿ╩╟╥╗╕÷┤╙╩⌠╬─╝■íú ' If UCase(Extension(strFilename)) = gstrEXT_DEP Then GetFileVerStruct = GetDepFileVerStruct(strFilename, sVerInfo) End If End If End Function '----------------------------------------------------------- ' ║»╩²: GetDepFileVerStruct ' ' ┤╙╥╗╕÷┤╙╩⌠╬─╝■ (*.dep) ╓╨╗±╚í╬─╝■░µ▒╛╨┼╧óíú ' ╒Γ╤∙╡─╬─╝■├╗╙╨ Windows ░µ▒╛┤┴ú¼╡½╦ⁿ╙╨┐╔╣⌐▓Θ╒╥╡──┌▓┐░µ▒╛┤┴íú ' ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í░µ▒╛╨┼╧ó╡─┤╙╩⌠╬─╝■├√ ' │÷┐┌: [sVerInfo] - ╥¬╠ε│Σ░µ▒╛╨┼╧ó╡─ VERINFO └α╨═ ' ' ╖╡╗╪: Trueú¼╚τ╣√╒╥╡╜░µ▒╛╨┼╧óú╗╖±╘≥╬¬ False '----------------------------------------------------------- ' Function GetDepFileVerStruct(ByVal strFilename As String, sVerInfo As VERINFO) As Boolean Const strVersionKey = "Version=" Dim cchVersionKey As Integer Dim iFile As Integer GetDepFileVerStruct = False cchVersionKey = Len(strVersionKey) sVerInfo.nMSHi = gintNOVERINFO On Error GoTo Failed iFile = FreeFile Open strFilename For Input Access Read Lock Read Write As #iFile ' ╤¡╗╖╬─╝■╡─├┐╥╗╨╨ú¼▓Θ╒╥╣╪╝ⁿ╫╓ While (Not EOF(iFile)) Dim strLine As String Line Input #iFile, strLine If Left$(strLine, cchVersionKey) = strVersionKey Then ' ╥╤╛¡╒╥╡╜┴╦░µ▒╛╣╪╝ⁿ╫╓ú¼╘┌╡╚║┼║≤╚½▓┐╕┤╓╞ Dim strVersion As String strVersion = Mid$(strLine, cchVersionKey + 1) '╖╓╬÷▓ó┤µ┤ó░µ▒╛╨┼╧ó PackVerInfo strVersion, sVerInfo GetDepFileVerStruct = True Close iFile Exit Function End If Wend Close iFile Exit Function Failed: GetDepFileVerStruct = False End Function '----------------------------------------------------------- ' ║»╩²: GetRemoteSupportFileVerStruct ' ' ╜½╥╗╕÷╘╢│╠ ActiveX ▓┐╝■╓º│╓╬─╝■╡─░µ▒╛╨┼╧ó╖┼╡╜╥╗╕÷ VERINFO TYPE ▒Σ┴┐╓╨ú¼╜÷╞≤╥╡░µíú ' ╒Γ╤∙╡─╬─╝■├╗╙╨ Windows ░µ▒╛┤┴ú¼╡½╦ⁿ╙╨┐╔╣⌐▓Θ╒╥╡──┌▓┐░µ▒╛┤┴íú ' ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í░µ▒╛╨┼╧ó╡─┤╙╩⌠╬─╝■├√ ' │÷┐┌: [sVerInfo] - ╥¬╠ε│Σ░µ▒╛╨┼╧ó╡─ VERINFO └α╨═ ' ' ╖╡╗╪: Trueú¼╚τ╣√╒╥╡╜░µ▒╛╨┼╧óú╗╖±╘≥╬¬ False '----------------------------------------------------------- ' Function GetRemoteSupportFileVerStruct(ByVal strFilename As String, sVerInfo As VERINFO) As Boolean Const strVersionKey = "Version=" Dim cchVersionKey As Integer Dim iFile As Integer cchVersionKey = Len(strVersionKey) sVerInfo.nMSHi = gintNOVERINFO On Error GoTo Failed iFile = FreeFile Open strFilename For Input Access Read Lock Read Write As #iFile ' ╤¡╗╖╬─╝■╡─├┐╥╗╨╨ú¼▓Θ╒╥╣╪╝ⁿ╫╓ While (Not EOF(iFile)) Dim strLine As String Line Input #iFile, strLine If Left$(strLine, cchVersionKey) = strVersionKey Then ' ╥╤╛¡╒╥╡╜┴╦░µ▒╛╣╪╝ⁿ╫╓ú¼╘┌╡╚║┼║≤╚½▓┐╕┤╓╞ Dim strVersion As String strVersion = Mid$(strLine, cchVersionKey + 1) '╖╓╬÷▓ó┤µ┤ó░µ▒╛╨┼╧ó PackVerInfo strVersion, sVerInfo '┤╙ .VBR ╬─╝■╫¬╗╗╕±╩╜ 1.2.3 ╡╜ 1.2.0.3ú¼║≤╒▀╩╟╬╥├╟╒µ╒²╧δ╥¬╡─ sVerInfo.nLSLo = sVerInfo.nLSHi sVerInfo.nLSHi = 0 GetRemoteSupportFileVerStruct = True Close iFile Exit Function End If Wend Close iFile Exit Function Failed: GetRemoteSupportFileVerStruct = False End Function '----------------------------------------------------------- ' ║»╩²: GetWindowsDir ' ' ╡≈╙├ windows API ║»╩²╥╘╗±╚í windows ─┐┬╝▓ó╚╖▒ú┤µ╘┌╥╗╕÷╬▓╦µ╡──┐┬╝╖╓╕⌠╖√ ' ' ╖╡╗╪: windows ─┐┬╝ '----------------------------------------------------------- ' Function GetWindowsDir() As String Dim strBuf As String strBuf = Space$(gintMAX_SIZE) ' '╗±╚í windows ─┐┬╝▓ó╡≈╒√╗║│σ╟°╡╜╖╡╗╪╡─╚╖╩╡│ñ╢╚ú¼╚τ╣√ API ├╗╙╨╖╡╗╪─┐┬╝╖╓╕⌠╖√(\)ú¼╝╙╥╗╕÷ ' If GetWindowsDirectory(strBuf, gintMAX_SIZE) > 0 Then strBuf = StripTerminator$(strBuf) AddDirSep strBuf GetWindowsDir = strBuf Else GetWindowsDir = gstrNULL End If End Function '----------------------------------------------------------- ' ║»╩²: UCase16 ' ' 16 ╬╗╟Θ┐÷╧┬╖╡╗╪╫¬╗╗│╔┤≤╨┤╡─╫╓╖√┤«ú¼ ' ╗≥╒▀╘┌ 32 ╬╗╟Θ┐÷╧┬╖╡╗╪╥╗╕÷╬┤╨▐╕─╡─╫╓╖√┤«┐╜▒┤íú ' ' ╚δ┐┌: [str] - ╥¬╕┤╓╞/╫¬╗╗│╔┤≤╨┤╡─╫╓╖√┤« ' '----------------------------------------------------------- ' Function UCase16(ByVal str As String) UCase16 = str End Function '----------------------------------------------------------- ' ║»╩²: ExtractFilenameItem ' ' ┤╙╥╗╕÷╫╓╖√┤«╓╨│Θ╚í╥╗╕÷╥²║┼╥²╞≡└┤╡─╗≥╬▐╥²║┼╬─╝■├√íú ' ' ╚δ┐┌: [str] - ╬¬╡├╡╜╬─╝■├√╢°╥¬╖╓╬÷╡─╫╓╖√┤«íú ' [intAnchor] - ╬─╝■├√┐¬╩╝┤ª╡─╫╓╖√┤«╦≈╥²íú ' ╬─╝■├√╝╠╨°╡╜╫╓╖√┤«╜ß╩°╗≥╡╜╫╓╖√┤«╓╨╡─╧┬╥╗╕÷╢║║┼ú¼ ' ╗≥╒▀ú¼╚τ╣√╬─╝■├√▒╗╖Γ╫░╡╜╥²║┼╓╨ú¼╘≥╝╠╨°╡╜╧┬╥╗╕÷╥²║┼íú ' │÷┐┌: ╖╡╗╪▓╗┤°╥²║┼╡─╬─╝■├√íú ' [intAnchor] ▒╗╔Φ╓├╬¬╢║║┼ú¼╗≥╥¬╖┼╡╜╫╓╖√┤«─⌐╬▓╡─╫╓╖√ ' [fErr] ╔Φ╬¬ Trueú¼╚τ╣√╖ó╧╓╥╗╕÷╖╓╬÷┤φ╬≤ ' '----------------------------------------------------------- ' Function strExtractFilenameItem(ByVal str As String, intAnchor As Integer, fErr As Boolean) As String While Mid$(str, intAnchor, 1) = " " intAnchor = intAnchor + 1 Wend Dim iEndFilenamePos As Integer Dim strFilename As String If Mid$(str, intAnchor, 1) = """" Then ' ╬─╝■├√▒╗╥²║┼╥²╞≡└┤ iEndFilenamePos = InStr(intAnchor + 1, str, """") ' ╒╥╡╜┴╦╞Ñ┼Σ╡─╥²║┼ If iEndFilenamePos > 0 Then strFilename = Mid$(str, intAnchor + 1, iEndFilenamePos - 1 - intAnchor) intAnchor = iEndFilenamePos + 1 While Mid$(str, intAnchor, 1) = " " intAnchor = intAnchor + 1 Wend If (Mid$(str, intAnchor, 1) <> gstrCOMMA) And (Mid$(str, intAnchor, 1) <> "") Then fErr = True Exit Function End If Else fErr = True Exit Function End If Else ' ╝╠╨°╩╟╬─╝■├√ú¼╓▒╡╜╧┬╥╗╕÷╢║║┼╗≥╬─╝■╜ß╩° Dim iCommaPos As Integer iCommaPos = InStr(intAnchor, str, gstrCOMMA) If iCommaPos = 0 Then iCommaPos = Len(str) + 1 End If iEndFilenamePos = iCommaPos strFilename = Mid$(str, intAnchor, iEndFilenamePos - intAnchor) intAnchor = iCommaPos End If strFilename = Trim$(strFilename) If strFilename = "" Then fErr = True Exit Function End If fErr = False strExtractFilenameItem = strFilename End Function '----------------------------------------------------------- ' ║»╩²: Extension ' ' │Θ╚í╬─╝■├√/┬╖╛╢├√╡─└⌐╒╣▓┐╖╓ ' ' ╚δ┐┌: [strFilename] - ╥¬╗±╚í└⌐╒╣▓┐╖╓╡─╬─╝■/┬╖╛╢ ' ' ╖╡╗╪: └⌐╒╣▓┐╖╓ú¼╚τ╣√┤µ╘┌ú╗╖±╘≥ gstrNULL '----------------------------------------------------------- ' Function Extension(ByVal strFilename As String) As String Dim intPos As Integer Extension = gstrNULL intPos = Len(strFilename) Do While intPos > 0 Select Case Mid$(strFilename, intPos, 1) Case gstrSEP_EXT Extension = Mid$(strFilename, intPos + 1) Exit Do Case gstrSEP_DIR, gstrSEP_DIRALT Exit Do '╜ß╩° Case End Select intPos = intPos - 1 Loop End Function '----------------------------------------------------------- ' ╫╙│╠╨≥: PackVerInfo ' ' ╖╓╬÷┤░╠σ x[.x[.x[.x]]] ╡─╬─╝■░µ▒╛║┼╫╓╖√┤«ú¼ ' ▓ó╜½╒Γ╕÷│Θ╚í│÷└┤╡─║┼╕│╓╡╕° VERINFO └α╨═▒Σ┴┐╡─╡─╩╩╡▒╘¬╦╪íú ' └²╚τú¼╙╨╨º╡─░µ▒╛╫╓╖√┤«╩╟ '3.11.0.102','3.11'íó'3'╡╚íú ' ' ╚δ┐┌: [strVersion] - ░µ▒╛║┼╫╓╖√┤« ' ' │÷┐┌: [sVerInfo] - VERINFO └α╨═▒Σ┴┐ú¼┤╙░µ▒╛║┼╫╓╖√┤«╕°╞Σ╘¬╦╪╕│╩╩╡▒╡─║┼ '----------------------------------------------------------- ' Sub PackVerInfo(ByVal strVersion As String, sVerInfo As VERINFO) Dim intOffset As Integer Dim intAnchor As Integer On Error GoTo PVIError intOffset = InStr(strVersion, gstrDECIMAL) If intOffset = 0 Then sVerInfo.nMSHi = Val(strVersion) GoTo PVIMSLo Else sVerInfo.nMSHi = Val(Left$(strVersion, intOffset - 1)) intAnchor = intOffset + 1 End If intOffset = InStr(intAnchor, strVersion, gstrDECIMAL) If intOffset = 0 Then sVerInfo.nMSLo = Val(Mid$(strVersion, intAnchor)) GoTo PVILSHi Else sVerInfo.nMSLo = Val(Mid$(strVersion, intAnchor, intOffset - intAnchor)) intAnchor = intOffset + 1 End If intOffset = InStr(intAnchor, strVersion, gstrDECIMAL) If intOffset = 0 Then sVerInfo.nLSHi = Val(Mid$(strVersion, intAnchor)) GoTo PVILSLo Else sVerInfo.nLSHi = Val(Mid$(strVersion, intAnchor, intOffset - intAnchor)) intAnchor = intOffset + 1 End If intOffset = InStr(intAnchor, strVersion, gstrDECIMAL) If intOffset = 0 Then sVerInfo.nLSLo = Val(Mid$(strVersion, intAnchor)) Else sVerInfo.nLSLo = Val(Mid$(strVersion, intAnchor, intOffset - intAnchor)) End If Exit Sub PVIError: sVerInfo.nMSHi = 0 PVIMSLo: sVerInfo.nMSLo = 0 PVILSHi: sVerInfo.nLSHi = 0 PVILSLo: sVerInfo.nLSLo = 0 End Sub Public Function strQuoteString(strUnQuotedString As String, Optional vForce As Variant, Optional vTrim As Variant) ' ' ╚▒╩í╡╪ú¼▒╛╫╙│╠╨≥╘┌╥╗╕÷╬▐╥²║┼╡─╫╓╖√┤«╔╧╠φ╝╙╥²║┼íú ' ╚τ╣√╫╓╖√┤«╥╤╛¡▒╗╥²║┼╥²╞≡└┤ú¼╦ⁿ▓╗╫÷╚╬║╬╕─▒Σ╝┤╖╡╗╪ú¼│²╖╟ vForce ▒╗╔Φ╬¬ True (vForce ╚▒╩í╩╟ False)ú╗ ' ╜÷╙╨╡─╕─▒Σ╩╟╔╛╡⌠╥²║┼╟░║≤╡─┐╒╕±ú¼│²╖╟ vTrim ╔Φ╓├╬¬ Falseíú ' ╚τ╣√╫╓╖√┤«░ⁿ║¼╙╨╟░╡╝║═╬▓╦µ┐╒╕±ú¼╞Σ╜½▒╗╔╛╡⌠ú¼│²╖╟ vTrim ╔Φ╓├╬¬ Falseú¿vTrim ╚▒╩í╬¬ Trueú⌐íú ' ' Dim strQuotedString As String If IsMissing(vForce) Then vForce = False End If If IsMissing(vTrim) Then vTrim = True End If strQuotedString = strUnQuotedString ' ' ╚τ╣√╨Φ╥¬ú¼╡≈╒√╫╓╖√┤« ' If vTrim = True Then strQuotedString = Trim(strQuotedString) End If ' ' ▓Θ┐┤╫╓╖√┤«╩╟╖±▒╗╥²║┼╥²╞≡└┤ ' If vForce = False Then If (Left(strQuotedString, 1) = gstrQUOTE) And (Right(strQuotedString, 1) = gstrQUOTE) Then ' ' ╫╓╖√┤«╥╤╛¡▒╗╥²║┼╥²╞≡└┤íú ' GoTo DoneQuoteString End If End If ' ' ╠φ╝╙╥²║┼ ' strQuotedString = gstrQUOTE & strQuotedString & gstrQUOTE DoneQuoteString: strQuoteString = strQuotedString End Function Public Function strUnQuoteString(ByVal strQuotedString As String) ' ' ▒╛╫╙│╠╨≥▓Γ╩╘ strQuotedString ╩╟╖±╘┌╥²║┼╓╨╒█╨╨ú¼╚τ╣√╩╟ú¼╔╛│²╓«íú ' strQuotedString = Trim(strQuotedString) If Mid$(strQuotedString, 1, 1) = gstrQUOTE And Right$(strQuotedString, 1) = gstrQUOTE Then ' ' ╚τ╣√╙╨╥²║┼ú¼╚Ñ╡⌠╥²║┼íú ' strQuotedString = Mid$(strQuotedString, 2, Len(strQuotedString) - 2) End If strUnQuoteString = strQuotedString End Function Public Function fCheckFNLength(strFilename As String) As Boolean ' ' ▒╛╫╙│╠╨≥╚╖╚╧╬─╝■├√ strFilename ╡─│ñ╢╚╙╨╨ºíú ' ╘┌ NT (Intel) ║═ Win95 ╗╖╛│╧┬ú¼╦ⁿ╡─│ñ╢╚┐╔╥╘╩╟ 259 (gintMAX_PATH_LEN-1) ╕÷╫╓╖√íú ' ╒Γ╕÷│ñ╢╚▒╪╨δ░ⁿ└¿╟²╢»╞≈íó┬╖╛╢íó╬─╝■├√íó├ⁿ┴ε╨╨▓╬╩²║═╥²║┼ (╚τ╣√╫╓╖√┤«▒╗╥²║┼╥²╞≡└┤)íú ' fCheckFNLength = (Len(strFilename) < gintMAX_PATH_LEN) End Function Public Function intGetNextFldOffset(ByVal intAnchor As Integer, strList As String, strDelimit As String, Optional CompareType As Variant) As Integer ' ' ▒╛╫╙│╠╨≥┤╙╥╗╕÷ strDelimit ╡Ñ╢└┴╨▒φíóstrListú¼▓ó╘┌ intAnchor ║≤├µ╡─┴╨▒φ╓╨╢¿╬╗╧┬╥╗╧εíú ' ╗∙▒╛╡╪ú¼╦ⁿ╙╨╗·╗ß╒╥╡╜▓╗╘┌╥²║┼╓╨╡─╧┬╥╗╕÷ strDelimitíú ' ╚τ╣√╬┤╒╥╡╜ strDelimitú¼│╠╨≥╖╡╗╪ 0íú ' ╫ó╥Γú¼ intAnchor ▒╪╨δ╘┌╥²║┼╓«═Γú¼╖±╘≥▒╛╫╙│╠╨≥╜½╖╡╗╪▓╗╒²╚╖╡─╜ß╣√íú ' ' ╡Σ╨═╡─ strDelimit ╩╟╢║║┼íú ' ' ╚τ╣√│÷┤φú¼│╠╨≥╖╡╗╪ -1íú ' ' ▒╛╫╙│╠╨≥┤╙╥╗╕÷ strDelimit ╡Ñ╢└┴╨▒φíóstrListú¼▓ó╘┌ intAnchor ║≤├µ╡─┴╨▒φ╓╨╢¿╬╗╧┬╥╗╧εíú ' ╗∙▒╛╡╪ú¼╦ⁿ╙╨╗·╗ß╒╥╡╜▓╗╘┌╥²║┼╓╨╡─╧┬╥╗╕÷ strDelimitíú ' ╚τ╣√╬┤╒╥╡╜ strDelimitú¼│╠╨≥╖╡╗╪ 0íú ' ╫ó╥Γú¼ intAnchor ▒╪╨δ╘┌╥²║┼╓«═Γú¼╖±╘≥▒╛╫╙│╠╨≥╜½╖╡╗╪▓╗╒²╚╖╡─╜ß╣√íú Dim intQuote As Integer Dim intDelimit As Integer Const CompareBinary = 0 Const CompareText = 1 If IsMissing(CompareType) Then CompareType = CompareText End If If intAnchor = 0 Then intAnchor = 1 intQuote = InStr(intAnchor, strList, gstrQUOTE, CompareType) intDelimit = InStr(intAnchor, strList, strDelimit, CompareType) If (intQuote > intDelimit) Or (intQuote = 0) Then ' ' ╧┬╥╗╕÷╖╓║┼▓╗╘┌╥²║┼╓╨íú ' ╥≥┤╦ú¼╬╥├╟╥╤╛¡╒╥╡╜┴╦╬╥├╟╥¬╒╥╡─íú ' ╫ó╥Γ╒Γ╓╓╟Θ┐÷ú¼╘┌─╟└∩├╗╙╨╥²║┼╥▓▒╗┤ª└φíú ' GoTo DoneGetNextFldOffset ElseIf intQuote < intDelimit Then ' ' ╘┌╧┬╥╗╕÷╖╓║┼╓«╟░╫╖╝╙╥╗╕÷╥²║┼íú ' ╒Γ╥Γ╬╢╫┼╗≥╨φ╬╥├╟╥╤╛¡╘┌╥²║┼╓╨┴╦íú ' ╬╥├╟╚╘╨Φ╝∞▓Θ╩╟╖±╙╥╥²║┼╘┌╖╓║┼╓«║≤íú ' intAnchor = intQuote + 1 intQuote = InStr(intAnchor, strList, gstrQUOTE, CompareType) If (intQuote > intDelimit) Then ' ' ╖╓║┼╘┌╥²║┼╓«─┌íú╥≥┤╦ú¼║÷┬╘╓«íú ' ╘┌╙╥╥²║┼╓«║≤╡─╧┬╥╗╕÷╖╓║┼▒╪╨δ╘┌╥²║┼╓«═Γ╗≥╬╥├╟╙╨╥╗╕÷╗┘╦≡╬─╝■íú ' intAnchor = intQuote + 1 intDelimit = InStr(intAnchor, strList, strDelimit, CompareType) ' ' ║╧└φ╨╘╝∞▓Θíú▒ú╓ñ╘┌╬╥├╟╕╒╕╒╖ó╧╓╡─╥²║┼╓«╟░├╗╙╨┴φ╥╗╕÷╥²║┼íú ' If intDelimit > 0 Then intQuote = InStr(intAnchor, strList, gstrQUOTE, CompareType) If (intQuote > 0) And (intQuote < intDelimit) Then ' ' │÷┤φíú ' ╬╥├╟╙÷╡╜╥╗╕÷╡Ñ╢└╡─╥²║┼ (▓╗│╔╢╘)ú¼╒Γ╥Γ╬╢╫┼╫╓╖√┤«▓╗╒²╚╖íú ' intDelimit = -1 ' Error End If End If End If End If DoneGetNextFldOffset: intGetNextFldOffset = intDelimit End Function