Spetial folders

BlitzMax Forums/BlitzMax Programming/Spetial folders

Ziggy this code is not complete yet, the text comes out encrypted, so i am going now. But i will try and finish it tommorow, but if you want to try it out.

'Folders
Const CSIDL_PROGRAMS = 9 'Program Files

'Types
Type SHITEMID
	Field cb:Long
End Type

Type ITEMIDLIST
    Field mkid:SHITEMID = New SHITEMID
End Type

'WinApi Commands
Extern "Win32"
Function SHGetSpecialFolderLocation(hwndOwner, nFolder, pidl:ITEMIDLIST)
Function SHGetPathFromIDList( pidl ,pszPath:String )
End Extern

'Print
Print GetSpecialfolder()

'GetSpecialFolder Function
Function GetSpecialfolder()

	Local idlist:ITEMIDLIST= New ITEMIDLIST
	
	r=SHGetSpecialFolderLocation(0, CSIDL_PROGRAMS, idlist)
	
	Local path$=Chr(256)
	r = SHGetPathFromIDList(idlist.mkid.cb, path$)  
	dir$ = Trim(path$)
	Print dir$

End Function


Good Luck.