Jump to content

Html Hybrid code example


kjactive
 Share

Recommended Posts

:) ; Example on doing a about window with a animated gif email graphic link, this cwebpage.dll from Jeff is just cool...

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("About...",312,265,-1,-1,$WS_SYSMENU)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<BODY bgcolor=red scroll=no><STYLE>DIV.aFilter {filter:progid:DXImageTransform.Microsoft.Glow(Color=blue,Strength=5);width:250px;}</STYLE>'

$a = $a&'<DIV STYLE="width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#550000FF,endColorstr=#55FFFF00)">'

$a = $a&'<FONT face="Courier new" size=2 color=yellow><DIV CLASS="aFilter">HtmlStrings 2.1</DIV>&copy 2005 By Kaare Johansson...</P>'

$a = $a&'Interactive Development Environment for the embed browser library by Jeff Glatt</P>Interpreter: AutoIt Version: 3.1 Windows: '&@OSVersion&'<BR><BR>'

$a = $a&'<A href="mailto:email@address.com"><img src="file:e-mail.gif" style="position:absolute;left:240;top:22;width:52;height:46;Border:0" alt="Return bugs or comments at direct internet line"></SPAN></a>'

$a = $a&'<FONT face="Courier New" size=5 color=red><MARQUEE bgcolor=blue width=281 height=20 direction=left scrollamount=6 scrolldelay=90>'

$a = $a&'Related Applications... RxProject - Large project preprocessor and manager... RxDlgIDE - Dialog Interactive Development Environment... HtmlGadgets - Gadget Row & Columns init and runtime function generator...</MARQUEE></FONT></DIV>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

If $msg = -3 Then ExitLoop

WEnd

$ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

Func OnAutoItExit()

DLLClose($dll)

EndFunc

this is just an example on useing 'DisplayHTMLStr' - a powerfull function that can do all kind of Hybrid coding like display all kind of graphics, do events or like this example display nice colorfull texts, marguee text included and do a animated gif graphic email link...

:D Kåre

Link to comment
Share on other sites

I like a green background. Try this mod. Looks nice.

#include "GUIConstants.au3"
$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("About...",312,265,-1,-1,$WS_SYSMENU)
$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)
GUISetState()

$a = '<BODY bgcolor=green scroll=no><STYLE>DIV.aFilter {filter:progid:DXImageTransform.Microsoft.Glow(Color=blue,Strength=5);width:250px;}</STYLE>'
$a = $a&'<DIV STYLE="width:100%;height:100%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#550000FF,endColorstr=#55FFFF00)">'
$a = $a&'<FONT face="Courier new" size=2 color=yellow><DIV CLASS="aFilter">HtmlStrings 2.1</DIV>&copy 2005 By Kaare Johansson...</P>'
$a = $a&'Interactive Development Environment for the embed browser library by Jeff Glatt</P>Interpreter: AutoIt Version: 3.1 Windows: '&@OSVersion&'<BR><BR>'
$a = $a&'<A href="mailto:email@address.com"><img src="file:e-mail.gif" style="position:absolute;left:240;top:22;width:52;height:46;Border:0" alt="Return bugs or comments at direct internet line"></SPAN></a>'
$a = $a&'<FONT face="Courier New" size=5 color=WHITE><MARQUEE bgcolor=GREEN width=286 height=20 direction=left scrollamount=3 scrolldelay=90>'
$a = $a&'Related Applications... RxProject - Large project preprocessor and manager... RxDlgIDE - Dialog Interactive Development Environment... HtmlGadgets - Gadget Row & Columns init and runtime function generator...</MARQUEE></FONT></DIV>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)
While 1
$msg = GUIGetMsg()
If $msg = -3 Then ExitLoop
WEnd
$ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)


Func OnAutoItExit()
DLLClose($dll)
EndFunc
Link to comment
Share on other sites

Sorry

Latest .dll version and documentation from link, just place the .dll in your system directory useal 'system32'

green background - no way, but the string function is rather cool and got a lot of power, do almost no limits to graphic, events, html, dhtml, smil, activeX etc.

