Announcement

Collapse
No announcement yet.

how to change the windows title

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to change the windows title

    Hi,
    I am having problems changing the window title.
    On preload, I call
    Screen.SetLocalizedString("IDS_WINDOW_TITLE", "1234");

    However,this does not change the windows title.
    I need to change the windows title base on language. Any Suggestion?

    I have also tried
    handle = Application.GetWndHandle();
    Window.SetText(handle, "111");
    but this only change the title that appear in the taskbar, not the title in the UI

  • #2
    The title of screens is set via the "Window title" field on the Attributes tab. If you want to localize this caption, you would typically do this with a Session Variable.

    Ulrich

    Comment


    • #3
      Do you have any sample code? thanks

      Comment


      • #4
        Please check the documentation for full explanations and sample code.

        Ulrich

        Comment


        • #5
          hi,

          I tried to call it in the OnPreInstall but it is not working
          SessionVar.Set("%WindowTitle%", "111");

          I have also tried it on OnPreload of the welcome setup screen and it is still not working.

          any advice

          Comment


          • #6
            Hi,

            Ideally, I want to do something like
            strSetupTitle = SetupData.GetLocalizedString("Msg");
            SessionVar.Set("%WindowTitle%", "Msg");

            so that I can change the window title

            thanks

            Comment


            • #7
              Same problem... i´m unable to change the Window Title!

              Comment


              • #8
                Got it!

                Place the following code into the On Preload event of your page:

                -- Get the Application's WindowHandle
                nWindowHandle = Application.GetWndHandle();
                -- Get the Application's title
                sTitle = Window.EnumerateTitles(false)[nWindowHandle];
                -- Change the window's title bar
                Window.SetText(nWindowHandle, "NEW TITLE HERE");

                Comment


                • #9
                  Clearly using the most complicated method possible must have some advantage, or else people would follow the documentation, or at least the instructions already given in this thread.
                  Click image for larger version

Name:	SNAP-2013-11-13-03.png
Views:	1
Size:	78.3 KB
ID:	284107
                  Ulrich

                  Comment


                  • #10
                    Hi Ulrich, your method won't work if you are supporting multiple languages in a single installer.
                    Also, I am support simplified chinese (non-ascii) and Russian(non-ascii) in a single installer.
                    I can't edit the text directly from the screen properties as the text file tends to be corrupted due to the multiple language code.

                    So what I did is to read all the strings from individual lang file. It works for most of the content except the windows title

                    so in the preload event of all wndows, I will do something like that
                    -- These actions are performed before the screen is shown.
                    tblSysLang = System.GetDefaultLangID();
                    tblUserLang = Application.GetInstallLanguage();

                    local strHeader = SetupData.GetLocalizedString("RZMSG_WELCOME_HEADER ");
                    local strSubHeader = SetupData.GetLocalizedString("RZMSG_WELCOME_SUBHEA DER");
                    local strBody = SetupData.GetLocalizedString("RZMSG_WELCOME_TEXT") ;
                    Screen.SetLocalizedString("IDS_HEADER_TEXT", strHeader);
                    Screen.SetLocalizedString("IDS_SUBHEADER_TEXT", strSubHeader);
                    DlgStaticText.SetProperties(CTRL_STATICTEXT_BODY, {Text = strBody});



                    -- Get the Application's WindowHandle
                    nWindowHandle = Application.GetWndHandle();
                    -- Get the Application's title
                    sTitle = Window.EnumerateTitles(false)[nWindowHandle];
                    -- Change the window's title bar
                    Window.SetText(nWindowHandle, "NEW TITLE HERE");

                    The rest of the content is working except the window title.

                    Pls advise on how to solve this problem.

                    thanks

                    Comment

                    Working...
                    X
                    😀
                    🥰
                    🤢
                    😎
                    😡
                    👍
                    👎