set page title

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ericahlstrom
    Indigo Rose Customer
    • Jun 2004
    • 62

    set page title

    I am using the LuaCOM plugin to open IE without address bar, tool bar etc. Is there a way to change the title so it doesn't also display the url adress?

    Eric
    Last edited by ericahlstrom; 07-17-2005, 06:18 PM.
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3967

    #2
    Code:
    -- Get the titles and window handles of all open windows.
    windows = Window.EnumerateTitles();
    
    -- A variable containing text in the title you want to search for.
    URLToFind = "http://www.whatever.com";
    
    -- A variable that holds the new title
    sNewTitle = "New title for Window";
    
    -- Loop through the table of windows.
    for handle, title in windows do
    
        -- Check if the window title has the target text.
        result = String.Find(title, URLToFind, 1, false);
    
        -- if the string was found in the title
        if (result ~= -1) then
            Window.SetText(handle, sNewTitle");
        end
    end

    Comment

    • TJ_Tigger
      Indigo Rose Customer
      • Sep 2002
      • 3159

      #3
      In using LuaCOM it looks like you could use this object as well to return the handle of the IE window

      browser.HWND - Returns the window handle MsgBox of the current Internet Explorer window.
      TJ-Tigger
      "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
      "Draco dormiens nunquam titillandus."
      Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

      Comment

      • ericahlstrom
        Indigo Rose Customer
        • Jun 2004
        • 62

        #4
        Originally posted by Worm
        Code:
        -- Get the titles and window handles of all open windows.
        windows = Window.EnumerateTitles();
        
        -- A variable containing text in the title you want to search for.
        URLToFind = "http://www.whatever.com";
        
        -- A variable that holds the new title
        sNewTitle = "New title for Window";
        
        -- Loop through the table of windows.
        for handle, title in windows do
        
            -- Check if the window title has the target text.
            result = String.Find(title, URLToFind, 1, false);
        
            -- if the string was found in the title
            if (result ~= -1) then
                Window.SetText(handle, sNewTitle");
            end
        end

        Thanks for the code, it works!!

        Comment

        • Worm
          Indigo Rose Customer
          • Jul 2002
          • 3967

          #5
          Tig's idea to use luaCOM to get the Window handle is a better/faster way of getting the handle.

          Comment

          • ericahlstrom
            Indigo Rose Customer
            • Jun 2004
            • 62

            #6
            Originally posted by Worm
            Tig's idea to use luaCOM to get the Window handle is a better/faster way of getting the handle.
            Could I have an example. and also what is multiple IE windows where open?

            Comment

            • Worm
              Indigo Rose Customer
              • Jul 2002
              • 3967

              #7
              Code:
              --Create an Instance of IE 
              oIE=luacom.CreateObject("InternetExplorer.Application.1") 
              
              --navaigate
              oIE:Navigate2("http://www.indigorose.com") 
              
              --set the menu, adddres, and toolbar to off 
              oIE.Menubar = false; 
              oIE.AddressBar = false; 
              oIE.ToolBar = false; 
              
              --wait for navigation to complete
              Application.Sleep(500)
              
              --Set the title
              Window.SetText(oIE.HWND, "Indigo Rose Rules!")
              
              --show browser
              oIE.Visible = true

              Comment

              • ericahlstrom
                Indigo Rose Customer
                • Jun 2004
                • 62

                #8
                Originally posted by Worm
                Code:
                --Create an Instance of IE 
                oIE=luacom.CreateObject("InternetExplorer.Application.1") 
                
                --navaigate
                oIE:Navigate2("http://www.indigorose.com") 
                
                --set the menu, adddres, and toolbar to off 
                oIE.Menubar = false; 
                oIE.AddressBar = false; 
                oIE.ToolBar = false; 
                
                --wait for navigation to complete
                Application.Sleep(500)
                
                --Set the title
                Window.SetText(oIE.HWND, "Indigo Rose Rules!")
                
                --show browser
                oIE.Visible = true

                Thanks for the quick reply.

                Comment

                • Worm
                  Indigo Rose Customer
                  • Jul 2002
                  • 3967

                  #9
                  Sure thing

                  Comment

                  • TJ_Tigger
                    Indigo Rose Customer
                    • Sep 2002
                    • 3159

                    #10
                    Originally posted by Worm
                    Tig's idea to use luaCOM to get the Window handle is a better/faster way of getting the handle.
                    I got lucky that is all.
                    TJ-Tigger
                    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
                    "Draco dormiens nunquam titillandus."
                    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

                    Comment

                    • ericahlstrom
                      Indigo Rose Customer
                      • Jun 2004
                      • 62

                      #11
                      Originally posted by TJ_Tigger
                      I got lucky that is all.
                      Thank you for your help. Much appreciated!!!!!!!!!

                      Comment

                      Working...
                      X