http://www.borg.com/~jglatt/cwebpage.zip

Kåre

Edited by kjactive
Link to comment
Share on other sites

I tried to link to an EXE and ofcourse it doesn't work.

I'm glad this is open source.

Maybe we can change something in the source so it will work.

I'm going to investigate with my pal Google.

<{POST_SNAPBACK}>

@SlimShady

I have compiled an exe, with the dll in the same directory. It works fine. I am unsure of what your reasons of concern?

@kjactive

Nice display.

Link to comment
Share on other sites

You can't link to an executable using HTML (in the current state).

I mean you can link but it won't execute the file.

Example 1

<a href="C:\Program Files\AutoIt3\AU3Info.exe">AU3Info.exe</a>

Example 2

<a href="file://C:\Program Files\AutoIt3\AU3Info.exe">AU3Info.exe</a>

Example 2.5

<a href="file:///C:\Program Files\AutoIt3\AU3Info.exe">AU3Info.exe</a>

Example 3

<a href="file://C:/Program Files/AutoIt3/AU3Info.exe">AU3Info.exe</a>

Example 3.5

<a href="file:///C:/Program Files/AutoIt3/AU3Info.exe">AU3Info.exe</a>
Link to comment
Share on other sites

No html would think that it's an download ready file and starts download applet but you could create a animated gif with an tricker event that let windows select file type and do the trick when mouse role over or something like that - well I think that java could do directly execute but never tryed...

One could also create Html tags and get result from these directly in AutoIt and let autoit do the trick and execute...

Html is a master in graphics and mostly graphics related with some additional internet page flipping and email corresponding...

There is a drawback to this 'control' - it can't be moved from zero zero only resized...

Kåre

Link to comment
Share on other sites

You can't link to an executable using HTML (in the current state).

I mean you can link but it won't execute the file.

...

Thats a pitty, Id like to request that as a feature. I also hope the dll functions will get embedded in the next AutoIt so we dont have to carry a DLL with it.
Link to comment
Share on other sites

:) Here's an example on using MS medieplayer in AutoIt Gui as a hybrid code - this library can use all MS activeX applets and combine them with AutoIt gui

Note: The Windows Movie.wmv must be in local path and there are a lot of parametre attached to this object and only a few used but as an example it's okay, try change true to false in the Dhtml code...

; Example on useing the medieplayer object

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("MediePlayer...",419,305,-1,-1)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<OBJECT ID=MPlayer style="position:absolute;left:0;top:0;width:400;height:300;border:1 solid red" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">'

$a = $a&'<PARAM name=URL value="Windows Movie.wmv"><PARAM name=autostart value=true><PARAM name=fullScreen value=false></OBJECT>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

If $msg = -3 Then ExitLoop

WEnd

$ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

Func OnAutoItExit()

DLLClose($dll)

EndFunc

Kåre :D

Edited by kjactive
Link to comment
Share on other sites

:) Here's an example on using the MS audioplayer applet with the AutoIt3 gui as a hybrid code...

Note: the Town.mid file must be in local path, this is also an example on using zeros as false and true, try to change some parametre - only a few is used but as an example it's okay...

; Example on useing the audio player object

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("MediePlayer...",510,520,-1,-1)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<OBJECT classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" ID=APlayer width=100 height=40>'

$a = $a&'<param name=AutoStart value=0><param name=uiMode value=mini><param name=URL value="Town.mid"></OBJECT>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

if $msg <> 0 then ConsoleWrite($msg & @CR)

If $msg = -3 Then ExitLoop

WEnd

$ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

Func OnAutoItExit()

DLLClose($dll)

EndFunc

Kåre :D

Edited by kjactive
Link to comment
Share on other sites

here's another example to useing the MS medieplayer with AutoIt3 gui usiing the easy EMBED tag, only a few parametre is used try change zeros to ones - False to true...

; Another example on useing the medie player object

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("MediePlayer...",419,305,-1,-1)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<EMBED src="Windows Movie.wmv" hidden=0 autostart=1 loop=1'

