Hi,
Can anyone help me with some sample code of PathCompactPath, or PathCompactPathEx?
I'm struggling here! And also what to $include or $use, etc
Thanks a lot,
Brian
I've never heard of this function before but I think it can be handy! Here's a small sample
$INCLUDE "windowssdk.inc"
$INCLUDE "Shlwapi.inc"
OPENCONSOLE
PRINT "Starting..."
PRINT ""
DoSomething()
PRINT ""
PRINT "Press any key to exit"
DO:UNTIL INKEY$ <> ""
CLOSECONSOLE
END
SUB DoSomething()
string path = ""
HWND myconsole = GetConsoleWindow()
IF myconsole THEN
HDC mydc = GetDC(myconsole)
IF mydc THEN
path = "C:\\path1\\path2\\sample.txt"
PathCompactPath(mydc, path , 125)
print path
path = "C:\\path1\\path2\\sample.txt"
PathCompactPath(mydc, path , 70)
print path
path = "C:\\path1\\path2\\sample.txt"
PathCompactPath(mydc, path , 30)
print path
ReleaseDC(myconsole, mydc)
ENDIF
ENDIF
ENDSUB
Thanks, Fasecero,
I reckon I was over-thinking it - you have made it look so easy
Brian