What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Using DisplayToast in thread

Using DisplayToast in thread
Author: Message:
KooKiz
Junior Member
**


Posts: 41
Joined: Oct 2004
O.P. Using DisplayToast in thread
Hi, i'm coding an rss reader plugin but i've got a little problem.
My plugin's Initialize function launch a new thread that check periodically an url to see if the rss stream had changed. In that case i'd like to display a popup notification. So I wrote in my thread code :

If (form.rss_read() = 1) Then
     MsgBox("test")
     DisplayToast("news : " + lastrss, "Rss Feeder", urlrss, True)
End If


The message box is shown, but I don't see the popup :(
And if I try to show a popup in ParseCommand, that works well. Do you know where is the problem ? Is there a way to call this function from a thread ?

edit : I'm creating it in VB.Net, if you didn't recognize :)

This post was edited on 10-29-2004 at 01:08 PM by KooKiz.
10-29-2004 01:06 PM
Profile PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Using DisplayToast in thread
As Patchou said in the documentation (MPPluginConst.vb),

quote:
DisplayToast
    '//   Technical Note: the message must be sent from the same thread  //
    '//   Initialize() was called, else, Messenger Plus! will reject the //
    '//   call for security reasons.                                     //

So you can't call the function in thread other than Initialize(), for security reasons :)
10-29-2004 01:30 PM
Profile PM Web Find Quote Report
Concord Dawn
Veteran Member
*****

Avatar
This is a loopy fruit.

Posts: 1203
Reputation: 16
33 / Male / –
Joined: Feb 2004
RE: Using DisplayToast in thread
Once again we see evidence of Patchou's uber programming. Is it like that so that dodgy programs can't be bundled in with plugins easily?
[Image: 7.png]
10-29-2004 01:48 PM
Profile E-Mail PM Find Quote Report
KooKiz
Junior Member
**


Posts: 41
Joined: Oct 2004
O.P. RE: Using DisplayToast in thread
I'll search an other way to make it then :/
Do you now a simple way for my thread to make the main thread call DisplayToast ? I discovered MsgPlus yesterday so i'm not familiar with this api yet...

This post was edited on 10-29-2004 at 01:53 PM by KooKiz.
10-29-2004 01:52 PM
Profile PM Find Quote Report
KooKiz
Junior Member
**


Posts: 41
Joined: Oct 2004
O.P. RE: Using DisplayToast in thread
DisplayToast
SetNewName
SendMessage
Initialize
Uninitialize
Configure
PublishInfo
ParseCommand
ParseTag
ReceiveNotify

Are they the only function to interact with messenger plus or are there some more ?


TheBlasphemer > If I create a window in Initialize, isn't it a new thread ?

This post was edited on 11-01-2004 at 07:09 PM by KooKiz.
11-01-2004 07:07 PM
Profile PM Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: Using DisplayToast in thread
TB gave the best answer possible, that's how Messenger Plus! do it itself when it calls some stuff from Messenger. Create the window in yourmain thread. From your worker thread, send a message to this window and make the window call DisplayToast, Windows will do the rest for you :)
[Image: signature2.gif]
11-01-2004 07:46 PM
Profile PM Web Find Quote Report
KooKiz
Junior Member
**


Posts: 41
Joined: Oct 2004
O.P. RE: Using DisplayToast in thread
Thanks.
My plugin is nearly done, but I need a last bit of help.
I'd like to change user's own phone number to use messenger API function oMessenger_OnMyPhoneChange. To do that, I found the function oMessenger.Phone(vContact as object, ePhoneNumber as MessengerAPI.MPHONE_TYPE, bstrNumber As String)

I don't have any problem for ePhoneNumber and bstrNumber, but I don't know what I should put in vContact to change user's phone number.

Someone do ? :)
11-04-2004 12:43 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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