What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Script for webcam?

Script for webcam?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Script for webcam?
quote:
Originally posted by Hen
Hi,
When I opened the windows visual basic => Tools => reference, I added the Messenger API.
Browsing the "object browser" and then looking under IMessenger2 there is this function:
Messenger.StartVideo (vContact)

Why doesn't it work? :
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MessageKind)
{
var Contacts = ChatWnd.Contacts;  // Deafult will be current chat window, or do I need to specify this?
var e = new Enumerator(Contacts);
var Contact = e.item();  // Assume a chat window with only one contact, no need to iterate
Debug.Trace(Contact.Email)
if (Message.match("Camera")!=null){
Messenger.StartVideo(Contact)
}
}

Do I need to use "Interop::Call " ? - if so, how?
Also the "Debug.trace" doesnt show the contact email in the debug window.

Cheers,
Hen.
To add to what has been explained already:

If you would program in VB, then yes that is what you need todo; referencing that object. However you are now programming in JScript in Messenger Plus! which is another language and thus works differently. To get the object from Messenger in order to use it functions in JScript in Plus! you need to do what Spunky said in his first reply: first make and call the ActiveXObject.

But, there is a much easier way to do what you want, also shown by Spunky: use the SendMessage API again...

You can do this because the functions to start a webcam exist in Windows Live Messenger as a menu option. You can use the specific command for that menu item (which essentially is a sent number) to "simulate" a mouse click on that specific menu item and thus start the webcam.

This command number is also often known as the cmdid (command ID) and is of course program specific and even window specific (hence you also need to specify the window handle to where that cmdid needs to be send).

So, that parameter you ask for, that magic number can be found out by looking at the menu resources from the Windows Live Messenger program. This can be done with a program like ResHacker, as explained by Matty.

If you read the help on MSDN you see that the second parameter for the SendMessage API needs to be the "Message" (this name has got nothing todo with Instant Messaging!). This Message in this case is WM_COMMAND which has the numerical value 0x0111. As the third parameter you provide the cmdid of the menu item you whish to invoke.

I suggest to read the next page for detailed info:
http://www.msgpluslive.net/skins/resources/tut-How-to-find-CmdIds/


PS: don't try to use just any number. You're dealing with internal window stuff here and you can really screw things up if you don't provide the correct values.

This post was edited on 05-04-2009 at 04:00 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
05-04-2009 03:51 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Script for webcam? - by Hen on 03-11-2009 at 09:09 AM
RE: Script for webcam? - by mynetx on 03-11-2009 at 09:59 AM
RE: RE: Script for webcam? - by Hen on 03-11-2009 at 03:47 PM
RE: Script for webcam? - by mynetx on 03-11-2009 at 04:28 PM
RE: Script for webcam? - by Hen on 03-12-2009 at 10:39 AM
RE: Script for webcam? - by timeshifter on 03-16-2009 at 12:11 PM
RE: Script for webcam? - by CookieRevised on 03-17-2009 at 05:21 AM
RE: Script for webcam? - by timeshifter on 03-17-2009 at 11:57 AM
RE: Script for webcam? - by Spunky on 03-17-2009 at 12:24 PM
RE: Script for webcam? - by Hen on 05-01-2009 at 10:24 AM
RE: Script for webcam? - by Spunky on 05-01-2009 at 10:50 AM
RE: Script for webcam? - by Hen on 05-01-2009 at 02:47 PM
RE: Script for webcam? - by matty on 05-01-2009 at 02:52 PM
RE: Script for webcam? - by Spunky on 05-01-2009 at 05:50 PM
RE: Script for webcam? - by CookieRevised on 05-04-2009 at 03:51 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On