Sign in to follow this  
Followers 0
ptrex

IE Com object on a GUICtrlCreateTab ?

16 posts in this topic

@SvenP

Sven I was playing around with you example of IE COM in AutoIT GUI.

I am wondering if it is possible to put an IE Control on a GuiCtrlCreateTab in a Gui.

I wanted to grab some Internet content and show it with some other information in one of the TABS of the CuiTab controls.

Or can the IE COM objects only be put on the master GUI area.

If it is possible could you add some example, because I have been trying for days now without a result.

Thanks a lot in advance

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@SvenP

Sven I was playing around with you example of IE COM in AutoIT GUI.

I am wondering if it is possible to put an IE Control on a GuiCtrlCreateTab in a Gui.

I wanted to grab some Internet content and show it with some other information in one of the TABS of the CuiTab controls.

Or can the IE COM objects only be put on the master GUI area.

If it is possible could you add some example, because I have been trying for days now without a result.

Thanks a lot in advance

<{POST_SNAPBACK}>

ptrex,

An embedded object has indeed the nasty habit to place itself on the main GUI, disregarding any other controls. When you make the tabsize smaller than the embedded object you can see the effect:

It places itself always BELOW any other control.

I will check this out whether this can be fixed with an simple 'style'-modification or not.

Otherwise, do any of the other GUI devs know how to fix this kind of 'top-below' behaviour in general?

Regards,

-Sven

EDIT: To make things more clear: An embedded object does function correctly on a tab-selection change (it shows/hides itself properly), but the problem is that it displays itself 'behind' the tab-area.

I will continue this topic in the bugs section if it turns out to be a real bug.. (I'm not a moderator, so I can't 'move' this topic to that section.)

#include <GUIConstants.au3>

; Open InternetExplorer Control
$oIE = ObjCreate("Shell.Explorer.2")

; Create a simple GUI for our output
GUICreate ( "Embedded Web control Test", 590, 370,(@DesktopWidth-590)/2, (@DesktopHeight-370)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$tab          = GUICtrlCreateTab     (10,10, 300, 200)

; First tab item
$tab0        = GUICtrlCreateTabitem ("tab0")
$tab0label  = GUICtrlCreateLabel   ("label0", 30,80,50,20)
$tab0OK    = GUICtrlCreateButton  ("OK0", 20,50,50,20)
$tab0input  = GUICtrlCreateInput   ("default", 80,50,70,20)

; Second tab item
$tab1        = GUICtrlCreateTabitem ( "tab1")
;$tab0OK       = GUICtrlCreateButton  ("OK0", 20,50,350,210)
$GUIActiveX   = GUICtrlCreateObj     ( $oIE, 10, 40 , 600 , 360 )

GUICtrlCreateTabitem ("")  ; end tabitem definition

GUISetState ()    ;Show GUI

$oIE.navigate("http://www.autoitscript.com")

; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    
Wend

GUIDelete ()
Edited by SvenP

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

To add some more confusion to this one:

An embedded object is actually a child-window within the AutoIt GUI window. So the general question to investigate would be: Can one create a 'child-window' with a tab-control?

Regards,

-Sven

EDIT: I did a test with GUICtrlSetStyle ( $GUIActiveX, $WS_OVERLAPPEDWINDOW ) right behind the GUICtrlCreateObj(...) line. This looks promising.

ptrex: Can you try this also, to see if it also works for you?

Edited by SvenP

Share this post


Link to post
Share on other sites

To add some more confusion to this one:

An embedded object is actually a child-window within the AutoIt GUI window. So the general question to investigate would be: Can one create a 'child-window' with a tab-control?

Regards,

-Sven

controls set in a tab item are themselves child windows, but for some reason, I can't specifically create a Child window (using GuiCreate() ) and set it to a tabitem.

i had to set a label the size of the tab item client area, and then set a Child window over it. (see 'Nested Tabs' in Scripts and Scraps)


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

My solution has always been to capture the tab-change event and show/hide my embedded window/control as necessary. For example, if I wanted to make a tabbed browser, I would create n number of embedded IE controls but only show one of them at a time depending on which tab had focus (There would obviously be an internal mapping of tabs to windows). Its a small bit of overhead for the scripter to do but it is not that hard to make the correct behavior.

Share this post


Link to post
Share on other sites

@SvenP

Sven you are a Genius !!

This is how it looks like right now.

There still 2 issues which I need to overcome.

- I need to stop the object from floating around, it should be fixed

- how can I arrange that when pressing a button which is shown in TAB1 to jump to TAB 2 (does this have something to do with set focus on a TAB ??)

There are probably some standard commands in AutoIT, but I've never used tham. I am to new in the business :-)

Can you or someone else, give me some hints.

PS:

Sorry for the late reply, but I am working on others things as well in parallel.

As we probably all are !!

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

@SvenP

Sven I looked in the MSDN site for Command-Line Parameters for Starting Internet Explorer.

This is what I found :

you can use command-line parameters to customize how Internet Explorer is started. For example, you can start Internet Explorer in Kiosk (full-screen) mode by adding a parameter to the Internet Explorer executable file name, as shown in the following syntax:

Iexplore.exe -k

The following table identifies the parameters that you can use for starting Internet Explorer.

Parameter Description

-new Specifies that the browser window will start a new browsing process.

-k Specifies that the browser will start in Kiosk (full-screen) mode.

-nohome Specifies that the browser will start without its home page.

-embedding Specifies that the Web browser control will start if no home page is displayed.

-channelband Specifies that the browser will display the Channels folder.

Can I sent 1 of these Parameters when specifying the ObjCreate("Shell.Explorer.2")

If I could start the IE Object whith the -K or Embedded Option, I get rit of the problem.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

:dance: maybe u can make a script to navigate the internet Without IE bind the Function to a button_onclick then direct the return VAlue to a guiWindow where it renders the html and Gets the Picture and stuff from the net. that way no Comobject is necessary and u r free to control the GuiWindows ... rendering the return value will prolly be the hardest part in all this so imma look around..

:whistle: maybe writing a simple html FILE with a Object Tag defining IE and IE properties then load that object into ur script... reasoning for :dance: the object will be encapulated within the html Page so Sizing and Close button shouldnt show up:

like so

#include <Object.html>

Func GetDefObj($oID)

$Ret = ObjGet($oID)

Return $Ret

EndFunc

$IEContObect = GetDefObj("Object.ID") ;GetObj

then go from there ... though i seriosly doubt this idea...


http://www.myclanhosting.com/defiasVisit Join and contribute to a soon to be leader in Custumized tools development in [C# .Net 1.1 ~ 2.0/C/C++/MFC/AutoIt3/Masm32]

Share this post


Link to post
Share on other sites

Have you tried using the WebBrowser control instead of the Shell or InternetExplorer?

I haven't read a lot about the differences, but it is what is intended for embedding in applications:

ObjCreate("WebBrowser.Application")

There is info in MSDN, here for example: WebBrowser Customization

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

Share this post


Link to post
Share on other sites

To you all interested.

I found the solution (to simple to be true) !!

using the GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE )

