AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COM Standard Library
Goto page Previous  1, 2, 3, ... 11, 12, 13  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
BoBo¨
Guest





PostPosted: Thu Sep 13, 2007 12:01 pm    Post subject: Reply with quote

Well, I have found a [thread] like this one.

And it says:
> Aktuellen Song aus Windows Media Player auslesen
Read current song from Windows Media Player
> Versionen sind anscheinend egal. Ich habe das Vista SDK auf XP installiert und es mit dem WMP9 ausprobiert.
Looks like there are no (WMP) version dependancies. [He] has installed the Vista SDK on XP and tested it with WMP9.
> Ich habe mal das RemoteHost-Beispiel soweit gekürzt, dass nur der aktuelle Titel auf der Konsole ausgegeben wird. Die "RemoteHost.h" ist aus dem Sample.
[He] has used the RemoteHost-Sample [I guess from Vista SDK] and shortened it to display the current song at the console.

As I need the output as a variable to trigger my AHG script/GUI, I thought that method could be used.
Well, I'm not aware how to parse an audio stream [directly] with AHK, therefore I've expected to trigger WMP instead (which I use to execute/play the stream). Sad

Quote:
Exactly from where are you trying to get the infos?
From the stream (prefered) or the player.
Back to top
BoBo¨
Guest





PostPosted: Thu Sep 13, 2007 12:14 pm    Post subject: Reply with quote

Had a request [here] to follow another concept using [mediainfo.dll]. But had no response/luck. Sad
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Fri Sep 14, 2007 12:16 am    Post subject: Reply with quote

BoBo¨ wrote:
I've expected to trigger WMP instead (which I use to execute/play the stream).

You may use this instead. But I don't know if the URL will be updated to the original source, as MS is careful enough to not expose the original source of the streams.
You may better redownload COM.ahk as I recently updated it to include CoInitialize() inside AtlAxWinInit() too.

Code:
sUrl := "C:\temp.wmv" ; Replace it to the real URL.

COM_AtlAxWinInit()
Gui, +Resize +LastFound
Gui, Show, w800 h600 Center, WMP
hGui := WinExist()
pwmp := COM_AtlAxCreateControl(hGui, "WMPlayer.OCX")
COM_Invoke(pwmp, "URL=", sUrl)
COM_Invoke(pwmp, "Play")
Sleep, 3000

pmda := COM_Invoke(pwmp, "CurrentMedia")
sURL1:= COM_Invoke(pmda, "SourceURL")
name := COM_Invoke(pmda, "Name")
durn := COM_Invoke(pmda, "durationString")

MsgBox, % sURL1 . "|" . name . "|" . durn
Return

GuiClose:
Gui, Destroy
COM_Release(pmda)
COM_Release(pwmp)
COM_AtlAxWinTerm()
ExitApp
Back to top
View user's profile Send private message
BoBo¨
Guest





PostPosted: Fri Sep 14, 2007 3:31 pm    Post subject: Reply with quote

Hi Sean,
thx for your effort+time. Much appreciated (well, as always Very Happy)
If it comes to run local files/tracks your script is working perfect and delivered all details.
Unfortunately I can't still find a way to extract details on a single-track basis from within a mp3-stream running via WMP.

btw. Can you point out where to find that specific "strings" (methods?) which are used within your functions ...
Code:
COM_Invoke(pwmp, "Play")
pmda := COM_Invoke(pwmp, "CurrentMedia")
sURL1:= COM_Invoke(pmda, "SourceURL")
name := COM_Invoke(pmda, "Name")
durn := COM_Invoke(pmda, "durationString")
Back to Google ... Cool
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Fri Sep 14, 2007 3:59 pm    Post subject: Reply with quote

BoBo¨ wrote:
btw. Can you point out where to find that specific "strings" (methods?) which are used within your functions

I suppose the best place for these is always MSDN:
http://msdn2.microsoft.com/en-us/library/bb249259.aspx
Back to top
View user's profile Send private message
BoBo¨
Guest





PostPosted: Fri Sep 14, 2007 4:13 pm    Post subject: Reply with quote

Quote:
I suppose the best place for these is always MSDN
Erm, that's the environment where I've spent the last hours (indeed, I do my very best to help myself not to need help from you Embarassed).
Well, it looks like I will need an extra lifetime (or some good advise/training) to get an idea of those cryptic concepts. Crying or Very sad

What I've encountered so far:

oWMP.GetItemInfo("Artist")
oWMP.GetItemInfo("Title")

[?]
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Sat Sep 15, 2007 1:45 am    Post subject: Reply with quote

BoBo¨ wrote:
Well, it looks like I will need an extra lifetime (or some good advise/training) to get an idea of those cryptic concepts.

It needs some practice, as it's not so clear as crystal, obviously.

Quote:
oWMP.GetItemInfo("Artist")
oWMP.GetItemInfo("Title")

That page says they are obsolete. Sorry, but, I don't really want to go further into it myself, you better read the pages I linked. I'd welcome them if you have questions about CoHelper.ahk or COM.ahk, but, from now on I'd like to avoid questions about a specific COM object, unless it happens to be one I'm interested in or can be done in less than 10 minutes, because I think the function Invoke() now reaches the stage of resembling the well-known VBS syntax as possible as it can, so I suppose users could now adopt many useful sources in VBS to AHK scripts, hopefully without much effort.
Back to top
View user's profile Send private message
BoBo¨
Guest





PostPosted: Sat Sep 15, 2007 8:50 pm    Post subject: Reply with quote

