Hello all,
I am developing a PB application which will run on a Windows Vista. The Vista is in portuguese language (pt -pt). 
I need to find out how I can get the path for the ALL USERS startup folder using PB.
In english it would be "c:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
Perhaps I should hard code the path instead of going to registry as this application is only for portuguese users. Could anyone tell me how the path would be in portuguese language ?
Thanks a lot,
Mauver
			
			
									
									
						PB 4.20 and Windows Vista Portuguese Environment
Code: Select all
Procedure.s SpecialFolder(folderno)
  Protected listptr=0
  Protected result$=Space(270)
  SHGetSpecialFolderLocation_(0,folderno,@listptr)
  SHGetPathFromIDList_(listptr,@result$)
  ProcedureReturn Trim(result$)
EndProcedure 
Debug SpecialFolder(#CSIDL_COMMON_STARTUP)- 
				Num3
 - PureBasic Expert

 - Posts: 2812
 - Joined: Fri Apr 25, 2003 4:51 pm
 - Location: Portugal, Lisbon
 - Contact:
 
The code posted above is the best way to determine the path, which in Portuguese Windows Vista is "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup".
In the explorer bar it comes up has a virtual path:
">>Windows > Menu Iniciar > Programas > Arranque" but the hardcoded path is the one above!
			
			
									
									
						In the explorer bar it comes up has a virtual path:
">>Windows > Menu Iniciar > Programas > Arranque" but the hardcoded path is the one above!
Thanks Cas. The code works perfectly.
Num3, yes, that virtual path was confusing me. Thanks for that. Just to clarify, the hard coded path for "Documents" for a given user on Vista in portuguese would be "c:\Users\%username%\Documents" ?
Hey Marco, that avatar means that nothing in this life is 100% absolute.
This Simbol(Yin-Yang) represents the ancient Chinese understanding of how things work. The outer circle represents "everything", while the black and white shapes within the circle represent the interaction of two energies, called "yin" (black) and "yang" (white), which cause everything to happen. They are not completely black or white, just as things in life are not completely black or white, and they cannot exist without each other.
			
			
									
									
						Num3, yes, that virtual path was confusing me. Thanks for that. Just to clarify, the hard coded path for "Documents" for a given user on Vista in portuguese would be "c:\Users\%username%\Documents" ?
Hey Marco, that avatar means that nothing in this life is 100% absolute.
This Simbol(Yin-Yang) represents the ancient Chinese understanding of how things work. The outer circle represents "everything", while the black and white shapes within the circle represent the interaction of two energies, called "yin" (black) and "yang" (white), which cause everything to happen. They are not completely black or white, just as things in life are not completely black or white, and they cannot exist without each other.
- 
				Num3
 - PureBasic Expert

 - Posts: 2812
 - Joined: Fri Apr 25, 2003 4:51 pm
 - Location: Portugal, Lisbon
 - Contact:
 
Well since my Vista is connecting to a server, my path is "C:\Users\utilizador\Documents", but if i work offline, directly on the harddrive it's "C:\Users\%usernamehere%\Documents".jmauver wrote:Thanks Cas. The code works perfectly.
Num3, yes, that virtual path was confusing me. Thanks for that. Just to clarify, the hard coded path for "Documents" for a given user on Vista in portuguese would be "c:\Users\%username%\Documents" ?
But...
At home i've changed the Documents folder to Drive D:\Documentos\, so you better use the code posted with:
Code: Select all
Debug SpecialFolder(#CSIDL_MYDOCUMENTS)

