Jump to content

What is AutoIt's ProgID?


Recommended Posts

The question is irrelevant. The Program ID is variable. As to how you get it, that's a different ball of wax.

14. How can I make sure only one copy of my script is run?

The easiest way is to rename the title of the hidden AutoIt window when your script first starts. Then in the same script check for that window title existing - if it does then another copy of the script is running.

; Place at the top of your script
$g_szVersion = "My Script 1.1"
If WinExists($g_szVersion) Then Exit ; It's already running
AutoItWinSetTitle($g_szVersion)
; Rest of your script goes here
The clue is in the FAQ, question 14.

Also ... AutoItWinGetTitle()

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Using a mutex is probably a lot safer (if your really want only one occurence of your prog. runnig). Search scripts to find sample usage.

Link to comment
Share on other sites

Thank you all very much. :-)

I don't see how the original question was translated into "How do I run one instance?" .

Since janus was happy with the answers I suppose I shouldn't worry, bit in case the PID is what's wanted then look up ProcessList.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

What is AutoIt's ProgID, the string which is the name of the control? I haven't been able to find it here.

Thank you all for your help, but I've not been able to find the answer to the original question.

ProcessList() would return the ProcessID, or PID as it is called in the documentation. However, this is not ProgID. I've looked at the _Singleton function in Misc.au3, but it doesn't look like it would provide the information needed.

Maybe I didn't phrase the question adequately. ProgID, or Programmatic IDentifier, is a COM identifier published by the vendor. To use AutoIt as a COM in another program, it is nessary to know AutoIt's ProgID so that it can be instanciated. It is similar to ClassName. For example, in

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

"MediaPlayer.MediaPlayer.1" is a ProgID of Windows Media Player ActiveX.

I wonder if anyone has done instancig AutoIt as an ActiveX control? I know that ActiveItX would be a better forum, but if you can help I'd appreciate it. Thanks.

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...