Jump to content

_IECreate Get Title ?


Recommended Posts

Hello,

I use _IECreate to open a browser but depending on the OS language or the registry settings, the title can change. Here is the code:

#include <IE.au3>
Opt("TrayIconHide", 1)
Opt("RunErrorsFatal", 0)
Opt("WinTitleMatchMode", -2)

$Title = "Windows Internet Explorer"

$oIE = _IECreate("about:blank", 0, 1)
;If StringInStr($CmdLineRaw, "-a") Then _IEPropertySet($oIE, "addressbar", False)
If StringInStr($CmdLineRaw, "-a") Then ControlHide($Title, "", "[CLASS:ComboBox; INSTANCE:1]")
If StringInStr($CmdLineRaw, "-m") Then _IEPropertySet($oIE, "menubar", False)
If StringInStr($CmdLineRaw, "-t") Then _IEPropertySet($oIE, "toolbar", False)
$Pos = StringInStr($CmdLineRaw, "http")-1
If $Pos > 0 Then
    $Page = StringRight($CmdLineRaw, StringLen($CmdLineRaw)-$Pos)
    _IENavigate($oIE, $Page)
EndIf

Exit(0)

Is it possible to get the title from _IECreate ? or a handle of the ie window ?

Plz help

Link to comment
Share on other sites

Is it possible to get the title from _IECreate ? or a handle of the ie window ?

$hIE = _IEPropertyGet($oIE, "HWND")
$sIETitle = WinGetTitle($hIE)
MsgBox(64, "IE Title", "Title = " & $sIETitle)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...