kjactive Posted July 3, 2005 Posted July 3, 2005 (edited) Well just another small example to embed an activeX component . Microsoft Preview - this little fellow can rotate, zoom and print out any graphics... expandcollapse popup; Author: Kåre Johansson ; AutoIt Version: 3.1.1.55 ; Description: Very Simple example: Embedding Preview object ; Date: 3 jul 2005 #include <GUIConstants.au3> $oRP = ObjCreate("Preview.Preview.1") GUICreate ("Embedded Preview control Test", 620, 425, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 405, 100, 15, $SS_CENTER) GuiCtrlSetFont($TagsPageC,9,400,4) GuiCtrlSetColor($TagsPageC,0x0000ff) GuiCtrlSetCursor($TagsPageC,0) $AboutC = GUICtrlCreateButton('Empty',105,400,70,20) $PrefsC = GUICtrlCreateButton('Empty',175,400,70,20) $StatC = GUICtrlCreateButton('Empty',245,400,70,20) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 600 , 385 ) $LinkoRP = ObjEvent($oRP,"IEEvent_","Preview"); this is a dummy event handle With $oRP; Object tag pool .Show('C:\Pics\Bali.jpg') ;.Zoom(150) I didn't figurate this out yet!!! EndWith GUISetState ();Show GUI While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={50F16B26-467E-11D1-8271-00C04FC3183B}','', @SW_HIDE) EndSelect WEnd GUIDelete () Exit This is just an example code and no functions is included but a information link is provided to get the feeling with this component that include a slideshow, graphic editor and printout... kjactive Edited July 3, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc...
FuryCell Posted July 4, 2005 Posted July 4, 2005 Cool! This is useful for showing images. but you should use a pic everybody has as an example. expandcollapse popup; Author: Kåre Johansson ; AutoIt Version: 3.1.1.55 ; Description: Very Simple example: Embedding Preview object ; Date: 3 jul 2005 #include <GUIConstants.au3> $oRP = ObjCreate("Preview.Preview.1") GUICreate ("Embedded Preview control Test", 620, 425, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 405, 100, 15, $SS_CENTER) GuiCtrlSetFont($TagsPageC,9,400,4) GuiCtrlSetColor($TagsPageC,0x0000ff) GuiCtrlSetCursor($TagsPageC,0) $AboutC = GUICtrlCreateButton('Empty',105,400,70,20) $PrefsC = GUICtrlCreateButton('Empty',175,400,70,20) $StatC = GUICtrlCreateButton('Empty',245,400,70,20) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 600 , 385 ) $LinkoRP = ObjEvent($oRP,"IEEvent_","Preview"); this is a dummy event handle With $oRP; Object tag pool .Show(@WindowsDir & "\Sandstone.bmp") ;.Zoom(150) I didn't figurate this out yet!!! EndWith GUISetState ();Show GUI While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $TagsPageC Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={50F16B26-467E-11D1-8271-00C04FC3183B}','', @SW_HIDE) EndSelect WEnd GUIDelete () Exit HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
layer Posted July 4, 2005 Posted July 4, 2005 This looks awesome, but no picture shows up and the window says "No file selected"... I even replaced the file path with a picture that I know exists! Any ideas on the problem? Thanks! FootbaG
FuryCell Posted July 4, 2005 Posted July 4, 2005 (edited) Here is an example using the object. It does a slideshow with all the JPEGs in your "My Pictures" folder. expandcollapse popup#include <GUIConstants.au3> $oRP = ObjCreate("Preview.Preview.1") $GUI = GUICreate ("Embedded Preview control Test", 620, 425, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 405, 100, 15, $SS_CENTER) GuiCtrlSetFont($TagsPageC,9,400,4) GuiCtrlSetColor($TagsPageC,0x0000ff) GuiCtrlSetCursor($TagsPageC,0) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 600 , 385 ) $LinkoRP = ObjEvent($oRP,"IEEvent_","Preview"); this is a dummy event handle GUISetState ();Show GUI $Search=FileFindFirstFile(@MyDocumentsDir & "\My Pictures\*.jpg") While 1 $File=@MyDocumentsDir & "\My Pictures\" & FileFindNextFile($Search) If @Error then ExitLoop WinSetTitle($GUI,"","Viewing Image:" & $File) $oRP.Show($File) Sleep(3000) WENd While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $TagsPageC Run(@ComSpec & ' /c start [url=http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={50F16B26-467E-11D1-8271-00C04FC3183B}','']http://www.myplugins.info/guids/typeinfo/t...#39;,''[/url], @SW_HIDE) EndSelect WEnd GUIDelete () Exit Edited July 4, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
layer Posted July 4, 2005 Posted July 4, 2005 Now that worked That's actually amazing!!! I just found out where to find objects from applications, so I;m going to go experiment or play counter-strtike! FootbaG
FuryCell Posted July 4, 2005 Posted July 4, 2005 Now that worked That's actually amazing!!! I just found out where to find objects from applications, so I;m going to go experiment or play counter-strtike! <{POST_SNAPBACK}>yeah! I can't wait to see what other possiblities this awesome object has.P.S. fixed the CodeBox. HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
BigDaddyO Posted July 27, 2005 Posted July 27, 2005 Every time I try any of these applications my AutoIT crashes when closing the examples. any ideas? I am using Beta .64 Screenshot of error Attached. if you can use the detailed view info let me know. Thanks, Mike
layer Posted July 27, 2005 Posted July 27, 2005 It's BETA, there is bound to be plenty of crashes. I'm no COM expert, but there is a function around here to get the last COM error, someone else can probabl;y help better though, Cheers FootbaG
Dickb Posted July 27, 2005 Posted July 27, 2005 Change the script like this: Select Case $msg = $GUI_EVENT_CLOSE $oRP = 0 ; Close the object !!!! ExitLoop and it will not crash anymore (I hope) The object has to be closed and this is done with setting it to zero.
DaleHohm Posted July 27, 2005 Posted July 27, 2005 It's BETA, there is bound to be plenty of crashes. I'm no COM expert, but there is a function around here to get the last COM error, someone else can probabl;y help better though,Cheers<{POST_SNAPBACK}>See the helpfile... Function Reference -> Obj/COM Reference -> in the mail help here find "COM Error Handling". Shows you how to set up a special error handler for COM.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
randallc Posted July 27, 2005 Posted July 27, 2005 hi, I cannot run this slideshow script as there is an error on the @comspec line...? Can you help? Thanks, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
FuryCell Posted July 27, 2005 Posted July 27, 2005 (edited) hi,I cannot run this slideshow script as there is an error on the @comspec line...?Can you help?Thanks, Randall<{POST_SNAPBACK}>Here is an updated version.It should work now. Thats weird it used to work fine. It is like the bug just appeared out of no where. It now lets you close while the slideshow is being shown.expandcollapse popup#include <GUIConstants.au3> Opt("GuiOnEventMode",1) $oRP = ObjCreate("Preview.Preview.1") $GUI = GUICreate ("Embedded Preview control Test", 620, 425, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 405, 100, 15, $SS_CENTER) GuiCtrlSetFont($TagsPageC,9,400,4) GuiCtrlSetColor($TagsPageC,0x0000ff) GuiCtrlSetCursor($TagsPageC,0) GuiSetOnEvent($GUI_Event_Close,"Quit") GuiCtrlSetOnEvent($TagsPageC,"TagsPage") $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 600 , 385 ) $LinkoRP = ObjEvent($oRP,"IEEvent_","Preview"); this is a dummy event handle GUISetState ();Show GUI $Search=FileFindFirstFile(@MyDocumentsDir & "\My Pictures\*.jpg") While 1 $File=@MyDocumentsDir & "\My Pictures\" & FileFindNextFile($Search) If @Error then ExitLoop WinSetTitle($GUI,"","Viewing Image:" & $File) $oRP.Show($File) Sleep(3000) WENd While 1 Sleep(100) WEnd Func TagsPage() Run(@ComSpec & ' /c start http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid={50F16B26-467E-11D1-8271-00C04FC3183B}','', @SW_HIDE) EndFunc Func Quit() GuiCtrlDelete($GUIActiveX) $oORP=0 Exit EndFunc GUIDelete () ExitEdit:Put up right code becuase I put up the wrong one by mistake. Edited July 28, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
randallc Posted July 28, 2005 Posted July 28, 2005 Sorry,I meant in the slideshow script; I have just now used the dos line from the other to fix it and its OK; there is a ";" in that line in the thread above, Num4picRandall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW
FuryCell Posted July 28, 2005 Posted July 28, 2005 (edited) Sorry,I meant in the slideshow script; I have just now used the dos line from the other to fix it and its OK; there is a ";" in that line in the thread above, Num4picRandall<{POST_SNAPBACK}>Oops. :"> Posted wrong script. Sorry.Just put up the proper one now. Edited July 28, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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