TPW HELP: changing the caption of a dialog 
Author Message
 TPW HELP: changing the caption of a dialog

Hello.

I have a little problem with Turbo Pascal for Windows.
I have a TDlgWindow, MyWindow, which is the program's main window. I made
the resource for it with Resource Workshop.

Caption: 'Program Title'
Class: 'Main Window'
Dialog ID: 'MainWindowDialog'

Now, when I initialize it I call:
TDlgWindow.Init (nil, 'MainWindowDialog'); {dialog ID}

When I set up the window class I call:
function TMyWindow.GetClassName : PChar;
  begin
    GetClassName := 'Main Window'; {dialog class}
  end;

But what if I want to change the caption of the dialog? I need to change
it, because I'm going to translate the program into many languages, so I
would need to show the correct string in the caption depending on which
language has been selected by the user. Moreover, since I'm programming a
CD player, I need to change the main window caption, because I would like
plement something like "Program Title - Playing track 1".

Please, help me! I can't find this info anywhere in TP manuals and help
system.


Thank you very much,

--
Mauro Molinari



Wed, 18 Jun 1902 08:00:00 GMT  
 TPW HELP: changing the caption of a dialog

Quote:

> Hello.

> I have a little problem with Turbo Pascal for Windows.
> I have a TDlgWindow, MyWindow, which is the program's main window. I made
> the resource for it with Resource Workshop.

> Caption: 'Program Title'
> Class: 'Main Window'
> Dialog ID: 'MainWindowDialog'

> Now, when I initialize it I call:
> TDlgWindow.Init (nil, 'MainWindowDialog'); {dialog ID}

> When I set up the window class I call:
> function TMyWindow.GetClassName : PChar;
>   begin
>     GetClassName := 'Main Window'; {dialog class}
>   end;

> But what if I want to change the caption of the dialog? I need to change
> it, because I'm going to translate the program into many languages, so I
> would need to show the correct string in the caption depending on which
> language has been selected by the user. Moreover, since I'm programming a
> CD player, I need to change the main window caption, because I would like
> plement something like "Program Title - Playing track 1".

> Please, help me! I can't find this info anywhere in TP manuals and help
> system.

Easy enough, you just say SetWindowText(HWindow,'Playing track 1');

The window has to be set up in the way you describe in order to get it
initialised and started, but thereafter you can change the title as many
times as you wish. SetWindowText operates on the caption for this type
of window.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. TPW: How can I change attributes from recourde made dialogs

2. TPW: Changing color of dialog control

3. TPW 1.5 Dialog Objects Help

4. Delphi: User changes Button Captions

5. W95/98 FileOpen/FileSaveAs Dialog for TPW / BPW.

6. TPW Creating a dialog with CreateWindowEx

7. TPW - Dialogs In DLLs

8. Common dialogs and long filenames in TPW

9. Accels in dialogs in TPW

10. how to put a BMP in a dialog in TPW 1.5

11. D1: Setup a Change Password dialog box?

12. Changing font in Dialog Boxes...

 

 
Powered by phpBB® Forum Software