From WikiChip
Difference between revisions of "mirc/commands/comopen"
m (Bot: Automated text replacement (-Added On:.+\n?\n?\n?\n?\n? +)) |
Maroonbells (talk | contribs) (Add'l Example) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{mirc title|/comopen Command}} | ||
The '''/comopen command''' opens a COM connection to specified programmatic identifier with the assigned name. Your script should check {{mIRC|$comerr}} after opening the connection to make sure the connection was established successfully. | The '''/comopen command''' opens a COM connection to specified programmatic identifier with the assigned name. Your script should check {{mIRC|$comerr}} after opening the connection to make sure the connection was established successfully. | ||
Line 20: | Line 21: | ||
}</syntaxhighlight> | }</syntaxhighlight> | ||
+ | <source lang="mIRC"> | ||
+ | ; see more documentation at: https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys(v=vs.110).aspx | ||
+ | ; and be careful about mIRC interpreting % & and other special characters | ||
+ | //sendkeys {ESC}%o{END}{UP 2}%bText In mIRC Titlebar+{TAB}{ENTER} | ||
+ | alias sendkeys { | ||
+ | ; trying to create unique WshShell object | ||
+ | var %name sendkeys $+ $ticks $+ $rand(111,9999) | ||
+ | .comopen %name WScript.Shell | ||
+ | if (!$comerr) { | ||
+ | var %result $com(%name,SendKeys,3,bstr,$1-) | ||
+ | ;Destroy object when finished with it | ||
+ | .comclose %name | ||
+ | return %result | ||
+ | } | ||
+ | return 0 | ||
+ | } | ||
+ | </source> | ||
== Compatibility == | == Compatibility == | ||
− | + | {{mIRC compatibility|5.9}} | |
== See also == | == See also == | ||
Line 29: | Line 47: | ||
* {{mIRC|$comcall}} | * {{mIRC|$comcall}} | ||
* {{mIRC|$comval}} | * {{mIRC|$comval}} | ||
+ | * {{mIRC|$comerr}} | ||
* {{mIRC|/comclose}} | * {{mIRC|/comclose}} | ||
* {{mIRC|/comreg}} | * {{mIRC|/comreg}} | ||
+ | * {{mIRC|/comlist}} | ||
{{mIRC command list}} | {{mIRC command list}} | ||
− | [[Category: | + | [[Category:mIRC commands|comopen command - mIRC]] |
Latest revision as of 02:42, 9 December 2017
Commands & Identifiers
Basics
Events
Matching Tools
Data Storage
Control Structures
GUI Scripting
Sockets
Advanced Scripting
Additional Resources
Security
Other
The /comopen command opens a COM connection to specified programmatic identifier with the assigned name. Your script should check $comerr after opening the connection to make sure the connection was established successfully.
Synopsis[edit]
/comopen <name> <progid>
Switches[edit]
None
Parameters[edit]
- <name> - Connection name to be used
- <progid> - Programmatic Identifier
Example[edit]
Alias Example { ;Create a WshShell object comopen Example wscript.shell ;Destroy object comclose Example }
; see more documentation at: https://msdn.microsoft.com/en-us/library/system.windows.forms.sendkeys(v=vs.110).aspx ; and be careful about mIRC interpreting % & and other special characters //sendkeys {ESC}%o{END}{UP 2}%bText In mIRC Titlebar+{TAB}{ENTER} alias sendkeys { ; trying to create unique WshShell object var %name sendkeys $+ $ticks $+ $rand(111,9999) .comopen %name WScript.Shell if (!$comerr) { var %result $com(%name,SendKeys,3,bstr,$1-) ;Destroy object when finished with it .comclose %name return %result } return 0 }
Compatibility[edit]
Added: mIRC v5.9
Added on: 26 Apr 2001
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.
See also[edit]
mIRC commands list