Location of Windows system strings

Windows specific forum
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Location of Windows system strings

Post by Fluid Byte »

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.
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?
Edwin Knoppert
Addict
Addict
Posts: 1073
Joined: Fri Apr 25, 2003 11:13 pm
Location: Netherlands
Contact:

Post by Edwin Knoppert »

GetSystemMenu_() API and ModifyMenu_() should do imo.
See #SC_.. constants
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

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?
technicorn
Enthusiast
Enthusiast
Posts: 105
Joined: Wed Jan 18, 2006 7:40 pm
Location: Hamburg

Post by technicorn »

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.
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

What function are you using to create the menus?
Are you using MenuTitle() and MenuItem() ?
See below:

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)
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.
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.

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:
6327, "Eine Datei mit dem angegebenen Namen ist bereits vorhanden. Geben Sie einen anderen Dateinamen an."
This is the german message for:
6327, "A file with the specified name already exists. Enter another filename."
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.

Hope the helped to clarify my request.

PS: Ich komm' auch aus Hamburg! :wink:
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
technicorn
Enthusiast
Enthusiast
Posts: 105
Joined: Wed Jan 18, 2006 7:40 pm
Location: Hamburg

Post by technicorn »

Hi Fluid Byte,

nice to see a fellow "hamburger" :P

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.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

I found them in user32.dll.

Image

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
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

Sparkie's da man bitches! W000t!?!? :shock:

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 :wink:
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

You're welcome :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

I have the same question for MessageRequester buttons!!
Where can i found "OK" and "Cancel" strings ???

Dri
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

MessageRequester button text can be found in user32.dll. :)

Image
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Dr. Dri
Enthusiast
Enthusiast
Posts: 243
Joined: Sat Aug 23, 2003 6:45 pm

Post by Dr. Dri »

Thank you :D

Dri :o
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

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 *
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?
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

User32.dll > Menu > 80
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Fred
Administrator
Administrator
Posts: 16581
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

The dark knight to the rescue :)
Post Reply