Sign in to follow this  
Followers 0
patlim4152

Two quick questions

4 posts in this topic

Heya,

Just two quick questions

1. I've seen functions like ObjCreate etc. This is obviously not in the AutoIt helpfile, so I was wondering whether there was a list somewhere on where to find these functions and the correct syntax involved?

2. I'm trying to download a certain picture which is in the code, I'm pretty sure it is possible somehow, already have something started with IE.au3, but was wondering whether if I needed any more "external" functions which could be useful, would help a ton.

Thanks in advance.

Share this post


Link to post
Share on other sites



Heya,

Just two quick questions

1. I've seen functions like ObjCreate etc. This is obviously not in the AutoIt helpfile, so I was wondering whether there was a list somewhere on where to find these functions and the correct syntax involved?

2. I'm trying to download a certain picture which is in the code, I'm pretty sure it is possible somehow, already have something started with IE.au3, but was wondering whether if I needed any more "external" functions which could be useful, would help a ton.

Thanks in advance.

Just two quick answers

1. Get the beta version of AutoIt: http://www.autoitscript.com/autoit3/files/beta/autoit/

2. See above

Share this post


Link to post
Share on other sites

Heya,

Just two quick questions

1. I've seen functions like ObjCreate etc. This is obviously not in the AutoIt helpfile, so I was wondering whether there was a list somewhere on where to find these functions and the correct syntax involved?

Moin, moin...:o!

Witch version of autoit do you use? But sorry, friends, here is an extract of my version of helpfile

Function Reference

ObjCreate

--------------------------------------------------------------------------------

Creates a reference to a COM object from the given classname.

ObjCreate ("classname" [, "servername" [,"username", ["password"]]] )

Parameters

Classname The class of the object in the following format:

"appname.objectype"

Servername Optional name of a remote computer from which the

object must be obtained

Username Optional name of a usercode on the remote computer

You have to enter this in the format "computer\usercode" or

"domain\usercode"

Password Optional password for the usercode on the remote computer

Return Value

Success: Returns an object

Failure: Returns 0 and sets @error to 1

Remarks

Use ObjCreate() if you want to have a new instance of the referring application.

If you want to connect to an existing process, use ObjGet() instead.

Keep in mind that not all computers have the same set of Objects. So always check for errors after calling ObjCreate().

The following requirements apply if you want to access objects on remote computers:

-The user running the script must have the appropriate permissions.

-The Object on the remote computer must support DCOM (Distributed COM)

-The remote computer must have 'Remote Registry Service' and 'File and Printersharing' services running.

See the Obj/COM Reference for more information about Objects.

Related

ObjGet, IsObj, GUICtrlCreateObj, ObjEvent

Example

; Example 1

;

; Counting the number of open shell windows

$oShell = ObjCreate("shell.application") ; Get the Windows Shell Object

$oShellWindows=$oShell.windows ; Get the collection of open shell Windows

if Isobj($oShellWindows) then

$string="" ; String for displaying purposes

for $Window in $oShellWindows ; Count all existing shell windows

$String = $String & $window.LocationName & @CRLF

next

Msgbox(0,"Shell Windows","You have the following shell windows:" & @CRLF & @CRLF & $String);

endif

exit

; Example 2

;

; Open the MediaPlayer on a REMOTE computer

$oRemoteMedia = ObjCreate("MediaPlayer.MediaPlayer.1","name-of-remote-computer")

If not @error then

Msgbox(0,"Remote ObjCreate Test","ObjCreate() of a remote Mediaplayer Object successfull !")

$oRemoteMedia.Open("c:\windows\media\Windows XP Startup.wav") ; Play sound if file is present

Else

Msgbox(0,"Remote ObjCreate Test","Failed to open remote Object. Error code: " & hex(@error,8))

Endif


[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Share this post


Link to post
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
Sign in to follow this  
Followers 0