$a = $a&' AutoSize=1 AutoRewind=1 ShowControls=0 ShowDisplay=1 VideoBorderWidth=10 VideoBorder3D=0'

$a = $a&' Volume=-1000 mute=0 width=280 height=250 style="border:1 solid red">'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

If $msg = -3 Then ExitLoop

WEnd

$ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

Func OnAutoItExit()

DLLClose($dll)

EndFunc

Kåre

Link to comment
Share on other sites

Here is another wild example on using a scripting model with the .dll - almost anything can be attached inside a script, VBscripts or MS Java can do

Try to role the cursor over the DHtml control in the AutoIt3 gui window

; Another example on using scripts with this 'control'

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("MediePlayer...",500,150,-1,-1)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<script>function caption(){if (pop.style.visibility=="hidden"){pop.style.visibility="";ftext.style.visibility=""}else{pop.style.visibility="hidden"}}</SCRIPT>'

$a = $a&'<CENTER ID=pop style="visibility:hidden;position:absolute;top:10;left:15;width:460;height:35;filter:'

$a = $a&'progid:DXImageTransform.Microsoft.alpha(opacity=50)">'

$a = $a&'<P ID=ftext style="visibility:hidden;background-color:blue;color:red;font-size:27;font-weight:bold;width:80%;padding:5">'

$a = $a&'Insert events before style</P></CENTER>'

$a = $a&'<BODY scroll=no onmouseover="caption()" onmouseout="caption()"></BODY>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

If $msg = -3 Then ExitLoop

WEnd

$ret = DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

Func OnAutoItExit()

DLLClose($dll)

EndFunc

Kåre :)

Link to comment
Share on other sites

These examples are just to give an small idear what this little Html Control .dll can do, I used it a lot some while ago - there is one differense from the other form I used it in and that is that this 'control' can't be moved from zero zero, the other 'control' could and that was vital if one wants to display some fancy html text in some special manners in a gui etc.

I worked previous years on some projects with Jeff, the last modifier to this library but we never got that well as a matter of fact I'm not in position to ask him anything BUT if any of you 'AutoItters' feel like to ask him to modify this library like to be moveable and realy useable like this example:

ResizeBrowser("hwnd",leftedge, topedge,width, height)

I know that it would be an easy task for him... Jeff can be mailed directly at jglatt@borg.com

Latest .dll version and documentation from link, just place the .dll in your system directory useal 'system32'

http://www.borg.com/~jglatt/cwebpage.zip

Join the hybrid coding - it's fun :)

Kåre

Edited by kjactive
Link to comment
Share on other sites

#include "GUIConstants.au3"
$read = 1
dim $size
$dll = DllOpen("cwebpage.dll")

GUICreate("Autoit Browser", 500, 40, -1, 0, BitOR($GUI_SS_DEFAULT_GUI, $WS_SYSMENU))
$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)
GUISetState()
$hwnd = GUICreate("Browser", 1000, 500, -1, -1, $WS_POPUP + $WS_BORDER + $WS_SIZEBOX)
$pos = WinGetClientSize($hwnd)

DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $hwnd)
GUISetState()


$size = WinGetPos ( $hwnd )
dim $osize[4]

While 1
    $Size = WinGetPos ( $hwnd )
    $msg = GUIGetMsg()
    If $msg = -3 Then ExitLoop
    If $msg = $go Then $read = 1
    If $read = 1 Then
        GUICtrlSetData ( $status, "Downloading " & GuiCtrlRead ( $page ) )
        InetGet(GUICtrlRead($page), @TempDir & "\temp.autoitbrowser", 1)
        GUICtrlSetData ( $status, "Reading page(s)" )
        $size = FileGetSize(@TempDir & "\temp.autoitbrowser")
        $a = FileRead(@TempDir & "\temp.autoitbrowser", $size)
        DllCall($dll, "long", "DisplayHTMLStr", "hwnd", $hwnd, "str", $a)
        $read = 0
        GUICtrlSetData ( $status, "Ready." )
    EndIf
    $MovePos = WinGetPos("Autoit Browser")
    $X = ($MovePos[2] - 500) / 2 + $MovePos[0]
    WinMove($hwnd, "", $X, $MovePos[1] + 70)
