Jump to content

Create IE window without buttons


Didonet
 Share

Recommended Posts

Straight from help

#include <GUIConstants.au3>
; Simple example: Embedding an Internet Explorer Object inside an AutoIt GUI
;
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/internetexplorer.asp

$oIE = ObjCreate("Shell.Explorer.2")

; Create a simple GUI for our output
GUICreate ( "Embedded Web control Test", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2, BitOr($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$GUIActiveX         = GUICtrlCreateObj      ( $oIE,      10, 40 , 600 , 360 )
$GUI_Button_Back    = GuiCtrlCreateButton   ("Back",     10, 420, 100,  30)
$GUI_Button_Forward = GuiCtrlCreateButton   ("Forward", 120, 420, 100,  30)
$GUI_Button_Home    = GuiCtrlCreateButton   ("Home",    230, 420, 100,  30)
$GUI_Button_Stop    = GuiCtrlCreateButton   ("Stop",    330, 420, 100,  30)

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
        Case $msg = $GUI_Button_Home
            $oIE.navigate("http://www.autoitscript.com")
        Case $msg = $GUI_Button_Back
            $oIE.GoBack
        Case $msg = $GUI_Button_Forward
            $oIE.GoForward
        Case $msg = $GUI_Button_Stop
            $oIE.Stop
    EndSelect
    
Wend

GUIDelete ()

Exit

just remove GUICreate Button - if you wish

8)

NEWHeader1.png

Link to comment
Share on other sites

And one offtopic question, what i cant solve.

Is there a way to search a word in a web page?

Like that: I open some page and i'm searching for the word "foo", if i find the word.. do something? I cannot find a way to get the source of a page in a varible.. :)

Link to comment
Share on other sites

There's one problem...

$oIE = _IECreate ("http://login.recbg.net/cgi-bin/login")

$Form = _IEFormGetObjByName ($oIE, "auth")

$username_form = _IEFormElementGetObjByName ($Form, "user")

$password_form = _IEFormElementGetObjByName ($Form, "parm")

Sleep(500)

_IEFormElementSetValue ($username_form, $username)

_IEFormElementSetValue ($password_form, $password)

can i use this script when i'm using the "Shell.Explorer.2" version of IE?

and can i get source of a page when i click a button to POST something?

Example:

User form with a user and pass. I fill the user and pass and click the submit button. And here i want to get the result...

Edited by Didonet
Link to comment
Share on other sites

Just use _IECreateEmbedded instead of _IECreate and attach it to your GUI and everything else should be the same. (BTW, the Sleep is unnecessary).

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

Just use _IECreateEmbedded instead of _IECreate and attach it to your GUI and everything else should be the same. (BTW, the Sleep is unnecessary).

Dale

I use the sleep, because the page i open uses some scripts, and i wait them to stop.

Look whats happening when i try to use _IECreateEmbedded

$oIE = _IECreateEmbedded()

GUICreate("Embedded Web control Test", 640, 580, _

(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _

$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

_IENavigate ($oIE, "http://my.url.com")

$Form = _IEFormGetObjByName ($oIE, "auth")

$username_form = _IEFormElementGetObjByName ($Form, "user")

$password_form = _IEFormElementGetObjByName ($Form, "parm")

Sleep(500)

_IEFormElementSetValue ($username_form, $username)

_IEFormElementSetValue ($password_form, $password)

I get this error:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "myscript.au3"

C:\Program Files\AutoIt3\Include\IE.au3 (286) : ==> The requested action with this object has failed.:

$o_object.navigate ($s_Url)

$o_object.navigate ($s_Url)^ ERROR

>Exit code: 1 Time: 0.411

everything is the same.. huh?

Link to comment
Share on other sites

#include<IE.au3>
$oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2)
GUICtrlCreateObj($oIE,-1,-1,630,570)
GUISetState()
_IENavigate ($oIE, "http://my.url.com")
Can u add my other code here, because i can't get it...
Link to comment
Share on other sites

#include<IE.au3>
$oIE = _IECreateEmbedded()
GUICreate("Embedded Web control Test", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2)
GUICtrlCreateObj($oIE,-1,-1,630,570)
GUISetState()
_IENavigate ($oIE, "http://my.url.com")
_IELinkClickByText($oIE,"Login")
$oUser=_IEGetObjById($oIE,"username")
$oPass=_IEGetObjById($oIE,"password")
_IEFormElementSetValue ($oUser, $username)
_IEFormElementSetValue ($oUser, $password)

If you want more example, see _IEAutomation() in my sig

Link to comment
Share on other sites

You really don't understand, do you??? Btw, that's a rhetorical question (a statement in the form of a question that implies its own answer).

I write so unintelligibility, because my English isn't very well.

The sense of that is: One offtopic question (problem) that i can's solve. I can't solve the problem. And the problem is offtopic... OK?

Link to comment
Share on other sites

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "myscript.au3"

C:\Program Files\AutoIt3\Include\IE.au3 (286) : ==> The requested action with this object has failed.:

$o_object.navigate ($s_Url)

$o_object.navigate ($s_Url)^ ERROR

>Exit code: 1 Time: 0.411

I don't know why you would get this error. Can you please add the following lines after your #include's in your script and then share the SciTe console output...

#AutoIt3Wrapper_run_debug_mode=Y

_IE_VersionInfo()

_IEErrorHandlerRegister()

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 write so unintelligibility, because my English isn't very well.

The sense of that is: One offtopic question (problem) that i can's solve. I can't solve the problem. And the problem is offtopic... OK?

The point is don't ask for help on an "offtopic" question you have, instead start a new thread. Hopefully this makes sense. Edited by ssubirias3
Link to comment
Share on other sites

Not going to be rude but, ssubirias3, but you really shouldn't give people orders in there own thread. He can ask an off topic question here, we dont need a new thread wasting server space. And, you really don't need to make him fell dumb by saying you really dont understand, do you. So what if he has bad English, other languages dont't use the kind of grammer thats in English.

Edited by JustinReno
Link to comment
Share on other sites

Not going to be rude but, ssubirias3, but you really shouldn't give people orders in there own thread. He can ask an off topic question here, we dont need a new thread wasting server space. And, you really don't need to make him fell dumb by saying you really dont understand, do you. So what if he has bad English, other languages dont't use the kind of grammer thats in English.

Hey brother, it's all good. I can dish it out and take it too :P. And I'm totally with you that it's not cool to give a noob a hard time for no reason. To say "bad english" is the reason or should excuse not searching the forum or Help file before asking common questions... that's a bit much imo. To your point of "grammer," I'd love for you to quote where I have given our friend Didonet a hard time for his "bad english" or use of grammar (spelled with an "a" not "e"; since we're on the topic of grammar). Oh and while you're quoting my stuff, can you quote where I gave an order?? :) Are you in the military or something??

For you to say other languages don't use the kind of grammar that's in English, please tell me what kind of grammar English use? Last time I checked grammar falls into proper or poor catagories and I'm sure anyone can find proper and poor grammar in other languges :(. If you must know, my message of him not understanding had nothing to do with language, but the concept of keeping threads on topic. Which in turn makes it easier for others months if not years later to find the answer to their questions. I'll come back to this point in a moment.

So that you and I are on the same page, lets try to keep things in context and see things from my perspective for a moment. I really appreciate you playing along. I'm really not the evil rude jerk you might think I am, at least not all the time.

  • Didonet ID created 9/5/07
  • First topic posted: Skype dropdown menu select, how to...? on Sep 5 2007, 10:47 PM. You'll see post #2 I was helpful to our boy Didonet with his on topic and off topic request for help, until post #20. My post #24 on Sep 7 2007, 05:24 PM suggested the idea of new questions = new post.
  • Second topic posted: Create IE window without buttons, how? (this one) on Sep 7 2007, 06:42 PM makes it look like he got the point about posting a new topic for new questions. Yeah!
  • On Sep 7 2007, 06:45 PM Generator told Didonet to study your SimpleWebBrowser code for the answers to his question. And a minute later Valuater hints the answers are "straight from help". Both of these guys almost suggest don't be lazy, try and figure it out. Note: that's how I read their messages and I didn't think they were being rude.
  • Then it happened! On Sep 7 2007, 07:03 PM Didonet went back to his old tricks and said "And one offtopic question, what i cant solve..." Now this was after Didonet his 3rd topic Gui without windows bar, is it possible? on Sep 7 2007, 06:57 PM.
  • You call me "rude" for my Sep 8 2007, 08:45 AM post where I said he really doesn't understand and my Sep 8 2007, 10:29 AM post where I explain the point.
Looking at this chronologically, I'm sure you'll still say I was rude. Guess we'll have to share a difference of opinion. Now back to the other point about new question = new topic and your flawed logic about

... we dont need a new thread wasting server space.

First, what weighs more a ton of lead or a ton feathers? Now I could be wrong and if I am please accept my sincerest apology. I would expect the server space to be the same for
  • 1 forum \ 100 topics \ 0 responses ... total data size 50MB
  • 1 forum \ 1 topic \ 99 responses ... total data size 50MB
  • 1 forum \ 1 topic \ 1 response ... total data size 50MB
To me its easier and less frustrating for the person searching the forum if the answer to their question (asked by someone else months or years ago) was on the first page of a thread. Not burried in a topic that doesn't match the subject line. Then again maybe you see no value in have subject lines describe what the thread is about? To keep this in context, Didonet used a good subject line that described his on topic question. After getting his answer he admittedly chose to go "offtopic". Please help me understand how creating a gui without buttons will help another person know how "to search a word in a web page." Both are good questions found in Help file and in the forum in past topics. But this is further evidence that the search feature was broken on Didonet's computer at the time and I'm just some really evil rude jerk who likes to bash people's "grammer" and give orders. :P

Thanks for playing Reno, you've been a good sport! :)

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