PureBasic Code-Archive v1.6

Share your advanced PureBasic knowledge/code with the community.
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Get Special folders

Post by NoahPhense »

high key wrote:I didn't find a code for special folders in André's CodeArchive, so I converted the example from the API-Guide:

Code: Select all

Declare.s GetSpecialfolder(CSIDL)


#CSIDL_DESKTOP = 0
#CSIDL_PROGRAMS = 2
#CSIDL_CONTROLS = 3
#CSIDL_PRINTERS = 4
#CSIDL_PERSONAL = 5
#CSIDL_FAVORITES = 6
#CSIDL_STARTUP = 7
#CSIDL_RECENT = 8
#CSIDL_SENDTO = 9
#CSIDL_BITBUCKET = $A
#CSIDL_STARTMENU = $B
#CSIDL_DESKTOPDIRECTORY = $10
#CSIDL_DRIVES = $11
#CSIDL_NETWORK = $12
#CSIDL_NETHOOD = $13
#CSIDL_FONTS = $14
#CSIDL_TEMPLATES = $15




Structure shItemID
    cb.l
    abID.b 
EndStructure

Structure ItemIDlist
    mkid.shItemID
EndStructure


a$= "Start menu folder: " + GetSpecialfolder(#CSIDL_STARTMENU)
b$= "Favorites folder: " + GetSpecialfolder(#CSIDL_FAVORITES)
c$= "Programs folder: " + GetSpecialfolder(#CSIDL_PROGRAMS)
d$= "Desktop folder: " + GetSpecialfolder(#CSIDL_DESKTOP)
e$= "Startup folder: " + GetSpecialfolder(#CSIDL_STARTUP)

   
MessageRequester("Info",a$+Chr(13)+b$+Chr(13)+c$+Chr(13)+d$+chr$(13)+e$,0)



Procedure.s GetSpecialfolder(CSIDL)
   
    r = SHGetSpecialFolderLocation_(0, CSIDL, @IDL.ITEMIDLIST)
    If r = #NOERROR
        Path$ = Space(512)
        r = SHGetPathFromIDList_(IDL\mkid\cb, Path$)
        folder$ = Trim(Path$)        
       Else
        folder$="" 
    EndIf
    
    ProcedureReturn folder$
    
EndProcedure
Sweet!

- np
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

hey andre, the format of the english page of the archiv is sometimes a bit irregular (indents)

by the way, x_lib is NOT a winsock lib, it's just a collection of procedures
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2137
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post by Andre »

blueznl wrote:hey andre, the format of the english page of the archiv is sometimes a bit irregular (indents)

by the way, x_lib is NOT a winsock lib, it's just a collection of procedures
I can't see any false indents, especially there are no differences between german/english/french sites.

About x_lib I will notice it :wink:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Hi Andre, please update some of the elastic collision code (at Graphics-Sprites-Collision section in purearea.net) with whatever you prefer codes inside my final updated codes: http://perso.wanadoo.es/akloiv/ElasticCollision.zip

Thanks a lot :wink:
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

..

Post by NoahPhense »

VIRTUALYS wrote:thanks for all, Andre.

Great Work!.... :wink:


VIRTUALYS for U 8)
http://www.virtuafx.com
You still alive? You created an awesome progressbarEx.. then poof!

- np
Post Reply