instead of GUICtrlSetStyle ( $GUIActiveX, $WS_OVERLAPPEDWINDOW) did it.

I have been testing hundreds of combinations and possibillities, but this is the only one.

Look how it is now.

The blue bar is gone and, so are the MIN/MAX/CLOSE buttons.

This way the IE object doesn' t float around anymore, because you can't drag it away !!

I hope this contributes to all of you who want to add Embedded Objects to the GUI.

Thanks all for the feedback.

Share this post


Link to post
Share on other sites

To you all interested.

I found the solution (to simple to be true) !!

...

<{POST_SNAPBACK}>

Hi ptrex,

Sorry for not replying to your questions. I wasn't around for a few weeks. Luckily there are more GUI/ActiveX experts in the world.

We surely have to write more documentation about GUICtrlCreateObj(), mentioning these kind of neat solutions. However time is against me..

Regards,

-Sven

Share this post


Link to post
Share on other sites

using the GUICtrlSetStyle ( $GUIActiveX,  $WS_VISIBLE )

instead of GUICtrlSetStyle ( $GUIActiveX,  $WS_OVERLAPPEDWINDOW) did it.

I thought $WS_CHILD would've been the appropriate choice


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

@SvenP

Glad to be of any help.

I am planning some more Embedded Object testing ni the Crystal Reports Area.

So we wll meet each other here sometime, no doubt.

@quaizywabbit

Your question may be of an other kind. Is a child window an Embedded Object ?

I don't think so. I am not a Gui expert.

But maybe you should post the question in the GUI support section of the forum.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

why would an 'embedded object' have a ControlId if it weren't a Control/child Window?

perhaps the object itself is embedded into a child window in order to present it to us as a control. Just guessing here...

I haven't delved into COM yet, so far I haven't had the necessity.

EDIT:: Just to test my theory, I ran the example listed under GuiCtrlCreateObj and came up with the following about the 'Embedded Object':

Class name = INTERNET EXPLORER_SERVER

ControlId = 0

styles = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN

exstyles = WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR

i used Winspector Spy to retrieve this data..

Edited by quaizywabbit

[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
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
Sign in to follow this  
Followers 0