It is currently Sun Nov 23, 2014 3:20 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Location of Windows system strings
PostPosted: Fri Oct 13, 2006 10:31 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2301
Location: Berlin, Germany
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.

_________________
Image
Windows 7, 64-Bit, PB v4.51 / Whose Hoff is it anyway?


Last edited by Fluid Byte on Thu Oct 09, 2008 12:55 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 13, 2006 10:47 pm 
Offline
Addict
Addict

Joined: Fri Apr 25, 2003 11:13 pm
Posts: 1073
Location: Netherlands
GetSystemMenu_() API and ModifyMenu_() should do imo.
See #SC_.. constants

_________________
Hellobasic website


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 14, 2006 8:55 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2301
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.

_________________
Image
Windows 7, 64-Bit, PB v4.51 / Whose Hoff is it anyway?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 8:44 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed Jan 18, 2006 7:40 pm
Posts: 105
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 9:33 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2301
Location: Berlin, Germany
Quote:
What function are you using to create the menus?
Are you using MenuTitle() and MenuItem() ?

See below:

Code:
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)


Quote:
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:

Quote:
6327, "Eine Datei mit dem angegebenen Namen ist bereits vorhanden. Geben Sie einen anderen Dateinamen an."

This is the german message for:

Quote:
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:

_________________
Image
Windows 7, 64-Bit, PB v4.51 / Whose Hoff is it anyway?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 19, 2006 10:26 pm 
Offline
Enthusiast
Enthusiast

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 11:47 am 
Offline
PureBatMan Forever
PureBatMan Forever
User avatar

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


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 6:34 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2301
Location: Berlin, Germany
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:

_________________
Image
Windows 7, 64-Bit, PB v4.51 / Whose Hoff is it anyway?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 21, 2006 12:37 am 
Offline
PureBatMan Forever
PureBatMan Forever
User avatar

Joined: Tue Feb 10, 2004 3:07 am
Posts: 2307
Location: Ohio, USA
You're welcome :)

_________________
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 22, 2006 3:49 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Aug 23, 2003 6:45 pm
Posts: 243
I have the same question for MessageRequester buttons!!
Where can i found "OK" and "Cancel" strings ???

Dri


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 3:21 am 
Offline
PureBatMan Forever
PureBatMan Forever
User avatar

Joined: Tue Feb 10, 2004 3:07 am
Posts: 2307
Location: Ohio, USA
MessageRequester button text can be found in user32.dll. :)

Image

_________________
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 23, 2006 9:22 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Aug 23, 2003 6:45 pm
Posts: 243
Thank you :D

Dri :o


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 09, 2008 3:30 am 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 21, 2006 4:41 am
Posts: 2301
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 *

_________________
Image
Windows 7, 64-Bit, PB v4.51 / Whose Hoff is it anyway?


Last edited by Fluid Byte on Mon Apr 06, 2009 6:27 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 09, 2008 1:00 pm 
Offline
PureBatMan Forever
PureBatMan Forever
User avatar

Joined: Tue Feb 10, 2004 3:07 am
Posts: 2307
Location: Ohio, USA
User32.dll > Menu > 80

_________________
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 09, 2008 1:12 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 11089
Location: France
The dark knight to the rescue :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye