AllApi.net

[an error occurred while processing this directive]
 
Const OFS_MAXPATHNAME = 128
Const OF_CREATE = &H1000
Const OF_READ = &H0
Const OF_WRITE = &H1
Private Type OFSTRUCT
        cBytes As Byte
        fFixedDisk As Byte
        nErrCode As Integer
        Reserved1 As Integer
        Reserved2 As Integer
        szPathName(OFS_MAXPATHNAME) As Byte
End Type
Private Declare Function CopyLZFile Lib "lz32" (ByVal n1 As Long, ByVal n2 As Long) As Long
Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net    
    Dim sFile As String, hDecomp As Long, hResult As Long
    Dim OF As OFSTRUCT, sSaveTo As String
    'Ask for a file to decompress
    sFile = InputBox("Please, enter a file to decompress.")
    'Ask for a file to decompress it to
    sSaveTo = InputBox("Please, enter a filename to decompress it to.")
    'Open the two files
    hDecomp = OpenFile(sFile, OF, OF_READ)
    hResult = OpenFile(sSaveTo, OF, OF_WRITE Or OF_CREATE)
    'decompress the file
    CopyLZFile hDecomp, hResult
    'Close the two files
    CloseHandle hDecomp
    CloseHandle hResult
    Unload Me
End Sub


 
Copyright © 1998-2000, The KPD-Team.
Send mail to KPDTeam@Allapi.net with comments about this web site.
This site is located at
http://www.Allapi.net/