Try my new website:
www.urcho.com
- the new SIMPLE social network
Sign up
|
284
members |
114
snippets
Search for:
ALL
POPULAR
File Controls
Multiplayer Code
2D Effects
3D Effects
Oldskool demos
Basic Functions
Maths/Physics
Sound
Tutorials
Misc
Username:
Password:
Sign up
find mydocuments by b32
[
back
]
Author:
Archive
| Viewed:
585
times | Language:
BlitzBasic 3D
| Category:
File Controls
;Save these lines as a textfile in the directory c:\program files\blitz3d\userlibs ;and call the file 'shell32.decls' ;------------------------------------- ;.lib "shell32.dll" ;api_GetFolderPath%(hwnd, p1, p2, p3, out*) : "SHGetFolderPathA" ;------------------------------------- ;it will enable the api_getfolderpath command Print GetMyDocumentsPath$() WaitKey() End ;------------------------------------------------------------------------------------------------------- ; GetMyDocumentsPath() ;------------------------------------------------------------------------------------------------------- ;uses SHGetFolderPathA to get the mydocuments folder Function GetMyDocumentsPath$() bank = CreateBank(256) api_GetFolderPath(0, $5, 0, 0, bank) s$ = "" For i = 0 To 255 b = PeekByte(bank, i) If b = 0 Then Exit s$ = s$ + Chr$(b) Next FreeBank bank If Right$(s$, 1) <> "\" Then s$ = s$ + "\" Return s$ End Function
Author Comments:
Uses SHGetFolderPathA to obtain the mydocuments folder path.
Login or
create an account
to comment on this snippet