Decompile CHM file; Get short/long path

Functions, classes, components, etc. Only high quality content.

Decompile CHM file; Get short/long path

Postby Gintaras on Sun Jun 11, 2006 4:57 pm

Function DecompileChmFile
;/
function $chmFile $destFolder

;EXAMPLE
;DecompileChmFile "$qm$\qm2help.chm" "$desktop$\qm2help"



mkdir destFolder

str f.GetShortPath(destFolder)
str c.GetShortPath(chmFile)
str cl.format("-decompile %s %s" f c)
run "hh.exe" cl "" "" 0x400



Member function str.GetShortPath
function [$path]

;Retrieves short path, eg c:\program files -> c:\progra~1


dll kernel32 #GetShortPathName $lpszLongPath $lpszShortPath cchBuffer

if(len(path)) _s.expandpath(path); else _s.expandpath(this)
this.fix(GetShortPathName(_s this.all(MAX_PATH) MAX_PATH))



Member function str.GetLongPath
function [$path]

;Retrieves long path, eg c:\progra~1 -> c:\program files


dll kernel32 #GetLongPathName $lpszShortPath $lpszLongPath cchBuffer

if(len(path)) _s.expandpath(path); else _s.expandpath(this)
this.fix(GetLongPathName(_s this.all(MAX_PATH) MAX_PATH))

Gintaras
Site Admin
 
Posts: 5757
Joined: Thu Dec 19, 2002 7:36 pm
Location: Lithuania

Return to QM Extensions

Who is online

Users browsing this forum: No registered users and 0 guests

cron