MsgBox Posted March 18, 2012 Share Posted March 18, 2012 (edited) Projecthttp://www.2shared.com/file/zOKmmM5I/WebControls.htmlNewhttp://www.2shared.com/file/cjWS6Oro/WebControls.htmlWebControls.au3expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <Array.au3> GUICreate("Gui Web controls") $ObjsArray1 = WebCreateButton("Button1_","Id1", 10, 30,190,60,"Button1") $ObjsArray2 = WebCreatePic("Pic1_","Id2","carlift.gif",280, 30,100,100) $ObjsArray3 = WebCreateVideoObj("Id3","AVI.AVI",10,140,380,250) GUISetState() _ArrayDisplay($ObjsArray3, "") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func Pic1_onClick() Local $o_Pic = @COM_EventObj MsgBox(0,"Msg","Pic1_onClick") EndFunc Func Button1_onClick() Local $o_Button = @COM_EventObj MsgBox(0,"Msg","Button1_onClick") EndFunc Func WebCreateVideoObj($id,$Filename,$Left,$top,$Width,$Height,$autoplay = "true") if Not StringInStr($Filename,":") Then $Filename = 'file:///' & StringReplace(@ScriptDir,"","/") & "/" & $Filename Else $Filename = 'file:///' & StringReplace($Filename,"","/") EndIf Dim $FileType = StringUpper(StringRight($Filename,4)) , $Embed = "" Select Case $FileType == ".AVI" $Embed = '<object id="' & $id & '" style="margin:0;padding:0;border-width:0;width:100%;' & _ 'height:100%;" type="video/avi" />' & @CRLF & _ '<param name="src" value="' & $Filename & '">' & @CRLF & _ '<param name="autoplay" value="' & $autoplay & '">' & @CRLF & _ '</object>' & @CRLF Case Else Return 0 EndSelect $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0;' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $Embed & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next Return $NweObjs EndFunc Func WebCreatePic($FunctionPrefix,$id,$Filename,$Left,$top,$Width,$Height,$BkColor = "#F0F0F0",$Res = False,$CssStyle = "") $ScriptDir = StringReplace(@ScriptDir,"","/") if ($Res) Then $AutoItExe = StringSplit(@AutoItExe,"") $AutoItExe = $AutoItExe[$AutoItExe[0]] $Filename = 'res://' & $AutoItExe & "/" & $Filename ; $Filename ==> uppercase (StrResType/StrResName) Else if Not StringInStr($Filename,":") Then $Filename = 'file:///' & $ScriptDir & "/" & $Filename Else $Filename = 'file:///' & StringReplace($Filename,"","/") EndIf EndIf if ($CssStyle == "") Then $HtmlCode = _ '<img src="' & $Filename & '"' & @CRLF & _ 'id="' & $id & '" alt="" title=""' & @CRLF & _ 'style="margin:0;padding:0;border-width:0;width:100%;height:100%;background-color: ' & $BkColor & '">' Else $HtmlCode = _ '<img src="' & $Filename & '"' & @CRLF & _ 'id="' & $id & '" alt="" title=""' & @CRLF & _ 'style="' & $CssStyle & '">' EndIf $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0;' & @CRLF & _ 'background-color: ' & $BkColor & ';' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $HtmlCode & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next ObjEvent($IeObj.document.getElementById($id),$FunctionPrefix) if @error Then Return 0 Return $NweObjs EndFunc Func WebCreateButton($FunctionPrefix,$id,$Left,$Top,$Width,$Height,$Text = "" , _ $ImgNorm = "Normal.jpg" , $Imgdown = "Press.jpg" , $Imgover = "Over.jpg", _ $SoundBool = True,$SFover = "over.wav",$SFdown = "down.wav",$Res = False,$Fface ="Arial", _ $Fcolor = "0",$Fsize = 0,$Fweight = "800",$Fstyle = "normal" , $decoration = "none" , _ $Align = "0",$bWidth = "0",$bColor = "#003399",$bpadding = "0") if ($Fsize = 0) Then $Fsize = Int(($Height + 1) / 2) if ($Align == 0) Then $Align = (int($Height) / 2) - ($Fsize / 2) $ScriptDir = StringReplace(@ScriptDir,"","/") if ($Res) Then $AutoItExe = StringSplit(@AutoItExe,"") $AutoItExe = $AutoItExe[$AutoItExe[0]] $ImgNorm = 'res://' & $AutoItExe & "/" & $ImgNorm ; $ImgNorm ==> uppercase (StrResType/StrResName) $Imgdown = 'res://' & $AutoItExe & "/" & $Imgdown ; $Imgdown ==> uppercase (StrResType/StrResName) $Imgover = 'res://' & $AutoItExe & "/" & $Imgover ; $Imgover ==> uppercase (StrResType/StrResName) $SFover = 'res://' & $AutoItExe & "/" & $SFover ; $SFover ==> uppercase (StrResType/StrResName) $SFdown = 'res://' & $AutoItExe & "/" & $SFdown ; $SFdown ==> uppercase (StrResType/StrResName) Else if Not StringInStr($ImgNorm,":") Then $ImgNorm = 'file:///' & $ScriptDir & "/" & $ImgNorm Else $ImgNorm = 'file:///' & StringReplace($ImgNorm,"","/") EndIf if Not StringInStr($Imgdown,":") Then $Imgdown = 'file:///' & $ScriptDir & "/" & $Imgdown Else $Imgdown = 'file:///' & StringReplace($Imgdown,"","/") EndIf if Not StringInStr($Imgover,":") Then $Imgover = 'file:///' & $ScriptDir & "/" & $Imgover Else $Imgover = 'file:///' & StringReplace($Imgover,"","/") EndIf if Not StringInStr($SFover,":") Then $SFover = 'file:///' & $ScriptDir & "/" & $SFover Else $SFover = 'file:///' & StringReplace($SFover,"","/") EndIf if Not StringInStr($SFdown,":") Then $SFdown = 'file:///' & $ScriptDir & "/" & $SFdown Else $SFdown = 'file:///' & StringReplace($SFdown,"","/") EndIf EndIf Dim $BGS = "oBGSound" & $id $Soover = $BGS & ".loop = 1; if (" & $BGS & ".src == ''){" & $BGS & ".src ='" & $SFover & "'};" $Sodown = $BGS & ".loop = 1; " & $BGS & ".src ='" & $SFdown & "';" $SoNorm = $BGS & ".loop = 1; " & $BGS & ".src = '';" Dim $Env = "" if ($SoundBool) Then $Env = _ 'onmousedown="' & $Sodown & ' Image' & $id & '.src=' & chr(39) & $Imgdown & chr(39) & ';"' & @CRLF & _ 'onmouseover="' & $Soover & ' Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF & _ 'onmouseleave="' & $SoNorm & ' Image' & $id & '.src=' & chr(39) & $ImgNorm & chr(39) & ';"' & @CRLF & _ 'onmouseup="Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF Else $Env = _ 'onmousedown="Image' & $id & '.src=' & chr(39) & $Imgdown & chr(39) & ';"' & @CRLF & _ 'onmouseover="Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF & _ 'onmouseleave="Image' & $id & '.src=' & chr(39) & $ImgNorm & chr(39) & ';"' & @CRLF & _ 'onmouseup="Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF EndIf $HtmlCode = _ '<div id="' & $id & '"' & @CRLF & $Env & @CRLF & _ 'style="margin:0;padding:' & $bpadding & 'px;border-width:' & $bWidth & 'px;' & _ 'border-style:solid;border-color:' & $bColor & ';position:absolute;top:0px;left:' & _ '0px;width:' & $Width & 'px;height:' & $Height & 'px;' & @CRLF & _ 'text-align:center;' & @CRLF & _ 'cursor:pointer;">' & @CRLF & _ '<img src="' & $ImgNorm & '"' & @CRLF & _ 'id="Image' & $id & '" alt="" title=""' & @CRLF & _ 'style="margin:0;padding:0;border-width:0;width:100%;height:100%">' & @CRLF & _ '<p id="p' & $id & '"' & @CRLF & _ 'UNSELECTABLE="on"' & @CRLF & _ 'style="margin:0;padding:0;font-family:' & $Fface & ';font-size:' & $Fsize & 'px;color:' & $Fcolor & ';' & _ 'font-style:' & $Fstyle & ';font-weight:' & $Fweight & ';text-decoration:' & $decoration & _ ';text-align:center;position:absolute;top:' & $Align & 'px;left:0px;width:100%;height:100%">' & @CRLF & _ $Text & _ '</p>' & @CRLF & _ '<BGSOUND id="' & $BGS & '"></div>' $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $HtmlCode & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next ObjEvent($IeObj.document.getElementById($id),$FunctionPrefix) if @error Then Return 0 Return $NweObjs EndFuncResWebControls.au3expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=no #AutoIt3Wrapper_Res_File_Add=CARLIFT.GIF,GIFIMAGE,CARLIFT.GIF,0 ;uppercase (StrResType/StrResName) #AutoIt3Wrapper_Res_File_Add=NORMAL.JPG,JPGIMAGE,NORMAL.JPG,0 ;uppercase (StrResType/StrResName) #AutoIt3Wrapper_Res_File_Add=PRESS.JPG,JPGIMAGE,PRESS.JPG,0 ;uppercase (StrResType/StrResName) #AutoIt3Wrapper_Res_File_Add=OVER.JPG,JPGIMAGE,OVER.JPG,0 ;uppercase (StrResType/StrResName) #AutoIt3Wrapper_Res_File_Add=OVER.WAV,WAVIMAGE,OVER.WAV,0 ;uppercase (StrResType/StrResName) #AutoIt3Wrapper_Res_File_Add=DOWN.WAV,WAVIMAGE,DOWN.WAV,0 ;uppercase (StrResType/StrResName) if Not (@Compiled) Then Exit(MsgBox(0,"","Must compile the Script With Options")) #include <GUIConstantsEx.au3> #include <Array.au3> GUICreate("Gui Web controls") $ObjsArray1 = WebCreateButton("Button1_","Id1", 10, 30,190,60,"Button1" , _ "JPGIMAGE/NORMAL.JPG","JPGIMAGE/PRESS.JPG","JPGIMAGE/OVER.JPG", True , _ "WAVIMAGE/OVER.WAV","WAVIMAGE/DOWN.WAV",True) $ObjsArray2 = WebCreatePic("Pic1_","Id2","GIFIMAGE/CARLIFT.GIF",280, 30,100,100,"#F0F0F0",True) $ObjsArray3 = WebCreateVideoObj("Id3","AVI.AVI",10,140,380,250) GUISetState() _ArrayDisplay($ObjsArray3, "") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func Pic1_onClick() Local $o_Pic = @COM_EventObj MsgBox(0,"Msg","Pic1_onClick") EndFunc Func Button1_onClick() Local $o_Button = @COM_EventObj MsgBox(0,"Msg","Button1_onClick") EndFunc Func WebCreateVideoObj($id,$Filename,$Left,$top,$Width,$Height,$autoplay = "true") if Not StringInStr($Filename,":") Then $Filename = 'file:///' & StringReplace(@ScriptDir,"","/") & "/" & $Filename Else $Filename = 'file:///' & StringReplace($Filename,"","/") EndIf Dim $FileType = StringUpper(StringRight($Filename,4)) , $Embed = "" Select Case $FileType == ".AVI" $Embed = '<object id="' & $id & '" style="margin:0;padding:0;border-width:0;width:100%;' & _ 'height:100%;" type="video/avi" />' & @CRLF & _ '<param name="src" value="' & $Filename & '">' & @CRLF & _ '<param name="autoplay" value="' & $autoplay & '">' & @CRLF & _ '</object>' & @CRLF Case Else Return 0 EndSelect $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0;' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $Embed & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next Return $NweObjs EndFunc Func WebCreatePic($FunctionPrefix,$id,$Filename,$Left,$top,$Width,$Height,$BkColor = "#F0F0F0",$Res = False,$CssStyle = "") $ScriptDir = StringReplace(@ScriptDir,"","/") if ($Res) Then $AutoItExe = StringSplit(@AutoItExe,"") $AutoItExe = $AutoItExe[$AutoItExe[0]] $Filename = 'res://' & $AutoItExe & "/" & $Filename ; $Filename ==> uppercase (StrResType/StrResName) Else if Not StringInStr($Filename,":") Then $Filename = 'file:///' & $ScriptDir & "/" & $Filename Else $Filename = 'file:///' & StringReplace($Filename,"","/") EndIf EndIf if ($CssStyle == "") Then $HtmlCode = _ '<img src="' & $Filename & '"' & @CRLF & _ 'id="' & $id & '" alt="" title=""' & @CRLF & _ 'style="margin:0;padding:0;border-width:0;width:100%;height:100%;background-color: ' & $BkColor & '">' Else $HtmlCode = _ '<img src="' & $Filename & '"' & @CRLF & _ 'id="' & $id & '" alt="" title=""' & @CRLF & _ 'style="' & $CssStyle & '">' EndIf $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0;' & @CRLF & _ 'background-color: ' & $BkColor & ';' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $HtmlCode & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next ObjEvent($IeObj.document.getElementById($id),$FunctionPrefix) if @error Then Return 0 Return $NweObjs EndFunc Func WebCreateButton($FunctionPrefix,$id,$Left,$Top,$Width,$Height,$Text = "" , _ $ImgNorm = "Normal.jpg" , $Imgdown = "Press.jpg" , $Imgover = "Over.jpg", _ $SoundBool = True,$SFover = "over.wav",$SFdown = "down.wav",$Res = False,$Fface ="Arial", _ $Fcolor = "0",$Fsize = 0,$Fweight = "800",$Fstyle = "normal" , $decoration = "none" , _ $Align = "0",$bWidth = "0",$bColor = "#003399",$bpadding = "0") if ($Fsize = 0) Then $Fsize = Int(($Height + 1) / 2) if ($Align == 0) Then $Align = (int($Height) / 2) - ($Fsize / 2) $ScriptDir = StringReplace(@ScriptDir,"","/") if ($Res) Then $AutoItExe = StringSplit(@AutoItExe,"") $AutoItExe = $AutoItExe[$AutoItExe[0]] $ImgNorm = 'res://' & $AutoItExe & "/" & $ImgNorm ; $ImgNorm ==> uppercase (StrResType/StrResName) $Imgdown = 'res://' & $AutoItExe & "/" & $Imgdown ; $Imgdown ==> uppercase (StrResType/StrResName) $Imgover = 'res://' & $AutoItExe & "/" & $Imgover ; $Imgover ==> uppercase (StrResType/StrResName) $SFover = 'res://' & $AutoItExe & "/" & $SFover ; $SFover ==> uppercase (StrResType/StrResName) $SFdown = 'res://' & $AutoItExe & "/" & $SFdown ; $SFdown ==> uppercase (StrResType/StrResName) Else if Not StringInStr($ImgNorm,":") Then $ImgNorm = 'file:///' & $ScriptDir & "/" & $ImgNorm Else $ImgNorm = 'file:///' & StringReplace($ImgNorm,"","/") EndIf if Not StringInStr($Imgdown,":") Then $Imgdown = 'file:///' & $ScriptDir & "/" & $Imgdown Else $Imgdown = 'file:///' & StringReplace($Imgdown,"","/") EndIf if Not StringInStr($Imgover,":") Then $Imgover = 'file:///' & $ScriptDir & "/" & $Imgover Else $Imgover = 'file:///' & StringReplace($Imgover,"","/") EndIf if Not StringInStr($SFover,":") Then $SFover = 'file:///' & $ScriptDir & "/" & $SFover Else $SFover = 'file:///' & StringReplace($SFover,"","/") EndIf if Not StringInStr($SFdown,":") Then $SFdown = 'file:///' & $ScriptDir & "/" & $SFdown Else $SFdown = 'file:///' & StringReplace($SFdown,"","/") EndIf EndIf Dim $BGS = "oBGSound" & $id $Soover = $BGS & ".loop = 1; if (" & $BGS & ".src == ''){" & $BGS & ".src ='" & $SFover & "'};" $Sodown = $BGS & ".loop = 1; " & $BGS & ".src ='" & $SFdown & "';" $SoNorm = $BGS & ".loop = 1; " & $BGS & ".src = '';" Dim $Env = "" if ($SoundBool) Then $Env = _ 'onmousedown="' & $Sodown & ' Image' & $id & '.src=' & chr(39) & $Imgdown & chr(39) & ';"' & @CRLF & _ 'onmouseover="' & $Soover & ' Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF & _ 'onmouseleave="' & $SoNorm & ' Image' & $id & '.src=' & chr(39) & $ImgNorm & chr(39) & ';"' & @CRLF & _ 'onmouseup="Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF Else $Env = _ 'onmousedown="Image' & $id & '.src=' & chr(39) & $Imgdown & chr(39) & ';"' & @CRLF & _ 'onmouseover="Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF & _ 'onmouseleave="Image' & $id & '.src=' & chr(39) & $ImgNorm & chr(39) & ';"' & @CRLF & _ 'onmouseup="Image' & $id & '.src=' & chr(39) & $Imgover & chr(39) & ';"' & @CRLF EndIf $HtmlCode = _ '<div id="' & $id & '"' & @CRLF & $Env & @CRLF & _ 'style="margin:0;padding:' & $bpadding & 'px;border-width:' & $bWidth & 'px;' & _ 'border-style:solid;border-color:' & $bColor & ';position:absolute;top:0px;left:' & _ '0px;width:' & $Width & 'px;height:' & $Height & 'px;' & @CRLF & _ 'text-align:center;' & @CRLF & _ 'cursor:pointer;">' & @CRLF & _ '<img src="' & $ImgNorm & '"' & @CRLF & _ 'id="Image' & $id & '" alt="" title=""' & @CRLF & _ 'style="margin:0;padding:0;border-width:0;width:100%;height:100%">' & @CRLF & _ '<p id="p' & $id & '"' & @CRLF & _ 'UNSELECTABLE="on"' & @CRLF & _ 'style="margin:0;padding:0;font-family:' & $Fface & ';font-size:' & $Fsize & 'px;color:' & $Fcolor & ';' & _ 'font-style:' & $Fstyle & ';font-weight:' & $Fweight & ';text-decoration:' & $decoration & _ ';text-align:center;position:absolute;top:' & $Align & 'px;left:0px;width:100%;height:100%">' & @CRLF & _ $Text & _ '</p>' & @CRLF & _ '<BGSOUND id="' & $BGS & '"></div>' $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $HtmlCode & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next ObjEvent($IeObj.document.getElementById($id),$FunctionPrefix) if @error Then Return 0 Return $NweObjs EndFunc Edited March 19, 2012 by MsgBox Link to comment Share on other sites More sharing options...
MsgBox Posted March 19, 2012 Author Share Posted March 19, 2012 ResVideoWebControls.au3 expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Res_File_Add=AVI.AVI,AVIIMAGE,AVI.AVI,0 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** if Not (@Compiled) Then Exit(MsgBox(0,"","Must compile the Script With Options")) #include <GUIConstantsEx.au3> #include <Array.au3> GUICreate("Gui Web controls") $ObjsArray1 = WebCreateVideoObj("Id3","AVIIMAGE/AVI.AVI",10,10,380,350,"true",True) GUISetState() _ArrayDisplay($ObjsArray1, "") While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WebCreateVideoObj($id,$Filename,$Left,$top,$Width,$Height,$autoplay = "true",$Res = False) $ScriptDir = StringReplace(@ScriptDir,"","/") if ($Res) Then $AutoItExe = StringSplit(@AutoItExe,"") $AutoItExe = $AutoItExe[$AutoItExe[0]] $Filename = 'res://' & $AutoItExe & "/" & $Filename ; $Filename ==> uppercase (StrResType/StrResName) Else if Not StringInStr($Filename,":") Then $Filename = 'file:///' & $ScriptDir & "/" & $Filename Else $Filename = 'file:///' & StringReplace($Filename,"","/") EndIf EndIf Dim $FileType = StringUpper(StringRight($Filename,4)) , $Embed = "" Select Case $FileType == ".AVI" $Embed = '<object id="' & $id & '" style="margin:0;padding:0;border-width:0;width:100%;' & _ 'height:100%;" type="video/avi" />' & @CRLF & _ '<param name="src" value="' & $Filename & '">' & @CRLF & _ '<param name="autoplay" value="' & $autoplay & '">' & @CRLF & _ '</object>' & @CRLF Case Else Return 0 EndSelect $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0;' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $Embed & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next Return $NweObjs EndFunc Link to comment Share on other sites More sharing options...
mesale0077 Posted March 19, 2012 Share Posted March 19, 2012 hi very nice maybe WebCreateflashbutton control? Link to comment Share on other sites More sharing options...
MsgBox Posted March 19, 2012 Author Share Posted March 19, 2012 hivery nicemaybe WebCreateflashbutton control?Thank you Link to comment Share on other sites More sharing options...
MsgBox Posted March 19, 2012 Author Share Posted March 19, 2012 Note Some objects, such as flash object does not support the Res protocol Link to comment Share on other sites More sharing options...
MsgBox Posted March 19, 2012 Author Share Posted March 19, 2012 application/pdf ResWebCreatePDFObj.au3 http://www.2shared.com/file/PG3Jqv_t/WebCreatePDFObj.html expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Res_File_Add=PDF.PDF,PDFIMAGE,PDF.PDF,0 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** if Not (@Compiled) Then Exit(MsgBox(0,"Err","Must compile the Script With Options")) #include <GUIConstantsEx.au3> #include <Array.au3> GUICreate("Gui Web controls",@DesktopWidth - 20,@DesktopHeight - 80) $ObjsArray1 = WebCreatePDFObj("Id3","PDFIMAGE/PDF.PDF",10,10,@DesktopWidth - 50,@DesktopHeight - 100,True) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WebCreatePDFObj($id,$Filename,$Left,$top,$Width,$Height,$Res = False) $ScriptDir = StringReplace(@ScriptDir,"\","/") if ($Res) Then $AutoItExe = StringSplit(@AutoItExe,"\") $AutoItExe = $AutoItExe[$AutoItExe[0]] $Filename = 'res://' & $AutoItExe & "/" & $Filename ; $Filename ==> uppercase (StrResType/StrResName) Else if Not StringInStr($Filename,":") Then $Filename = 'file:///' & $ScriptDir & "/" & $Filename Else $Filename = 'file:///' & StringReplace($Filename,"\","/") EndIf EndIf Dim $FileType = StringUpper(StringRight($Filename,4)) , $Embed = "" Select Case $FileType == ".PDF" $Embed = _ '<object style="margin:0;padding:0;border-width:0;width:100%;height:100%;"' & @CRLF & _ 'type="application/pdf">' & @CRLF & _ '<param name="SRC" value="' & $Filename & '">' & @CRLF & _ '</object>' Case Else Return 0 EndSelect $HtmlCode = '<html>' & @CRLF & _ '<head>' & @CRLF & _ '<style type="text/css">' & @CRLF & _ 'html,body{' & _ 'border-style:hidden;' & @CRLF & _ 'overflow:hidden;' & @CRLF & _ 'width:100%;' & @CRLF & _ 'height:100%;' & @CRLF & _ 'margin:0;' & @CRLF & _ 'padding:0;' & @CRLF & _ 'border-width:0;' & @CRLF & _ '}' & @CRLF & _ '</style>' & @CRLF & _ '</head>' & @CRLF & _ '<body>' & @CRLF & _ $Embed & _ '</body>' & @CRLF & _ '</html>' & @CRLF $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.document.Write($HtmlCode) $IeObj.document.close() Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next Return $NweObjs EndFunc Link to comment Share on other sites More sharing options...
MsgBox Posted March 20, 2012 Author Share Posted March 20, 2012 (edited) Another video objectFrom ResResVideoWebControls.au3http://www.2shared.com/file/G48YXedm/ResVideoWebControl.htmlexpandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #AutoIt3Wrapper_Res_File_Add=RES.AVI,RES,RES.AVI,0 #AutoIt3Wrapper_Res_File_Add=RES.HTM,RES,RES.HTM,0 #AutoIt3Wrapper_Res_File_Add=RES.PNG,RES,RES.PNG,0 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** if Not (@Compiled) Then Exit(MsgBox(0,"","Must compile the Script With Options")) #include <GUIConstantsEx.au3> #include <Array.au3> GUICreate("Gui Web controls") $ObjsArray3 = WebCreateVideoObj("Id3",10,10,380,390) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WebCreateVideoObj($id,$Left,$top,$Width,$Height) $AutoItExe = StringSplit(@AutoItExe,"") $AutoItExe = $AutoItExe[$AutoItExe[0]] $URL = 'res://' & @AutoItExe & "/RES/RES.HTM" ; $Filename ==> uppercase (StrResType/StrResName) $IeObj = ObjCreate("Shell.Explorer.2") if Not IsObj($IeObj) Then Return 0 GUICtrlCreateObj($IeObj,$Left,$Top,$Width,$Height) $IeObj.navigate("about:blank") $IeObj.navigate($URL) Dim $NweObjs[$IeObj.document.all.length + 1][4] $NweObjs[0][0] = $IeObj $NweObjs[0][1] = "Webbrowser" For $i = 0 To $IeObj.document.all.length - 1 $NewObj = $IeObj.document.all($i) $NweObjs[$i + 1][0] = $NewObj $NweObjs[$i + 1][1] = $NewObj.tagName $NweObjs[$i + 1][2] = $NewObj.id $NweObjs[$i + 1][3] = $i Next Return $NweObjs EndFuncRES.htm<html> <head> <style type="text/css"> html,body{border-style:hidden; overflow:hidden; width:100%; height:100%; margin:0; padding:0; border-width:0; background-color:#F0F0F0; } </style> </head> <body> <img id="Id3" src = "RES.PNG" dynsrc="RES.AVI" loop="1" style="margin:0;padding:0;border-style:double;border-color:#FF8080;border-width:9px;width:100%;height:80%;"> <form style="margin:0;padding:0;border-style:double;border-color:#FF8080;border-width:9px"> <input type="button" value="Play/Replay" onclick="Id3.loop = 1; Id3.dynsrc ='RES.AVI';"> <input type="button" value="Stop" onclick="Id3.loop = 1; Id3.dynsrc = '';"> </form> </body> </html> Edited March 20, 2012 by MsgBox Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now