system root

Just starting out? Need help? Post your questions and find answers here.
luke101
User
User
Posts: 36
Joined: Wed Sep 10, 2003 2:33 am

system root

Post by luke101 »

is there a way to get the system root folder in purebasic
pentium 90mhz, 32mb ram, 1mb video ram, 1gb hd, windows 95.
If it can run on mine it can run on anything

Staight outta Compton
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

Maybe this will answer to your post and more ...

Code: Select all

; English Forum:
; Author:
; Date: 17. February 2003

; Get system folder location...

#CSIDL_INTERNET = $1
#CSIDL_PROGRAMS = $2
#CSIDL_CONTROLS = $3
#CSIDL_PRINTERS = $4
#CSIDL_PERSONAL = $5 ; Use this instead of CSIDL_MYDOCUMENTS. I don't know why! Ask Microsoft...
#CSIDL_FAVORITES = $6
#CSIDL_STARTUP = $7
#CSIDL_RECENT = $8
#CSIDL_SENDTO = $9
#CSIDL_BITBUCKET = $A
#CSIDL_STARTMENU = $B
#CSIDL_MYDOCUMENTS = $C
#CSIDL_MYMUSIC = $D
#CSIDL_MYVIDEO = $E
#CSIDL_DESKTOPDIRECTORY = $10
#CSIDL_DRIVES = $11
#CSIDL_NETWORK = $12
#CSIDL_NETHOOD = $13
#CSIDL_FONTS = $14
#CSIDL_TEMPLATES = $15
#CSIDL_COMMON_STARTMENU = $16
#CSIDL_COMMON_PROGRAMS = $17
#CSIDL_COMMON_STARTUP = $18
#CSIDL_COMMON_DESKTOPDIRECTORY = $19
#CSIDL_APPDATA = $1A
#CSIDL_PRINTHOOD = $1B
#CSIDL_LOCAL_APPDATA = $1C
#CSIDL_ALTSTARTUP = $1D
#CSIDL_COMMON_ALTSTARTUP = $1E
#CSIDL_COMMON_FAVORITES = $1F
#CSIDL_INTERNET_CACHE = $20
#CSIDL_COOKIES = $21
#CSIDL_HISTORY = $22
#CSIDL_COMMON_APPDATA = $23
#CSIDL_WINDOWS = $24
#CSIDL_SYSTEM = $25
#CSIDL_PROGRAM_FILES = $26
#CSIDL_MYPICTURES = $27
#CSIDL_PROFILE = $28
#CSIDL_SYSTEMX86 = $29
#CSIDL_PROGRAM_FILESX86 = $2A
#CSIDL_PROGRAM_FILES_COMMON = $2B
#CSIDL_PROGRAM_FILES_COMMONX86 = $2C
#CSIDL_COMMON_TEMPLATES = $2D
#CSIDL_COMMON_DOCUMENTS = $2E
#CSIDL_COMMON_ADMINTOOLS = $2F
#CSIDL_ADMINTOOLS = $30
#CSIDL_CONNECTIONS = $31
#CSIDL_COMMON_MUSIC = $35
#CSIDL_COMMON_PICTURES = $36
#CSIDL_COMMON_VIDEO = $37
#CSIDL_RESOURCES = $38
#CSIDL_RESOURCES_LOCALIZED = $39
#CSIDL_COMMON_OEM_LINKS = $3A
#CSIDL_CDBURN_AREA = $3B
#CSIDL_COMPUTERSNEARME = $3D
#CSIDL_FLAG_PER_USER_INIT = $800
#CSIDL_FLAG_NO_ALIAS = $1000
#CSIDL_FLAG_DONT_VERIFY = $4000
#CSIDL_FLAG_CREATE = $8000
#CSIDL_FLAG_MASK = $FF00

Structure EMID
    cb.b
    abID.b[1]
EndStructure

Structure ITEMIDLIST
    mkid.EMID
EndStructure

Procedure.s GetSystemFolder (folder)
    *itemid.ITEMIDLIST = #NULL
    If SHGetSpecialFolderLocation_ (0, folder, @*itemid) = #NOERROR
        location$ = Space (#MAX_PATH)
        If SHGetPathFromIDList_ (*itemid, @location$)
            ProcedureReturn location$
        EndIf
    EndIf
EndProcedure

; D E M O . . .

folder$ = GetSystemFolder (#CSIDL_SYSTEM)
MessageRequester ("Result...", "The 'SYSTEM' folder is located in " + Chr (34) + folder$ + Chr (34), #MB_ICONINFORMATION)
End
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
fweil
Enthusiast
Enthusiast
Posts: 725
Joined: Thu Apr 22, 2004 5:56 pm
Location: France
Contact:

Post by fweil »

BTW you should download CodeArchiv to answer most the questions you have ... or search this forum.
My avatar is a small copy of the 4x1.8m image I created and exposed at 'Le salon international du meuble à Paris' january 2004 in Matt Sindall's 'Shades' designers exhibition. The original laminated print was designed using a 150 dpi printout.
luke101
User
User
Posts: 36
Joined: Wed Sep 10, 2003 2:33 am

Post by luke101 »

wow...thank you very much
pentium 90mhz, 32mb ram, 1mb video ram, 1gb hd, windows 95.
If it can run on mine it can run on anything

Staight outta Compton
Post Reply