Jump to content

Maxthon, actuall tab's url? 2nd try


Zebulon
 Share

Recommended Posts

Hello to all!

I'm still have the problem getting mathons actuall tabs url.

with the followng code in get back the url of the first tab from the left hand side.

#include <IE.au3>

Opt("WinTitleMatchMode", 2)

$aTitle = "- Maxthon Browser"

Do

Sleep(10)

Until WinExists($aTitle)

$oHandle = WinGetHandle($aTitle)

WinActivate($oHandle)

$aHandle = _IEAttach ($oHandle, "HWND")

$uRL = _IEPropertyGet ($aHandle, "locationurl")

MsgBox(0, "Actuall Tab's URL", $uRL )

but this is not the actuall tab.

anyone a solution??

I nearly have a nervous breakdown.

many thx in advance

greetings from Germany

Zebulon

Link to comment
Share on other sites

Hello to all!

I'm still have the problem getting mathons actuall tabs url.

with the followng code in get back the url of the first tab from the left hand side.

#include <IE.au3>

Opt("WinTitleMatchMode", 2)

$aTitle = "- Maxthon Browser"

Do

Sleep(10)

Until WinExists($aTitle)

$oHandle = WinGetHandle($aTitle)

WinActivate($oHandle)

$aHandle = _IEAttach ($oHandle, "HWND")

$uRL = _IEPropertyGet ($aHandle, "locationurl")

MsgBox(0, "Actuall Tab's URL", $uRL )

but this is not the actuall tab.

anyone a solution??

I nearly have a nervous breakdown.

many thx in advance

greetings from Germany

Zebulon

I'm not familiar with IE. What do you mean by the first TAB? If you have have tabbed pages maybe you have a newer version of IE than mine?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I'm not familiar with IE. What do you mean by the first TAB? If you have have tabbed pages maybe you have a newer version of IE than mine?

Hello Martin,

I use Maxthon. (www.maxthon.com) It's a browser substitut that is based on the M$-IE engine ( I still use ie6) but offers a lot of additional functions, for instance tabbed-browsing.

I want to get back the actuall shown tabs's url to write it into the registry-secure zone entry. with one mouse click.

But i'm still fighting with the problem getting this damn url back.

Greetings

Zebulon

Link to comment
Share on other sites

I have never really grasped what you are trying to do.

First, this code simply cannot work:

$oHandle = WinGetHandle($aTitle)
WinActivate($oHandle)
$aHandle = _IEAttach ($oHandle, "HWND")
$uRL = _IEPropertyGet ($aHandle, "locationurl")

You are passing a window handle into the _IE functions and they require a COM object instead. You will get an InvalidDataType error.

Can I restate your problem like this: ?

I need to determine the current URL of ALL browser windows (they happen to be in tabs in a Maxthon browser)

?

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

I have never really grasped what you are trying to do.

First, this code simply cannot work:

$oHandle = WinGetHandle($aTitle)
WinActivate($oHandle)
$aHandle = _IEAttach ($oHandle, "HWND")
$uRL = _IEPropertyGet ($aHandle, "locationurl")

You are passing a window handle into the _IE functions and they require a COM object instead. You will get an InvalidDataType error.

Can I restate your problem like this: ?

I need to determine the current URL of ALL browser windows (they happen to be in tabs in a Maxthon browser)

?

Dale

Hi Dale,

you confirmed my thougt about the com-object and the _IE functions. I really got a InvalidDataTypeError. (A lot to lern!! ;-))

I try to restate my problem tu use your words:

I need to determine the URL of the currently shown (active) tab-window in Maxthon Browser. All the windows are shown in tabs like in ff or new IE7. BUT i really need only the URL of the active tab that I can see. If I have 35 tabs open, and in tab 20 the URL of, for instance "www.autoitscript.com" is shown, I need this URL to do something with it (write it into the registry - secure zone entry)

I managed to determine the URL of the 1st tab (left hand side) but this is only a little success for me.

Thanks 4 helping

Zebulon

Link to comment
Share on other sites

So the real challenge is getting a reference to the browser embedded in the active Maxthon tab.

Will that control also have window/keyboard focus at the time you want to do this?

I don't know how to do this in IE7 either -- I have asked in Microsoft forums how to set the active tab and this would be an extention of that -- but I have received no reply and have found no documentation pointing to any functions that help.

WHY are you trying to do this? If I knoew a little more about your use case I might be able to offer something.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

So the real challenge is getting a reference to the browser embedded in the active Maxthon tab.

Will that control also have window/keyboard focus at the time you want to do this?

I don't know how to do this in IE7 either -- I have asked in Microsoft forums how to set the active tab and this would be an extention of that -- but I have received no reply and have found no documentation pointing to any functions that help.

