Jump to content

Recommended Posts

Posted

I have written a browser with functions like reload, back, forward, etc...

#include "GUIConstants.au3"
$dll = DLLOpen("cwebpage.dll")
$u="No Message"
$b="1"
$hwnd = GUICreate("JAK Webbrowser 1.0...",800,600,-1,-1, -1)
$pos = WinGetClientSize($hwnd)
$u=GUICtrlCreateInput ( "www.autoitscript.com", 280, 510, 120,20 )
$b=GUICtrlCreateButton ( "Go!", 400 , 510, 60, 20)
$word=GUICtrlCreateInput ( "www.autoitscript.com", 480, 510, 120,20 )
$search=GUICtrlCreateButton ( "Search!",600 , 510, 60, 20)
$back=GUICtrlCreateButton ( "<Back", 270, 535, 60, 20)
$for=GUICtrlCreateButton ( "Forward>", 345 , 535, 60, 20)
$re=GUICtrlCreateButton ( "@Reload", 420 , 535, 60, 20)
DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)
GUISetState()
 DLLCall($dll,"long","DisplayHTMLPage","hwnd",$hwnd,"str", "http://www.autoitscript.com" )
DLLCall($dll,"none","ResizeBrowser","hwnd",$hwnd,"int", 800, "int", 500 )

While 1
$msg = GUIGetMsg()
If $msg = -3 Then ExitLoop
   If $msg= $b then  DLLCall($dll,"long","DisplayHTMLPage","hwnd",$hwnd,"str", GuiCtrlRead($u) )
  If $msg= $back then DLLCall($dll,"none","DoPageAction","hwnd",$hwnd,"int", 0)
      If $msg= $for then DLLCall($dll,"none","DoPageAction","hwnd",$hwnd,"int", 1)
 If $msg= $search then  DLLCall($dll,"long","DisplayHTMLPage","hwnd",$hwnd,"str",  "http://www.google.com/search?q=" & GuiCtrlRead($word) )
    If $msg=$re then DLLCall($dll,"none","DoPageAction","hwnd",$hwnd,"int", 4)
WEnd

Func OnAutoItExit()
DLLCall($dll,"long","UnEmbedBrowserObject","hwnd", $hwnd)
DLLClose($dll)

EndFunc

browser.au3

Posted (edited)

I believe that this is what your after...

<A HREF="new-page.htm" TARGET="_blank">The Wonderful World of Sponge</A>

where TARGET=_blank tells the browser to spawn (or open) a new window for this page. Remove the Target tag and the browser use the same window - there are some other tags that can be used instead of _Blank, _Same etc.

To change IE default settings or spawn windows in the cwebpage.dll html control I believe that you have to use the DisplayHTMLStr function that can be used to do just the same as DisplayHTMLPage with that differense that you has to write your code your self like <BODY et. and through it at the control as a string but then you got a lot more control over the Html control...

Kjactive

Edited by kjactive
Posted

i'm working on a multi-tabbed browser right now :)

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Posted (edited)

Well that's nice, if I can be at any assistence just drop me a line, I know this browser control quiet well as I worked with it some years now and just love it as there is a lot of power in this control.

Hybrid coding is just fun...

Note: I attached a graphic file as member but it seems not to function, what did I wrong!

Kjactive

Edited by kjactive
Posted (edited)
Posted

  kjactive said:

Did you click on "Add this attachment" ?  - Nop but I try now, that got attached at the buttom I want my graphics to be attached above menber in top left area - how the ....

Kåre

<{POST_SNAPBACK}>

That's so offtopic. Anyways, click browse or enter an URL do whatever you want to do and press Update Avatar.

I presume you know where to find it.

Posted

Well maybe you'll right but it's a touch to this nice forum with these small graphic applets and i'll just can't get it right - I have uploaded a graphic file that should do as it's only 15K but I do not see any changes...

Why is all forums that focused on what is right or wrong - well something is just for fun

Kåre

Posted (edited)

#include "GUIConstants.au3"
$read = 1
dim $size
$dll = DllOpen("cwebpage.dll")
Dim $Windows[10]
$Parent = GUICreate("Autoit Browser", 1010, 550, -1, 0, $WS_SYSMENU )
GUISetBkColor ( 0xffffff )
$status = GUICtrlCreateInput("Ready.", 0, 0, 500, 20, $SS_SUNKEN)
$page = GUICtrlCreateInput("http://www.autoitscript.com", 0, 20, 450, 20)
$go = GUICtrlCreateButton("Go!", 450, 20, 50, 20, $BS_DEFPUSHBUTTON)
$tab = GUICtrlCreateTab ( 500, 0, 510, 40, $TCS_BUTTONS + $TCS_MULTILINE )
Dim $tabs[9]
$tabs[0] = GUICtrlCreateTabItem ( "http://www.autoitscript.com" )
$tabs[1] = GUICtrlCreateTabItem ( "about:blank" )
$tabs[2] = GUICtrlCreateTabItem ( "about:blank" )
$tabs[3] = GUICtrlCreateTabItem ( "about:blank" )
$tabs[4] = GUICtrlCreateTabItem ( "about:blank" )
GUISetState()
For $i = 1 To 9
    $Windows[$i] = GUICreate("about:blank", 1000, 475, 4, 40, $WS_POPUP, $WS_EX_MDICHILD, $Parent )
$pos = WinGetClientSize($Windows[0])
DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $Windows[$i])
        GUISetState ( $Windows[$i], @SW_HIDE )
Next
$Windows[0] = GUICreate("http://www.autoitscript.com", 1000, 475, 4, 40, $WS_POPUP, $WS_EX_MDICHILD, $Parent )
$Active = 0
$pos = WinGetClientSize($Windows[0])
DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $Windows[0])
GUISetState()


$size = WinGetPos ( $Windows[0] )
dim $osize[4]

While 1
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
    If $msg = $go Then $read = 1
    If $read = 1 Then
        GUICtrlSetData ( $status, "Reading " & GuiCtrlRead ( $page ) )
        GUICtrlSetData ( $tabs[$Active], GUICtrlRead ( $page ) )
        DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $Windows[$Active], "str", GuiCtrlRead ( $page ))
        $read = 0
        GUICtrlSetData ( $status, "Ready." )
    EndIf
    If Not ( GUICtrlRead ( $tab ) = $Active ) Then
        $Active = GuiCtrlRead($tab)
        GUISetState ( $Windows[$Active], @SW_SHOW )
        GUISetState ( $Windows[$Active], @SW_RESTORE )
        For $n = 0 To 9
            If Not ( $n = $Active  ) Then _
        GUISetState ( $Windows[$Active], @SW_HIDE )
        Next
    EndIf
WEnd


Func OnAutoItExit()
    $ret = DllCall($dll, "long", "UnEmbedBrowserObject", "hwnd", $Windows[0])
    DllClose($dll)
EndFunc

here is my browser so far, i can't get the tabs to work yet though its really annoying [edit]I used a fairly newer version of the browser in this post to write this :)[/edit]

Edited by Xenogis

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

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
  • Recently Browsing   0 members

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