P°φklady

Informace o systΘmov²ch souborech (dll, exe, drv atd.) T°φda
Funkce a procedury pro prßci se soubory Modul
Algoritmy t°φd∞nφ Modul
DlouhΘ a krßtkΘ jmΘno souboru Modul
Jak vytvo°it log soubor p°i instalaci programu pro jeho pozd∞jÜφ odinstalovßnφ Modul
Popis API funkce SHFileOperation Modul
Popis API funkce GetVolumeInformation Modul
Prochßzenφ disku a hledßnφ soubor∙ pomocφ API funkce Modul
Konverze souboru z UNIXu na DOS a opaΦn∞ K≤d
Jak p°idat soubor do nabφdky START-DOKUMENTY K≤d
Cesta k adresß°i WINDOWS K≤d
Cesta k systΘmovΘmu adresß°i WINDOWS K≤d
Cesta k adresß°i TEMP K≤d
ZjiÜt∞nφ typu disku K≤d
╚tenφ a zßpis nßzvu disku K≤d
╚tenφ seriovΘho Φφsla disku K≤d

Informace o systΘmov²ch souborech (dll, exe, drv atd.)
ZjiÜ¥uje informace o systΘmov²ch souborech (aplikace, dll, drv, fnt, vxd) , verzi, typ souboru drv, pro jak² OS byl soubor navr₧en, atd.
9025 byt∙ Kopφrovat

Funkce a procedury pro prßci se soubory

Modul obsahuje r∙znΘ funkce pro prßci se soubory, nap°. zjiÜt∞nφ existence souboru, nalezenφ asociovanΘ aplikace atd.
13416 byt∙ Kopφrovat

Algoritmy t°φd∞nφ

P°i prßci se soubory urΦit∞ narazφte na pot°ebu set°φdit soubory, nap°φklad podle nßzvu, velikosti atd. Tento modul obsahuje n∞kolik zßkladnφch t°φdφcφch algoritm∙ (Insert, Bubble, Select, Shell, Heap a Quick), vΦetn∞ popisu jejich funkce.
5532 byt∙ Kopφrovat

DlouhΘ a krßtkΘ jmΘno souboru

Poskytuje dv∞ funkce, z nich₧ jedna vracφ dlouhΘ jmΘno souboru, druhß krßtkΘ (8.3)
1759 byt∙ Kopφrovat

Jak vytvo°it log soubor p°i instalaci programu pro jeho pozd∞jÜφ odinstalovßnφ

Funkce a procedury v tomto modulu vytvß°φ log soubor (p°i instalaci n∞jakΘho programu), kter² slou₧φ p°i odinstalovßnφ ke korektnφmu odstran∞nφ vÜech jeho komponent. Log soubor je pou₧it programem ST4UNST.EXE, pokud u₧ivatel odstranφ program pomocφ kontrol panelu (p°idat nebo ubrat programy) ve Windows 95.
6866 byt∙ Kopφrovat

Popis API funkce SHFileOperation

Modul obsahuje kompletnφ definici funkce SHFileOperation s popisem vÜech parametr∙. Funkce kopφruje, p°esouvß, p°ejmenovßvß a ma₧e soubory. Pokud operace prob∞hne v po°ßdku, vracφ Φφslo 0, jinak jakΘkoli jinΘ Φφslo.
2065 byt∙ Kopφrovat

Popis API funkce GetVolumeInformation

Modul obsahuje kompletnφ definici funkce GetVolumeInformation s popisem vÜech parametr∙. Funkce vracφ informaci o file systΘmu a logickΘm disku. Pokud zjistφ vÜechny pot°ebnΘ informace, vracφ Φφslo 0, jinak jakΘkoli jinΘ Φφslo.
1854 byt∙ Kopφrovat

Prochßzenφ disku a hledßnφ soubor∙ pomocφ API funkce

Obsahuje jednu funkci pro prochßzenφ celΘho disku, tzn. vÜech adresß°∙ vΦetn∞ podadresß°∙. VÜe za pomocφ API funkcφ. Velmi rychlß a efektivnφ funkce.
3071 byt∙ Kopφrovat

Konverze souboru z UNIXu na DOS a opaΦn∞

Public Sub DosToUnix(strFile)
  Dim intFIn As Integer, intFOut As Integer, strTmp As String

  intFIn = FreeFile
  Open strFile For Input As #intFIn
  intFOut = FreeFile
  Open Left(strFile, InStr(strFile, ".")) & "unx" For Binary As #intFOut

  Do While Not EOF(intFIn)
    Line Input #intFIn, strTmp
    strTmp = strTmp & Chr(10)
    Put #intFOut, , strTmp
  Loop

  Close #intFIn
  Close #intFOut
End Sub

Public Sub UnixToDos(strFile)
  Dim intFIn, intFOut, bytTmp() As Byte, lngKde As Long, strOut As String

  intFIn = FreeFile
  Open strFile For Binary As #intFIn
  intFOut = FreeFile
  Open Left(strFile, InStr(strFile, ".")) & "dos" For Output As #intFOut

  Do While Not EOF(intFIn)
    ReDim bytTmp(LOF(intFIn))
    Get #intFIn, , bytTmp

    For lngKde = 0 To UBound(bytTmp) - 1
      If bytTmp(lngKde) <> 10 Then
        strOut = strOut & Chr(bytTmp(lngKde))
      Else
        Print #intFOut, strOut
        strOut = ""
      End If
    Next lngKde
  Loop

  Close #intFOut
  Close #intFIn
