How can I find resource values like Cut/Copy/Paste names in Win?
-
I want to get international names of menu items on mouse right click. How to get them using standard .net classes without using Win functions? Hi, AW
-
I want to get international names of menu items on mouse right click. How to get them using standard .net classes without using Win functions? Hi, AW
ResX files. Read about localization in the .NET Framework and see the
ResourceManager
class documentation for details and examples. Basically, you use ResX files to store localized strings for your application. For properly named ResX files (like ClassName.de.resx for culture-neutral German language), a satellite assembly is created that the CLR loads when theThread.CurrentUICulture
is set to something other than the neutral resources language (the language of the resource in your source code, see also theNeutralResourcesLanguageAttribute
for more information and use this to increase assembly resolution performance). You'll have to put all the values for Cut, Copy, Paste, and anything else in the ResX files. I recommend using a Singleton pattern for theResourceManager
like Microsoft does so that you can 1) eliminate wasted memory resources by having a single instance of aResourceManager
, and 2) easily share localized resources amongst many classes. If you use a disassembler or decompiler to look at Microsoft's BCL assemblies, you'll notice this in theirSR
classes (usually one per assembly). This won't get them from Windows, but there really isn't a way to do that. Windows MUI usually stores localized resources per application or library. This way with .NET is pretty much the same thing (specially named libraries or similarly named libraries in specially name directories is common).-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
ResX files. Read about localization in the .NET Framework and see the
ResourceManager
class documentation for details and examples. Basically, you use ResX files to store localized strings for your application. For properly named ResX files (like ClassName.de.resx for culture-neutral German language), a satellite assembly is created that the CLR loads when theThread.CurrentUICulture
is set to something other than the neutral resources language (the language of the resource in your source code, see also theNeutralResourcesLanguageAttribute
for more information and use this to increase assembly resolution performance). You'll have to put all the values for Cut, Copy, Paste, and anything else in the ResX files. I recommend using a Singleton pattern for theResourceManager
like Microsoft does so that you can 1) eliminate wasted memory resources by having a single instance of aResourceManager
, and 2) easily share localized resources amongst many classes. If you use a disassembler or decompiler to look at Microsoft's BCL assemblies, you'll notice this in theirSR
classes (usually one per assembly). This won't get them from Windows, but there really isn't a way to do that. Windows MUI usually stores localized resources per application or library. This way with .NET is pretty much the same thing (specially named libraries or similarly named libraries in specially name directories is common).-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
I thought I can get option names from standard context menu for right mouse click. Thx. Hi, AW