Shoutbox

Call DisplayToast from dll - 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: Call DisplayToast from dll (/showthread.php?tid=97632)

Call DisplayToast from dll by Hyriuu on 05-19-2011 at 08:34 PM

Hi,

I need your help, I would like call DisplayToast function from an external libraries (called with Interop::Call function) that I am writing in C#, is it possible ? how ?


RE: Call DisplayToast from dll by CookieRevised on 05-19-2011 at 10:09 PM

First of all, the function Interop::Call is Plus!-scripting code to call procedures in external libraries, it's to be used from within a Plus! script. You don't use it for invoking a toast.

Anyways, this said, I think I know what you actually mean/want, and yes you can invoke a Plus!-toast from inside an external library (provided Plus! is loaded of course). You can do it in several ways:

1) Use the old plugin-style way of invoking a toast by registering and then broadcasting the Windows message "MessengerPlus_DisplayToast". Example: J-Thread's reply to how to catch the MessengerPlus_DisplayToast in VB.NET or C#?
(this method was used in the old plugin system of Messenger Plus! 3, but it is still supported afaik. You don't need anything extra for this.)

2) Create a supporting Messenger Plus! script which creates a custom hidden Plus! window. In the script you subclass that hidden window and you listen to an incoming custom Windows message to that window. If you recieve the proper message, you invoke the DisplayToast Plus!-function from within the script, using the parameters set by your external code in some memory address (that memory address is send to your script via that custom Windows message in the form of a DWORD sized parameter). So, the external library/tool must simply set the needed parameters in some memory address, and then send a custom Windows message with that address as parameter to the (hidden) Plus!-window.
This method is used in the SendTo script to send files.
(this methods needs an additional Messenger Plus! script which creates a (hidden) window)

3) You can maybe, in some way, get the MsgPlus interface object and use it that way. Though I have no real clue how to do this. Also, it might be impossible without again creating a supporting script.
(this methods probably needs an additional Messenger Plus! script?)