News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Resource String Table

Started by guga, October 05, 2020, 07:52:08 PM

Previous topic - Next topic

guga

Quote from: hutch-- on October 13, 2020, 07:43:20 AM
Guga,

It looks OK but the simplest way to test it is to build it with RC.EXE. The version you posted is single character ANSI text version but you can also create RC scripts in UNICODE if you need to, all you need is a UNICODE text editor.

Hi Steve. Tks.

But for Unicode you mean exporting the whole file as Unicode version or putting the Unicode Token "L" and the hexadecimal chars following it ?

From M$, this is what can be done for unicode:

STRINGTABLE
BEGIN
IDS_1 L"5\x00BC-Inch Floppy Disk"
IDS_1a "5\xBC-Inch Floppy Disk"
IDS_2 L"Don't confuse \x2229 (intersection) with \x222A (union)"
IDS_3 "Copyright \xA92001"
IDS_3a L"Copyright \x00a92001"
END

or

STRINGTABLE
BEGIN
IDS_CHINESESTRING L"\x5e2e\x52a9"
IDS_RUSSIANSTRING L"\x0421\x043f\x0440\x0430\x0432\x043a\x0430"
IDS_ARABICSTRING L"\x062a\x0639\x0644\x064a\x0645\x0627\x062a"
END


Can i replace all the hexadecimal tokens with their own Unicode chars ? Is that it ?

https://docs.microsoft.com/en-us/windows/win32/menurc/stringtable-resource
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

hutch--

Just make the RC file FULL unicode and you can add foreign characters with no problems. The RCD format was designed to be unicode so its easy enough to do. You need a unicode editor to write the scripts.

guga

Quote from: hutch-- on October 13, 2020, 08:25:20 AM
Just make the RC file FULL unicode and you can add foreign characters with no problems. The RCD format was designed to be unicode so its easy enough to do. You need a unicode editor to write the scripts.

Hmm...Maybe it can be done directly with RichedEdit50W inserted on a dialogbox. Once i finish fixing the other resources issues and making it import and export ".res" filees, i´ll then try to export the resources in Unicode rc script for masm syntax. RosAsm don´t uses this kind of script, but it can be easily exported to make it work in masm, i presume. I remember Ewayne did a nice resources editor using the scripts  long time ago. I´ll see if i still have it somewhere to understand better the syntax.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

jj2007

Example attached - open the *.asc in RichMasm and hit F6. Afterwards you'll have a full Unicode rc file in the current folder.

guga

Quote from: jj2007 on October 13, 2020, 10:20:53 AM
Example attached - open the *.asc in RichMasm and hit F6. Afterwards you'll have a full Unicode rc file in the current folder.

Great ! Many Tks, JJ.

A few questions.

1 - How you managed to make MasmBasic display the unicode Chars ? Did you used RichedEdit50W ? (If you have a masm example of a richedit control  - either from a dialogbox of a regular windows - allowing to display and save unicode can you post it, please ?)
2 - About the yellow (and white) line as a background on the text. How you did that ?

Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

jj2007

RichMasm uses RichEdit20A.

I don't have a simple MASM example at hand, but here is a MasmBasic application that loads a plain text or RTF file passed in the commandline into a RichEdit control (it uses RichEdit20W):
include \masm32\MasmBasic\Res\MbGui.asm
  GuiControl TheEdit, "richedit", wCL$()
GuiEnd


Note that while you can use RichEd20.dll from C:\Windows\System32, there are better versions that come with M$ Office. The snippet above will try to load C:\Program Files (x86)\Common Files\microsoft shared\OFFICE11\RICHED20.DLL; you can check your version by inserting fdeb 1, "test", $RichEditUsed after the GuiControl line above. Hit F6 to build it again.


As to the background colour stuff, see EM_SETCHARFORMAT and CF?_BACKCOLOR