End Sub

Jak p°idat soubor do nabφdky START-DOKUMENTY

Private Const SHARD_PATH = &H2&

Private Declare Function SHAddToRecentDocs Lib "shell32.dll" _
		(ByVal dwFlags As Long, ByVal dwData As String) As Long

Public Sub PridejDokument(strCesta As String)
  Dim r As Long

  r = SHAddToRecentDocs(SHARD_PATH, strCesta) 'Jestlize se r<>0,
					      'nekde je problem
End Sub

Cesta k adresß°i WINDOWS

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias _
	"GetWindowsDirectoryA" (ByVal lpBuffer As String, _
	ByVal nSize As Long) As Long

Public Function GetWindowsDir() As String
  Dim strTemp As String, x As Integer

  strTemp = String(145, 0)
  x = GetWindowsDirectory(strTemp, 145)
  strTemp = Left(strTemp, x)
  If Right(strTemp, 1) <> "\" Then
    GetWindowsDir = strTemp + "\"
  Else
    GetWindowsDir = strTemp
  End If
End Function

Cesta k systΘmovΘmu adresß°i WINDOWS

Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
	"GetSystemDirectoryA" (ByVal lpBuffer As String, _
	ByVal nSize As Long) As Long

Public Function GetSystemDir() As String
  Dim Sys As String * 256,x As Integer

  x = GetSystemDirectory(Sys, Len(Sys))
  x = InStr(1, Sys, Chr$(0))
  GetSystemDir = Left(Sys, InStr(Sys, Chr$(0)) - 1)
End Function

Cesta k adresß°i TEMP

Private Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" _
	(ByVal nBufferLength As Long, ByVal lpBuffer As String)	As Long

Public Function GetTempPath() As String
  Dim strTmp As String,intI As Integer

  intI = GetTempPathA(0, "")
  strTmp = Space(intI)
  GetTempPathA(intI, strTmp)
  GetTempPath = strTmp
End Function

ZjiÜt∞nφ typu disku

Private Declare Function GetDriveType Lib "kernel32" Alias GetDriveTypeA" _
	(ByVal nDrive As String) As Long

Private Const DRIVE_REMOVABLE = 2
Private Const DRIVE_FIXED = 3
Private Const DRIVE_REMOTE = 4
Private Const DRIVE_CDROM = 5
Private Const DRIVE_RAMDISK = 6

Public Function getDrvType(drive As String) As String
  Dim drv As Long

  drv = GetDriveType(drive)
  Select Case drv
    Case DRIVE_REMOVABLE
      getDrvType = "V²m∞nn² disk"
    Case DRIVE_FIXED
      getDrvType = "Pevn² disk"
    Case DRIVE_REMOTE
      getDrvType = "Sφ¥ov² disk"
    Case DRIVE_CDROM
      getDrvType = "CDROM"
    Case DRIVE_RAMDISK
      getDrvType = "RAMDisk"
  End Select
End Function

╚tenφ a zßpis nßzvu disku

Private Declare Function GetVolumeInformation Lib "kernel32" Alias _
	"GetVolumeInformationA" (ByVal lpRootPathName As String, _
	ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _
	lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
	lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
	ByVal nFileSystemNameSize As Long) As Long

Private Declare Function SetVolumeLabel Lib "kernel32" Alias _
	"SetVolumeLabelA" (ByVal lpRootPathName As String, _
	ByVal lpVolumeName As String) As Long

Private Const MAX_FILENAME_LEN=256

Public Function GetVolumeName(sDrive As String) As String
  Dim ser As Long, s As String * MAX_FILENAME_LEN
  Dim s2 As String * MAX_FILENAME_LEN, i As Long, j As Long

  GetVolumeInformation _
    (sDrive + ":\" & Chr$(0), s, MAX_FILENAME_LEN, ser, i, j, s2, MAX_FILENAME_LEN)
  GetVolumeName = Left(s, InStr(s, Chr$(0)) - 1)
End Function

Public Function SetVolumeName(sDrive As String, n As String) As Boolean
  Dim i As Long

  i = SetVolumeLabelA(sDrive + ":\" & Chr$(0), n & Chr$(0))
  SetVolumeName = IIf(i = 0, False, True)
End Function

╚tenφ seriovΘho Φφsla disku

Private Declare Function GetVolumeInformation Lib "kernel32" Alias _
	"GetVolumeInformationA" (ByVal lpRootPathName As String, _
	ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, _
	lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, _
	lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, _
	ByVal nFileSystemNameSize As Long) As Long

Private Const MAX_FILENAME_LEN = 256

Public Function GetSerialNumber(sDrive As String) As Long
  Dim ser As Long, s As String * MAX_FILENAME_LEN
  Dim s2 As String * MAX_FILENAME_LEN,i As Long,j As Long  
   
  GetVolumeInformation _
    (sDrive + ":\" & Chr$(0), s,   MAX_FILENAME_LEN, ser, i, j, s2, MAX_FILENAME_LEN)
  GetSerialNumber = ser
End Function


⌐ 1999 Vogel Publishing, s. r. o.