News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

My Douments, My Images...

Started by Grincheux, September 12, 2008, 05:18:13 AM

Previous topic - Next topic

Grincheux

With GetSpecialFolderLocation I cant get the folders of the specials folders such as "My Documents".

In French this folder is called "Mes Documents" and in English it is "My Documents". How is it possible to retrieve this name if I want to create a program which can run run in any language ? There is no CSIDL for this.
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

Tedd

Using SHGetSpecialFolderLocation (and then SHGetPathFromIDList to get the string)...

QuoteCSIDL_DESKTOP = "C:\Documents and Settings\user\Desktop"
CSIDL_PROGRAMS = "C:\Documents and Settings\user\Start Menu\Programs"
CSIDL_PERSONAL = "C:\Documents and Settings\user\My Documents"
CSIDL_FAVORITES = "C:\Documents and Settings\user\Favorites"
CSIDL_STARTUP = "C:\Documents and Settings\user\Start Menu\Programs\Startup"
CSIDL_RECENT = "C:\Documents and Settings\user\Recent"
CSIDL_SENDTO = "C:\Documents and Settings\user\SendTo"
CSIDL_STARTMENU = "C:\Documents and Settings\user\Start Menu"
CSIDL_MYMUSIC = "C:\Documents and Settings\user\My Documents\My Music"
CSIDL_MYVIDEO = "C:\Documents and Settings\user\My Documents\My Videos"
CSIDL_DESKTOPDIRECTORY = "C:\Documents and Settings\user\Desktop"
CSIDL_NETHOOD = "C:\Documents and Settings\user\NetHood"
CSIDL_FONTS = "C:\WINDOWS\Fonts"
CSIDL_TEMPLATES = "C:\Documents and Settings\user\Templates"
CSIDL_COMMON_STARTMENU = "C:\Documents and Settings\All Users\Start Menu"
CSIDL_COMMON_PROGRAMS = "C:\Documents and Settings\All Users\Start Menu\Programs"
CSIDL_COMMON_STARTUP = "C:\Documents and Settings\All Users\Start Menu\Programs\Startup"
CSIDL_COMMON_DESKTOPDIRECTORY = "C:\Documents and Settings\All Users\Desktop"
CSIDL_APPDATA = "C:\Documents and Settings\user\Application Data"
CSIDL_PRINTHOOD = "C:\Documents and Settings\user\PrintHood"
CSIDL_LOCAL_APPDATA = "C:\Documents and Settings\user\Local Settings\Application Data"
CSIDL_COMMON_FAVORITES = "C:\Documents and Settings\All Users\Favorites"
CSIDL_INTERNET_CACHE = "C:\Documents and Settings\user\Local Settings\Temporary Internet Files"
CSIDL_COOKIES = "C:\Documents and Settings\user\Cookies"
CSIDL_HISTORY = "C:\Documents and Settings\user\Local Settings\History"
CSIDL_COMMON_APPDATA = "C:\Documents and Settings\All Users\Application Data"
CSIDL_SYSTEM = "C:\WINDOWS\system32"
CSIDL_PROGRAM_FILES = "C:\Program Files"
CSIDL_MYPICTURES = "C:\Documents and Settings\user\My Documents\My Pictures"
CSIDL_PROFILE = "C:\Documents and Settings\user"
CSIDL_SYSTEMX86 = "C:\WINDOWS\system32"
CSIDL_PROGRAM_FILES_COMMON = "C:\Program Files\Common Files"
CSIDL_COMMON_TEMPLATES = "C:\Documents and Settings\All Users\Templates"
CSIDL_COMMON_DOCUMENTS = "C:\Documents and Settings\All Users\Documents"
CSIDL_COMMON_ADMINTOOLS = "C:\Documents and Settings\All Users\Start Menu\Programs\Administrative Tools"
CSIDL_COMMON_MUSIC = "C:\Documents and Settings\All Users\Documents\My Music"
CSIDL_COMMON_PICTURES = "C:\Documents and Settings\All Users\Documents\My Pictures"
CSIDL_COMMON_VIDEO = "C:\Documents and Settings\All Users\Documents\My Videos"
CSIDL_RESOURCES = "C:\WINDOWS\Resources"
CSIDL_CDBURN_AREA = "C:\Documents and Settings\user\Local Settings\Application Data\Microsoft\CD Burning"
No snowflake in an avalanche feels responsible.

Grincheux

I tryed this for getting the place where these folders are, but I want to have the name of the folder "My Documents" for French, Spanish German and I don't know where to get it. This also is for "My Videos"...
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

Grincheux

With "RegEdit" I found that "My Documents" was redefined, is there the same thing for Windows, because some people don't have MS Office.

Quote[HKEY_CURRENT_USER\Software\Microsoft\Office\9.0\Common\General]
"MyDocuments"="Mes documents"
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

Uzarius Futurus

Quote from: Grincheux on September 12, 2008, 05:18:13 AM
With GetSpecialFolderLocation I cant get the folders of the specials folders such as "My Documents".

In French this folder is called "Mes Documents" and in English it is "My Documents". How is it possible to retrieve this name if I want to create a program which can run run in any language ? There is no CSIDL for this.

Using the registry you can also retrieve the information about the folders from the following location:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
There are keys like: "My Music", "My Pictures" and "Personal".
The "Personal"-key is the "My Documents" folder that you are looking for.

Grincheux

Thisd is the same as GetSpecialFolderLocation. I don't want the folder, I want the VIRTUAL NAME.
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

BlackVortex

Quote from: Grincheux on September 12, 2008, 04:00:20 PM
Thisd is the same as GetSpecialFolderLocation. I don't want the folder, I want the VIRTUAL NAME.
And what exactly does the GetSpecialFolderLocation method give you in your language of windows ? Can't you cut the string to get just the last part ? Or isn't it the same ?

Grincheux

I thought that it was easier to retrieve the virtual name of this folder.

The best thing I have to do is to setup a *.ini file for any language like this

[English]
My Documents=My Documents
My Music=My Music

[French]
My Documents=Mes Documents
Shared Folders=Documents partagés
.
.
.

[German]
My Documents=?

[Spanish]
My Documents=?

That's all !
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz

Grincheux

I found the solution !

First : You call GetSpecialFolderLocation (See Tedd answer)

Second : You call PathStripPath

Example :

INVOKE SHGetSpecialFolderPath,NULL,ADDR szMyPictures,CSIDL_MYPICTURES,TRUE
INVOKE PathStripPath,ADDR szMyPictures


The first line gives : C:\Documents and Settings\UserName\My Pictures
The Second line gives : My Pictures

I think that this can be right for every language.

Thanks for all the members who helped me.
Kenavo

Grincheux
_____________________________________________________
http://www.phrio.biz