WEnd


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

try my crappy browser!

[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]

Link to comment
Share on other sites

Well there is a problem as I do not got the tmp page \\temp\temp.autoitbrowser but everything else seems to work but without a page back flipping notation - it is though a very nice library only missing the 'control' to be located anywhere and not always to zero zero...

I think that you probably should use 'DisplayHTMLPage' and not the 'DisplayHTMLStr' as the Page function can be controled a lot with

'DoPageAction' function to notation and provide page flipping...

Kåre

Edited by kjactive
Link to comment
Share on other sites

:D Here is a wild 'DisplayHTMLStr' scriping example including VML,Dhml, different filters and time durration - very nice - one has to find a .bmp graphic file and a .mpga music file to use in this example and place these in scripting local path...

; Another example on using html scripts with this 'control'

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("cwebpage.dll example...",360,300,-1,-1)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<STYLE>.time {behavior:url(#default#time2)}v\:D{behavior:url(#default#VML)}</STYLE>'

$a = $a&'<?import namespace=t urn=urn:schemas-microsoft-com:time implementation=#default#time2 />'

$a = $a&'<BODY background=file:Leaf.bmp scroll=no topmargin=0 leftmargin=0><FONT style="font:bold 55 ariel" color=red>'

$a = $a&'<P id=Div class=time begin=0 dur=13 style="position:absolute;top:-55;left:10;height:100%;width:100%;color:red;filter:progid:DXImageTransform.Microsoft.dropshadow(pixelradius=2,color=black,offx=10,off

y=10)">'

$a = $a&'<T:Animate targetElement=Div attributeName=top to=100 dur=4 begin=0 decelerate=1 fill=freeze />'

$a = $a&'<t:Transitionfilter begin=0 dur=3 type=barWipe targetelement=Div />'

$a = $a&'<t:Transitionfilter begin=0 dur=3 type=fade targetelement=Div />'

$a = $a&'<t:Transitionfilter begin=10 dur=3 type=fade mode=out targetelement=Div />'

$a = $a&'<t:media begin=-2 dur=13 src="'&@ScriptDir&'\Intro.mpga" volume=50 />AutoIt 3.1 Html code Transitions</P>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

If $msg = -3 Then ExitLoop

WEnd

Func OnAutoItExit()

DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

DLLClose($dll)

EndFunc

Hybrid coding is just fun :)

Edited by kjactive
Link to comment
Share on other sites

Just a nice small example to use the Bar title Class and the copyright class, try use the copyright link - two small nice classes...

#include "GUIConstants.au3"

$dll = DLLOpen("cwebpage.dll")

$hwnd = GUICreate("cwebpage.dll example...",600,300,-1,-1)

$pos = WinGetClientSize($hwnd)

DLLCall($dll,"long","EmbedBrowserObject","hwnd",$hwnd)

GUISetState()

$a = '<STYLE>.bar{background:#336699;width:100%;height:10px;border-top:1px solid #99CCFF;border-bottom:1 solid black;}'

$a = $a&'.title{font-size:25pt;color:white;padding-left:10;}</STYLE>'

$a = $a&'<BODY style="font-family:verdana; background:gray"><DIV CLASS="bar title">AutoIt 3.1 - title...</DIV></BODY><BR><BR><BR>'

$a = $a&'<HR><A class="copyright" HREF="http://www.microsoft.com">&copy 2005 My Corporation. All rights reserved...</A>'

DLLCall($dll,"long","DisplayHTMLStr","hwnd",$hwnd,"str",$a)

While 1

$msg = GUIGetMsg()

If $msg = -3 Then ExitLoop

WEnd

Func OnAutoItExit()

DLLCall($dll,"long","UnEmbedBrowserObject","hwnd",$hwnd)

DLLClose($dll)

EndFunc

Kåre

Edited by kjactive
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...