Is nice as this is an AutoIt forum and a totally AutoIt solution is good. But here we use many other system and 3rd party dll's and the like to accomplish a desired task. Me, I have centered on Flash content: as a stand alone and as a GUI to/through AutoIt.
So, I made a clock face (actually, I used an existing clock face modified for this example) in flash to display as a stand alone application on the desktop (verses a browser window.) Transparent but clickable - context menu and dragable. It is a fullscreen GUI with one control, an IE embed. The HTML embeds a specially made Flash movie (.swf) file. This swf connects to the AutoIt via IE events, initializes and then loads a 'target' movie, ...in this case the clock face. The AutoIt script, HTML and initial swf orchestrate a desktop control environment for the target movie to run and comunicate to the hosting computer.
This is a step in my working towards a Flash/AutoIt integration and seems to work just fine for now, thanks to many here especially lod3n.
Here is a sample code where the HTML, swf and target movie (clock face) are grabbed from my site via a InetGet:
Plain Text
#include <GUIConstants.au3>
#include <IE.au3>
#include <Misc.au3>
; ...setup Initializations
Opt("TrayIconHide", 1)
_IEErrorHandlerRegister()
Dim $guiWinTitle = "swfSMexe"
Dim $Version = "v070623a"
Dim $AboutText = $guiWinTitle & " " & $Version & " " & @LF & "by gsb" & @LF
; ...setup hotkeys
HotKeySet("^+v", "_ToggleVisibility")
HotKeySet("{ESC}", "_Exit")
; ...setup files
Local $htmlFilename = @ScriptDir & "\swfSMexe.htm"
Local $swfFilename = @ScriptDir & "\swfSMexe.swf"
Local $swfTarget = @ScriptDir & "\TransparentClock.swf"
Local $imageFile = @ScriptDir & "\required.gif"
InetGet("http://www.GypsyTrader.com/SWiSHmax/au3Examples/swfSMexe.htm",$htmlFilename)
InetGet("http://www.GypsyTrader.com/SWiSHmax/au3Examples/swfSMexe.swf",$swfFilename)
InetGet("http://www.GypsyTrader.com/SWiSHmax/au3Examples/TransparentClock.swf",$swfTarget)
InetGet("http://www.GypsyTrader.com/SWiSHmax/au3Examples/required.gif",$imageFile)
;; ...size params
Local $height = @DesktopHeight + 4
Local $width = @DesktopWidth + 4
; ...Core GUI code
Local $mainGUI = GUICreate($guiWinTitle, $width, $height, -2, -2, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST)
GUISetBkColor(0xFFFFFF)
Local $ieOBJ = _IECreateEmbedded()
Local $ieCTL = GUICtrlCreateObj($ieOBJ, 0, 0, $width, $height)
GUICtrlSetResizing($ieCTL, $GUI_DOCKBORDERS)
GUICtrlCreatePic($imageFile, 0, 0, 1, 1, -1)
_IENavigate($ieOBJ, $htmlFilename)
Sleep(10);; needed for old sytems and slow machines
Local $oTarget = $ieOBJ.document.parentwindow.document.documentElement
$oTarget.setAttribute ("gsb", "")
Local $stageManager, $handler = ObjEvent($oTarget, "IeEvent_")
GUISetState(@SW_SHOW)
; ...setup runtime variables
Local $isVisible = 1
; ...main movie interface loop
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_Exit()
EndSwitch
WEnd
_Exit();; unreachable
;;----------------- fsCommand receiver
Func IeEvent_onpropertychange()
Local $oElement = @COM_EventObj
If IsObj($oElement.gsb) Then
If $oElement.gsb.cmd = "initialize" Then
$stageManager = $oElement.gsb.obj
$stageManager.SetVariable ("/:au3Init", $oElement.gsb.args)
$stageManager.gsbTrace("au3Init: "&$oElement.gsb.args)
Else
_fsCommand($oElement.gsb.cmd, $oElement.gsb.args)
EndIf
$oElement.gsb = ""
EndIf
EndFunc ;==>IeEvent_onpropertychange
;;----------------- fsCommand processor
Func _fsCommand($cmd, $args)
Select
Case $cmd = "_About"
_About($args)
Case $cmd = "quit"
_Exit()
Case $cmd = "_ToggleVisibility"
_ToggleVisibility()
Case $cmd = "_Alert"
_Alert($args)
Case Else
$stageManager.gsbTrace ("Unknown cmd: " & $cmd & " Args: [" & $args & "]")
EndSelect
EndFunc ;==>_fsCommand
;;----------------- Functions
Func _ToggleVisibility()
If Not $isVisible Then
GUISetState(@SW_SHOW)
$isVisible = 1
Else
GUISetState(@SW_HIDE)
$isVisible = 0
EndIf
EndFunc ;==>_ToggleVisibility
Func _Trace($str)
$stageManager.gsbTrace ($str)
EndFunc ;==>_Trace
Func _About($str = "")
MsgBox(266288, "About", _Iif($str = "", $AboutText, "swf: "&$str & @LF & "exe: "&$AboutText), 10); modal, top, info
EndFunc ;==>_About
Func _Alert($str)
MsgBox(266288, "Alert", $str, 10); modal, top, info
EndFunc ;==>_Alert
Func _Exit()
Exit
EndFunc ;==>_Exit
Well, just thought I'd post an example tonight. Let me know your thoughts.
Regards,
gsb
***EDIT: 070624a This example requires the "Adobe Flash Player" plug-in, v8 or better for IE. If you do not have it, the script fails silently. To get it: Flash Player Download Center
As an add-in, how would I add to the script a check to see if the target machine has the Flash Player plugin for IE? I know I could do it in Javascript from within the browser, but anyway, say via AutoIt searching the registry?
Edited by gsb, 24 June 2007 - 02:34 PM.
"Did you ever stop to think? ...and forget to restart!"
Hi,
Doesn't work for me ,
I get no errors when I run your script.
I get a minimized toolbar window and it sits dormant with nothing else on the screen till I hit escape.
Am I missing something or is my patience to short , I left it active for over five minutes.
Tried the hotkey for visibility but nothing happens.
But smashly, it should dl the files for you.
And I does require the Flash Player Plugin for IE to be on your machine. It is simply a transparent flash movie, swf.
You too had trouble martin? Argh....
gsb
"Did you ever stop to think? ...and forget to restart!"
Did you even look at the source? The flash files etc.
Don't be like that! Maybe you should have considered that I would have? Is that why you're RazorM, because you like to cut people up? The InetGets get those files, so when you said A file is needed then I asked because it didn't work for me.
@gsb: I don't use IE so I've now installed the Flash plugin and it works. It's beautiful!
Thanks martin.
I will add that as a prerequisite to my original post.
But an AutoIt'er that does not use IE... Isn't that an oxymoron?
( I am new here and that is meant to be funny. )
So much of AutoIt seems designed for IE automation and not other browsers.
As an add-in, how would I add to the script a check to see if the target machine has the Flash Player plugin for IE?
I know I could do it in Javascript from within the browser, but anyway, say via AutoIt searching the registry?
gsb
"Did you ever stop to think? ...and forget to restart!"
Thanks martin. I will add that as a prerequisite to my original post.
But an AutoIt'er that does not use IE... Isn't that an oxymoron? ( I am new here and that is meant to be funny. ) So much of AutoIt seems designed for IE automation and not other browsers. As an add-in, how would I add to the script a check to see if the target machine has the Flash Player plugin for IE? I know I could do it in Javascript from within the browser, but anyway, say via AutoIt searching the registry? gsb
I use Firefox!
When I installed the Flash plugin for IE the files were installed in D:\WINDOWS\system32\Macromed\Flash, and there is a registry entry in
- you need to add '59B32}' after the '...8E' as the name was clipped.
I understand there's no tone in writing but I only asked if you had looked at the source. My wording may have been unclear when I said a file needs to be downloaded, I was replying to smashly. I apologise.
I understand there's no tone in writing but I only asked if you had looked at the source. My wording may have been unclear when I said a file needs to be downloaded, I was replying to smashly. I apologise.
OK, all forgiven. I'm too easily irritated, but it's easy to make me smile as well Glad you replied.
Do you think someone who has not been active here for over 3 years is going to read that and update links from even longer ago?
Please use your brain a bit before posting.
M23
StringSize - Automatically size controls to fit text - ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray - Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command - GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI - NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure - - Notify - Small notifications on the edge of the display
RecFileListToArray
- An alternative to _FileListToArray with user-defined include/exclude masks, maximum recursion level, sorting and displayed path options
GUIListViewEx - Insert, delete, move, drag and sort ListView items
if(window.RemoveEventListener){ alert('Un init is called for GECKO' ); window.addEventListener("mousedown", null, true); window.RemoveEventListener("mousedown",this.onGeckoMouse(),true);