Hmm posting the source well.. you c teh problem is that i want this application to mine and not for everyone to c simele tough it is.... I c your point tough, and im posting only the essential code
Code: Select all
Procedure DeCompressFile()
CommandLine.s = "-d -qqq -f -v"
CommandLine = CommandLine.s + " -o"+DOSFilePath+DOSFileName+" "+DOSFilePath+TmpFileName
RealFile = RenameFile(DOSFilePath+DOSFileName,DOSFilePath+TmpFileName)
TimeStart=GetTickcount_()
StatusBarText(#STATUSBARGADGET, 0, " Please wait while decompressing...")
RunProgram(ExpandUPX_Location, CommandLine, "", 1|2)
TimeEnd=GetTickcount_()
LoadFileInfo()
StatusBarText(#STATUSBARGADGET, 0, " Decompression Complete in "+StrF((TimeEnd-TimeStart)/1000,2)+" Sec")
MessageRequester("Decompression Complete!","UPX Shell:"+Chr(13)+"Decompression Complete!"+Chr(13)+Chr(13)+"Decompression Time: "+StrF((TimeEnd-TimeStart)/1000,2)+" Sec.",#MB_ICONINFORMATION)
DeleteFile(DOSFilePath+TmpFileName)
RenameFile(DOSFilePath+DOSFileName,DOSFilePath+FileName)
;Reset_Form()
EndProcedure
Procedure CompressFile()
CommandLine.s = ""
If GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Best Compression Method"
CommandLine.s = CommandLine.s + "--best"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Better Compression Method"
CommandLine.s = CommandLine.s + "-9"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Good Compression Method"
CommandLine.s = CommandLine.s + "-8"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Normal Compression Method"
CommandLine.s = CommandLine.s + "-5"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Fast Compression Method"
CommandLine.s = CommandLine.s + "-4"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Faster Compression Method"
CommandLine.s = CommandLine.s + "-3"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Fastest Compression Method"
CommandLine.s = CommandLine.s + "-2"
ElseIf GetGadgetText(#LISTBOXGADGET_ACTIONS) = "Store Compression Method"
CommandLine.s = CommandLine.s + "-1"
EndIf
If GetGadgetState(#CHECKBOXGADGET_BACKUP) = 1
BackUp = CopyFile(DOSFilePath+DOSFileName, DOSFilePath+FileName+".bak")
EndIf
CommandLine.s = CommandLine.s + " -qqq -f -v --overlay=copy --compress-exports=1 --compress-icons=2 --strip-relocs=1"; --all-methods --all-filters"
CommandLine = CommandLine.s + " -o"+DOSFilePath+DOSFileName+" "+DOSFilePath+TmpFileName
RenameFile(DOSFilePath+DOSFileName,DOSFilePath+TmpFileName)
TimeStart=GetTickcount_()
StatusBarText(#STATUSBARGADGET, 0, " Please wait while compressing...")
RunProgram(ExpandUPX_Location, CommandLine, "", 1|2)
TimeEnd=GetTickcount_()
LoadFileInfo()
StatusBarText(#STATUSBARGADGET, 0, " Compression Complete in "+StrF((TimeEnd-TimeStart)/1000,2)+" Sec")
MessageRequester("Compression Complete!","UPX Shell:"+Chr(13)+"Compression Complete!"+Chr(13)+Chr(13)+"Compression Time: "+StrF((TimeEnd-TimeStart)/1000,2)+" Sec.",#MB_ICONINFORMATION)
DeleteFile(DOSFilePath+TmpFileName)
RenameFile(DOSFilePath+DOSFileName,DOSFilePath+FileName)
SetClipboardText(CommandLine)
;Reset_Form()
EndProcedure