Quote:
I'd welcome them if you have questions about CoHelper.ahk or COM.ahk,
Thx, I'm more than happy for that offer. Of help would be to have a sample "how to identify relevant objects and arguments within MSDN, and how to use them within these functions".
A how-to-use-Seans-COM-interface-tut.

Quote:
but, from now on I'd like to avoid questions about a specific COM object, unless it happens to be one I'm interested in or can be done in less than 10 minutes
Fair enough. Cool I've assumed my request had to be categorized as '5 minute challenge'. Shocked Looks like I was wrong Laughing
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Sun Sep 16, 2007 3:51 am    Post subject: Reply with quote

BoBo¨ wrote:
Of help would be to have a sample "how to identify relevant objects and arguments within MSDN, and how to use them within these functions".

You have to be already familiar with how to use COM, e.g. in VBS/JS, to utilize CoHelper.ahk/COM.ahk. It won't tell you about COM itself. I posted the translation of VBS/JS to AHK in the thread of CoHelper.ahk. And, occasionally I posted an example of it, if I think it's a good and relatively simple example to analyze, the recent one is:
http://www.autohotkey.com/forum/viewtopic.php?t=23117

I'm really perplexed that people expect more from me as I don't really know what should/could I do further than this. I'm not Chris. I really admire Chris for the excellent job he has done and his patience in dealing with the complaints, mostly unjustified/unfair IMO, he's got.

Quote:
I've assumed my request had to be categorized as '5 minute challenge'. Shocked Looks like I was wrong Laughing

I suppose you'd be really surprised when figuring out the needed work/objects you may have to do/deal with for your purpose. The worse is that even after that there is no guarantee that it'll succeed.
Back to top
View user's profile Send private message
Washboard
Guest





PostPosted: Tue Sep 18, 2007 8:39 pm    Post subject: Reply with quote

Hi Sean,

Thanks for your work. But I must say I don't understand how this work. I'm not a noob in using VBScript to access MS Office apps and in VBA (even if I'm not an expert...), but I don't understand how I can use your Standard Library COM to open an XL file, read or write in a cell, ...
So 2 questions :
- can you please give an example of how to work with Excel (for example), with some explanations ?
- can you give us a little doc for your COM library : for each function, what is it supposed to do, with which parameters and eventually a little example.
I know that writing doc is the less interesting thing in programming, but it's the more usefull to share your work, that seems very good (I red this post and the one on CoHelper, but the examples given don't help me much, and I ask myself if they are compatible with COM.ahk, as you said it is not fully compatible with CoHelper.ahk, and things like
Quote:
CLSID_iTunesApp := "{DC0C2640-1415-4644-875C-6F4D769839BA}"
IID_IiTunes := "{9DD6680B-3EDC-40DB-A771-E6FE4832E34A}"
are like chinese for me...)
Thanks a lot for all that you did and in advance for that you will do....
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Tue Sep 18, 2007 11:50 pm    Post subject: Reply with quote

Washboard wrote:
So 2 questions :
- can you please give an example of how to work with Excel (for example), with some explanations ?

Here is an example of Excel:
http://www.autohotkey.com/forum/topic16565-45.html

You better read about using Invoke() here:
http://www.autohotkey.com/forum/topic16631.html

Quote:
- can you give us a little doc for your COM library : for each function, what is it supposed to do, with which parameters and eventually a little example.

It's planned. OTOH, now most functions in COM.ahk are mainly used internally, so no real need to concern about them. The users need only to know to use:
Invoke, CreateObject/ActiveXObject, GetObject, ConnectObject.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Wed Sep 19, 2007 12:06 am    Post subject: Reply with quote

Washboard wrote:
Quote:
CLSID_iTunesApp := "{DC0C2640-1415-4644-875C-6F4D769839BA}"
IID_IiTunes := "{9DD6680B-3EDC-40DB-A771-E6FE4832E34A}"

For the example of iTunes, see this thread:
http://www.autohotkey.com/forum/topic19443.html
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Wed Sep 19, 2007 12:12 am    Post subject: Reply with quote

Here is one for Skype:
http://www.autohotkey.com/forum/topic23117.html
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1339

PostPosted: Wed Sep 19, 2007 12:32 am    Post subject: Reply with quote

Example for the Voice Recognition:
http://www.autohotkey.com/forum/topic20493.html
Back to top
View user's profile Send private message
Washboard
Guest





PostPosted: Wed Sep 19, 2007 5:53 am    Post subject: Reply with quote

Thanks Sean.
I didn't seen the topic on ADO COM. Very interesting. I'll try to use it.
Some (again) questions :
- These examples make reference to CoHelper.ahk. But you said (I don't remember where) that CoHelper and COM.ahk are not fully compatibles. So what is incompatible ? Are the examples in ADO COM (for example) can be "prefixed" with "#Include COM.ahk" rather than "#Include CoHelper.ahk"with no more modification than to prefix each COM function with "COM_" ?
For the documentation, I'd like to know, if it is usefull, the difference between COM_Invoke() and COM_Invoke_(), that I seen in the COM source, if the second one can be called directly and is usefull to use ...
For COM_CreateObject and COM_GetObject, I know what they do. They must work (almost) in the same way as the VBS/VBA equivalent. But I don't know the usage/utility of COM_ActiveXObject. Idem for COM_ConnectObject.
Thanks for the answers you gave/will give to me and for your work.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, ... 11, 12, 13  Next
Page 2 of 13

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group