Shoutbox

[?] Invoke first personalised status - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [?] Invoke first personalised status (/showthread.php?tid=81742)

[?] Invoke first personalised status by Spunky on 02-18-2008 at 10:29 PM

Based on CookieRevised's reply to Call MsgPlus functions from a script I'm trying to call personalised statuses... The function seems to work, but with no effect. The post would be for 4.50 right?


RE: [?] Invoke first personalised status by felipEx on 02-20-2008 at 01:08 AM

It works fine here :)

code:
var h = Messenger.ContactListWndHandle;
if (!h) h = Interop.Call('user32', 'FindWindowW','MSNHiddenWindowClass','');
Interop.Call('user32', 'PostMessageW', h, 0x0111 /* WM_COMMAND */, 7700 /* wParam (cmdid) */, 0x0000 /* lParam */ );

RE: [?] Invoke first personalised status by Spunky on 02-20-2008 at 04:42 PM

It was working part of the time ^o) I think it works now as long as the CL is not minimized/closed


RE: [?] Invoke first personalised status by CookieRevised on 02-20-2008 at 10:57 PM

quote:
Originally posted by SpunkyLoveMuff
It was working part of the time ^o) I think it works now as long as the CL is not minimized/closed
With using my example code: when the contactlist is closed there is no contactlist window to get the handle from and thus not a window to send the message to. So obviously that wont work; the contactlist needs to exist (it can be minimized though)....

because of:
  Interop.Call('User32', 'PostMessageW', Messenger.ContactListWndHandle, WM_COMMAND, wParam, lParam);


-

If you don't want to depend on Plus! to get the handle of the contactlist window (thus by using the Messenger.ContactListWndHandle property) you can also send the WM_COMMAND to the hidden Messenger window. But again, you of course need to get the handle to that window in order to send the message.

But beware if you use felipEx's example code. That wont work properly when you have more than one Windows Live Messenger running (polygamy).

See here and/or here for a short solution to get the handle to the MSNHiddenWindowClass window of the Windows Live Messenger client the code is running in.

If you don't do that, you might/will end up changing stuff in the other Messenger client (and thus in the other Messenger accounts)...

;)