WHY are you trying to do this? If I knoew a little more about your use case I might be able to offer something.

Dale

Hello Dale,

> Will that control also have window/keyboard focus at the time you want to do this?

Yes - the actuall tab has window/keyboard focus.

The reason I try to do this I very simple to explain. Some pages one has to enter into M$'s internet secure zone to make them work all right. It's ok but very unhandy to handle. Copy the actuall URL into clipboard, open internet options, secure zone and copy the URL into the list.

So I try to code a sript to do all these steps with one mouse-click.

May be there is already a tool for that. But don't mind, I would like to have a try with autoit.

Greetings

Zebulon

Link to comment
Share on other sites

> So I try to code a sript to do all these steps with one mouse-click.

With one mouse click on what?

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

> So I try to code a sript to do all these steps with one mouse-click.

With one mouse click on what?

Dale

I inserted a new plug-in for mython, that means a new button/icon in Maxthon's plug-in-toolbar. but the button is without functionallity so far.

Thr script I want to code with AutoIt will be compiled to an exe-file and associated with the button. This already works with a dummy exe-file.

Link to comment
Share on other sites

I inserted a new plug-in for mython, that means a new button/icon in Maxthon's plug-in-toolbar. but the button is without functionallity so far.

Thr script I want to code with AutoIt will be compiled to an exe-file and associated with the button. This already works with a dummy exe-file.

OK, you may want to investigate the Maxthox API docs to see if they give you any help.

In the mean time, I've looked at the IE tabbed implementation and I discovered that where the main browser window control used to be called "Internet Explorer_Server1", we now have "Internet Explorer_Server2", "Internet Explorer_Server3" etc. based on the multiple tabs. This may give use some tools to manipulate them.

Can you please check Maxthon to see if it uses the same control names? Use "AutoIt Window Info" from the AutoIt start menu program group and look at the information under "Control under mouse".

thanks,

Dale

Edit: typo

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

OK, you may want to investigate the Maxthox API docs to see if they give you any help.

In the mean time, I've looked at the IE tabbed implementation and I discovered that where the main browser window control used to be called "Internet Explorer_Server1", we now have "Internet Explorer_Server2", "Internet Explorer_Server3" etc. based on the multiple tabs. This may give use some tools to manipulate them.

Can you please check Maxthon to see if it uses the same control names? Use "AutoIt Window Info" from the AutoIt start menu program group and look at the information under "Control under mouse".

thanks,

Dale

Edit: typo

Hi Dale,

the autoit window info says:

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Maxthon, actuall tab's url? 2nd try - AutoIt Forums - Maxthon Browser

Class: IEFrame

Size: X: -4 Y: -4 W: 1032 H: 742

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 489 Y: 176

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0x4399E4 Dec: 4430308

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 0 Y: 121 W: 1024 H: 43

Control ID: 59394

ClassNameNN: SysTabControl321

Text:

Style: 0x5400CE60

ExStyle: 0x00000000

tha Maxthons API-Docs I first have to look for.

I'll drop you some lines ASAP.

CU

Zebulon

Link to comment
Share on other sites

Thanks, but I should have been more explicit in my instructions. I need the control information when the mouse is poised over the main window containing the HTML document, not the tab itself. I'm interested in the control info for the document contained in multiple tabs.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks, but I should have been more explicit in my instructions. I need the control information when the mouse is poised over the main window containing the HTML document, not the tab itself. I'm interested in the control info for the document contained in multiple tabs.

Dale

This is an actuall shot with the mouse cursor poised directly in the middle of the window with the html-text:

Press CTRL-ALT-F to freeze the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Welcome to the MSDN Library - Maxthon Browser

Class: IEFrame

Size: X: -4 Y: -4 W: 1032 H: 742

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 628 Y: 510

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFFFF Dec: 16777215

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 26 Y: 188 W: 996 H: 496

Control ID: 59648

ClassNameNN: Afx:400000:852

Text:

Style: 0x50000000

ExStyle: 0x00000000

(Control is hidden)

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

(1): Fertig

(2):

(3): 1235

(4):

(5):

(6):

(7): 192.168.178.21

(8): 0 Byte

(9): 473M

(10): 52

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

Suche

Suche

http://msdn.microsoft.com/library/default....g/objectmap.asp

http://msdn.microsoft.com/library/default....g/objectmap.asp

Fertig

List1

List2

Welcome to the MSDN Library

??

Because of the API-Docs I've send a mail to the developer-team.

Cu :-)

Link to comment
Share on other sites

OK, I'm guessing it is a custom control and is different than what IE7 does. Please let us know what you learn from Maxthon.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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...