Location of Windows system strings
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Location of Windows system strings
I'm working on a custom GUI set and I also want to completely modify the look of a window system menu. In order to be 100% compatible I always want to display the strings in the corresponding OS language. Currently all items are in english but if you run it on a german OS the menu item labels should be in german as well.
So does anybody know where these specific strings are stored? I already checked shell32.dll and user32.dll with a resource editor. Haven't found aynthing close to this.
So does anybody know where these specific strings are stored? I already checked shell32.dll and user32.dll with a resource editor. Haven't found aynthing close to this.
Last edited by Fluid Byte on Thu Oct 09, 2008 12:55 pm, edited 1 time in total.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
-
- Addict
- Posts: 1073
- Joined: Fri Apr 25, 2003 11:13 pm
- Location: Netherlands
- Contact:
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
I can't use GetSystemMenu_() because my windows don't have the #WM_SYSMENU style. It's a little complicated to explain but it has to do with my way of event processing. So I'm stll interested where these strings are stored.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
-
- Enthusiast
- Posts: 105
- Joined: Wed Jan 18, 2006 7:40 pm
- Location: Hamburg
What function are you using to create the menus?
Are you using MenuTitle() and MenuItem() ?
Anyway, if you run a normal windows, that is one especial for the country it it intedet to sell to,
I don't think you will find any translated strings in the Windows DLLs,
as they are localiced to the specific country.
Same goes for system error messages, if you have an english Windows installed, you will only get the english error messages.
I could be wrong, but I think this is an MS thing for not being able to sell copies from one country to another.
There are multilingual Windows version, but most are not.
Just tried Windows function FormatMessage() with different language IDs,
for anything but the default language ID (which is 0), it will not return any string.
BTW: If you use fixed strings with MenuTitle/MenuItem ( for example MenuTitle("&File") ), you will never
get any automatic translation, because they are passed as they are written in your program.
Are you using MenuTitle() and MenuItem() ?
Anyway, if you run a normal windows, that is one especial for the country it it intedet to sell to,
I don't think you will find any translated strings in the Windows DLLs,
as they are localiced to the specific country.
Same goes for system error messages, if you have an english Windows installed, you will only get the english error messages.
I could be wrong, but I think this is an MS thing for not being able to sell copies from one country to another.
There are multilingual Windows version, but most are not.
Just tried Windows function FormatMessage() with different language IDs,
for anything but the default language ID (which is 0), it will not return any string.
BTW: If you use fixed strings with MenuTitle/MenuItem ( for example MenuTitle("&File") ), you will never
get any automatic translation, because they are passed as they are written in your program.
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
See below:What function are you using to create the menus?
Are you using MenuTitle() and MenuItem() ?
Code: Select all
hMenuSys = CreatePopupMenu(0)
MenuItem(#SC_RESTORE,"Restore")
MenuItem(#SC_MOVE,"Move")
MenuItem(#SC_SIZE,"Size")
MenuItem(#SC_MINIMIZE,"Minimize")
MenuItem(#SC_MAXIMIZE,"Maximize")
MenuBar()
MenuItem(#SC_CLOSE,"Close" + Chr(9) + "Alt+F4")
lpmii.MENUITEMINFO
lpmii\cbSize = SizeOf(MENUITEMINFO)
lpmii\fMask = #MIIM_STATE
lpmii\fState = #MFS_DEFAULT
SetMenuItemInfo_(hMenuSys,#SC_RESTORE,0,lpmii)
I think you misundertsand me here. I'm not looking for translated strings nor do I want to detect wich language an OS is running to translate my menu strings acordingly. I am looking for their location as they are stored in a system DLL or similar. Just like any other language dependent string.Anyway, if you run a normal windows, that is one especial for the country it it intedet to sell to, I don't think you will find any translated strings in the Windows DLLs, as they are localiced to the specific country.
Just an example:
1.) Get a resource editor like ResourceHacker
2.) Open shell32.dll
3.) Open the "String Table" resource
4.) Open Item #396 and view it's content
If you done everything right you should see the following data:
This is the german message for:6327, "Eine Datei mit dem angegebenen Namen ist bereits vorhanden. Geben Sie einen anderen Dateinamen an."
So this particular string has an ID of #6327. This indentifier is equal on ALL Windows Systems. So if you now create an application and load the string from the shell32.dll with the ID of #6327 it will output the same result regardless wich language your OS is running in.6327, "A file with the specified name already exists. Enter another filename."
Hope the helped to clarify my request.
PS: Ich komm' auch aus Hamburg!
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
-
- Enthusiast
- Posts: 105
- Joined: Wed Jan 18, 2006 7:40 pm
- Location: Hamburg
Hi Fluid Byte,
nice to see a fellow "hamburger"
Ok, I got me the ResourceHacker and used it as in your example
and got the same result, but now I'm confused,
what strings are you looking for exactly?
Are you looking for the "File", "Edit" ... or their german counterparts "Datei", "Bearbeiten" ... ?
Oh, and if you try to do a full text search on the Windows directory, you have to search for Unicode strings,
as that is the format they are stored in the DLLs, (at least here on XP)
and when you request such string for a Ansi program (unicode disabled under PB for example) it is coverted to Ansi on the fly.
So using the Windows find will not be of any help I think, as it only searches for Ansi (8-bit) strings.
You can use PSPad (free software), a mighty text editor, it has a build in file text search,
but you can also search for UTF-8 / UTF-16 strings in files.
It will list the found files and all locations of the strings within the files.
PSPad also has a hex editing function.
Hope that helps.
nice to see a fellow "hamburger"
Ok, I got me the ResourceHacker and used it as in your example
and got the same result, but now I'm confused,
what strings are you looking for exactly?
Are you looking for the "File", "Edit" ... or their german counterparts "Datei", "Bearbeiten" ... ?
Oh, and if you try to do a full text search on the Windows directory, you have to search for Unicode strings,
as that is the format they are stored in the DLLs, (at least here on XP)
and when you request such string for a Ansi program (unicode disabled under PB for example) it is coverted to Ansi on the fly.
So using the Windows find will not be of any help I think, as it only searches for Ansi (8-bit) strings.
You can use PSPad (free software), a mighty text editor, it has a build in file text search,
but you can also search for UTF-8 / UTF-16 strings in files.
It will list the found files and all locations of the strings within the files.
PSPad also has a hex editing function.
Hope that helps.
I found them in user32.dll.
You can load the menu resource with LoadMenu_(), get the text using GetMenuString_() for each item, then discard the menu resource when done with DestroyMenu_().
Here are the item ID's if needed:
You can load the menu resource with LoadMenu_(), get the text using GetMenuString_() for each item, then discard the menu resource when done with DestroyMenu_().
Here are the item ID's if needed:
Code: Select all
#SysMenu_Restore = 61728
#SysMenu_Move = 61456
#SysMenu_Size = 61440
#SysMenu_Minimize = 61472
#SysMenu_Maximize = 61488
#SysMenu_Close = 61536
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
PB 5.21 LTS (x86) - Windows 8.1
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Sparkie's da man bitches! W000t!?!?
Thank's a bunch mate you saved my day!
Actually I was looking in the user32.dll too but seemed to be too blind.
Oh well... :roll:
Also thanks to technicorn for trying to solving this issue
Thank's a bunch mate you saved my day!
Actually I was looking in the user32.dll too but seemed to be too blind.
Oh well... :roll:
Also thanks to technicorn for trying to solving this issue
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
This is oooooooooooold, I know!
But this time I need the location of the strings for the popup menu of Windows system scrollbars.
* ACTIVATES BATSIGNAL *
But this time I need the location of the strings for the popup menu of Windows system scrollbars.
* ACTIVATES BATSIGNAL *
Last edited by Fluid Byte on Mon Apr 06, 2009 6:27 pm, edited 1 time in total.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?