2 posts in this topic
Is there a way to read data directly from the Windows Component Object Model (COM) interface?
I am trying to make a really simple disk space reporter tool for accounts on an Active Directory domain, to read the disk quota limit for the logged on user's home directory, and report how much disk space they are currently using.
MSDN: IDiskQuotaUser interface
I've coded the small script below, but it can't seem to get the instance of Windows Media player as it keeps going to @error, I've not used com objects before so any assistance would be appreciate. I already have WMP open and minimised. I retrieved "WMPlayerApp" from the AutoIT info tool, I've included a copy below.
I'm using these sources:
$oWMP = ObjGet("", "WMPlayerApp") If @error Then MsgBox(0, "Can't get WMP", "Couldn't connect to the WMP instance") Exit EndIf $wmpPlayState = $oWMP.playState MsgBox(0, "Play State", $wmpPlayState) $wmpSongName = $oWMP.currentMedia.name MsgBox(0, "Play State", $wmpSongName) I've also seen references to the below, but I want to get an existing open WMP:
ObjCreate("wmplayer.OCX") and have looked at the WMP.udf but can't see how it will do either of the functions I've coded above.
Hi all (Especially @water)
I wonder how to do this task in word from autoit.
Assume that i pasted some text into word with this code.
Local $oWord = ObjGet("","Word.Application") Local $wRangeObj = _Word_DocRangeSet($oWord, 0) Local $data = ClipGet() $wRangeObj.Text = $data $wRangeObj.Font.Bold = True So far so good. Now, i need to enter a new line in word and turn the Font.Bold = False.
Currently, i did it with activating the word window and Send() function. But i would like to do it with the help of COM object. How can i do that ?
Hello, I found a VB snippet which I would love to use in AutoIt
strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_Process") For Each objItem in colItems Wscript.Echo objItem.Name Wscript.Echo objItem.CommandLine Next Despite my best efforts, I am not able to understand a thing from that piece of code . All I know is that it outputs the Name and Commandline of all the processes currently running (Let's see if I am right).
Can anyone help me with convert this into AutoIt? Thanks in Advance!
hi am new and i just started learning autoit
am starting to do a little program that can help me in my work
i dont know how to do it correctly : a combobox that shows what com port are connected to devices in the computer and when i choose a port and click on a button called info_port i want that he desplay in $result the name of the device connected to the choosen com port.
i want to use this file to help me : CommMG.au3
#include 'CommMG.au3' ;comm ports library Global $result = GUICtrlCreateEdit("", 364, 135, 568, 595) Global $info_port = GUICtrlCreateButton("Info", 291, 85, 56, 25) Global $Port = GUICtrlCreateCombo("", 150, 85, 135, 24) $portlist = _CommListPorts(0) If Not @error = 1 Then For $pl = 1 To $portlist GUICtrlSetData($Port, $portlist[$pl]) Next EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg