The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: RuiLoureiro on November 02, 2008, 12:12:03 PM

Title: Captions in Dialogs
Post by: RuiLoureiro on November 02, 2008, 12:12:03 PM
Hi,
     how do i change the caption defined in resource file.
     i want the same dialog box but with 2 different captions.
     Thanks
Rui
Title: Re: Captions in Dialogs
Post by: Guybrush on November 02, 2008, 12:30:51 PM
have u tried  SetWindowText ?
Title: Re: Captions in Dialogs
Post by: MichaelW on November 02, 2008, 12:44:47 PM
Rui,

I'm not sure I understand the question. I think the obvious answer would be to create two resource definitions that differ only in the dialog caption. Guybrush's suggestion would probably be easier, and if you did it from the WM_INITDIALOG handler, since WM_INITDIALOG is sent before the dialog is displayed, the original caption would never be seen.
Title: Re: Captions in Dialogs
Post by: Mark Jones on November 02, 2008, 02:58:17 PM
Hi Rui, if you are tinkering with multiple languages, may I suggest trying GoASM. GoASM will allow UNICODE string literals inside the code. Please see its documentation for more details.
Title: Re: Captions in Dialogs
Post by: Vortex on November 02, 2008, 03:54:59 PM
Quotei want the same dialog box but with 2 different captions.

What do you mean with two different captions?
Title: Re: Captions in Dialogs
Post by: jj2007 on November 02, 2008, 04:48:39 PM
Another elegant way to build bilingual apps is an init file built as follows:

[Dlg_EN]
mt=MyTitle
mc1=My first control

[Dlg_FR]
mt=Mon titre
mc1=Mon premier control

The read/write privateprofile functions are pretty easy to implement. You just specify the section name, and loop through the individual control strings.
Title: Re: Captions in Dialogs
Post by: RuiLoureiro on November 02, 2008, 05:40:28 PM
Guybrush, MichaelW, Mark, jj2007:

         Thank you for your helps
         
I have 2 functions that i can call from the menu (iten1 and iten2).
Both begin calling the same dialog box to choose some params. used by both
But i want to know from where i call it
(from iten1 then one caption; from iten2 another caption)

MichaelW,
         i havent tried yet «SetWindowText, hWnd, pCaption»
         but i think your help works: using it in WM_INITDIALOG
         thank you  :U

        EDIT: it works, problem solved. Thanks
Rui