Toasts on receivers pc |
Author: |
Message: |
m0m0
New Member
Posts: 6
Joined: Jul 2004
|
O.P. Toasts on receivers pc
Hi!
I'm trying to write a plugin in VB where i want to display a toast on the receivers pc.
But i dont know how to do this.
I do this in the ParseCommand function:
code: ElseIf (StrComp(LCase(sCommand), "/xmsg", vbTextCompare) = 0) Then
sResult = Chr(nCCNotify) + "showm"
sResult = sResult & sCommandArg
ParseCommand = True
Exit Function
And this in the ReceiveNotify function:
code: If (StrComp(sNotifyCode, "showm", vbTextCompare) = 0) Then
DisplayToast sText, "myplugin", "", True
ReceiveNotify = True
Exit Function
End If
When i send "/xmsg test" the toast appears at my pc AND at the receivers pc and the message "test" appears at BOTH message windows.
The only thing i want is that the toast appears at the receivers pc, NOT on my own and there shouldnt be displayed any text in the message window.
Can anyone help me to do this??
thx,
m0m0
|
|
07-19-2004 10:52 AM |
|
|
(CyBeRDuDe)
Senior Member
Posts: 512 Reputation: 21
38 / / –
Joined: Jul 2003
|
RE: Toasts on receivers pc
Hehe... I don't think that is supposed to happen... ... I don't get that.... hmm... I can't see anything wrong with the code you posted.... I hope someone else will help....
|
|
07-19-2004 12:02 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Toasts on receivers pc
I was having the same problem with my Remote Shutdown Plugin I was designing, the only work around I had was sending the UserEmail (recieved at Initialization) with the message and compare it to the one on the computer if its the same dont do anything but if its different then display the toast. Whats happening is when you type in the command the plugin on your computer gets the RecieveNotify code to because its in the convo window.
code: Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
Initialize = True
strUserEmail = sUserEmail
End Function
code: sResult = Chr(nCCNotify) + "showm" + "Display Toast " + vbCrLf + "Text: " + sCommandArg + vbCrLf + "Email: " + strUserEmail
code: Public Function ReceiveNotify(ByVal sNotifyCode As String, ByVal sText As String, ByVal sContactName As String, ByVal oConversationWnd As Object, ByRef sTextToSend As String) As Boolean
If (StrComp(sNotifyCode, "showm", vbTextCompare) = 0) Then
Dim sptRecievedText() As String
strSplit sText, sptRecievedText(), Chr(13)
sptRecievedText(1) = Replace(sptRecievedText(1), "Text: ", "")
sptRecievedText(2) = Replace(sptRecievedText(2), "Email: ", "")
If sptRecievedText(2) = strUserEmail Then
ReceiveNotify = False
Exit Function
Else
DisplayToast sptRecievedText(2), "myplugin", "", True
ReceiveNotify = True
Exit Function
End If
End If
ReceiveNotify = False
End Function
Here is a good Split Function I found on PSC (Put This Into A Module
code: Public strUserEmail As String
Public Function strSplit(ByVal Sin As String, sOut() As String, Optional sDelim As String, Optional nLimit As Long = -1, Optional bCompare As VbCompareMethod = vbBinaryCompare) As Variant
Dim sRead As String
If sDelim = "" Then sDelim = " "
If InStr(Sin, sDelim) = 0 Then
ReDim sOut(0) As String
sOut(0) = Sin
strSplit = sOut
Exit Function
End If
sRead = ReadUntil(Sin, sDelim, bCompare)
Do
ReDim Preserve sOut(nC)
sOut(nC) = sRead
nC = nC + 1
If nLimit <> -1 And nC >= nLimit Then Exit Do
sRead = ReadUntil(Sin, sDelim)
Loop While sRead <> "~TWA"
ReDim Preserve sOut(nC)
sOut(nC) = Sin
strSplit = sOut
End Function
Public Function ReadUntil(ByRef Sin As String, sDelim As String, Optional bCompare As VbCompareMethod = vbBinaryCompare) As String
Dim nPos As Long
nPos = InStr(1, Sin, sDelim, bCompare)
If nPos > 0 Then
ReadUntil = Left(Sin, nPos - 1)
Sin = Mid(Sin, nPos + Len(sDelim))
Else
ReadUntil = "~TWA"
End If
End Function
|
|
07-19-2004 04:16 PM |
|
|
Millenium_edition
Veteran Member
Posts: 1787 Reputation: 57
Joined: Apr 2003
|
RE: Toasts on receivers pc
why not use sContactName?
|
|
07-19-2004 04:21 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Toasts on receivers pc
quote: Originally posted by Millenium_edition
why not use sContactName?
Because if you use sContactName you have to use the Messenger Api to get your NickName and compare them, because Plus! returns your Email and the Contacts Nickname (kinda uncomparable dont you think?)
And we all know what happens with the Messenger API on XP
|
|
07-19-2004 04:28 PM |
|
|
Millenium_edition
Veteran Member
Posts: 1787 Reputation: 57
Joined: Apr 2003
|
RE: Toasts on receivers pc
ah yes... but then you can loop through the oConversationWnd.Contacts to find it? and even on XP that will work because plus! fixes that
|
|
07-19-2004 06:26 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Toasts on receivers pc
quote: Originally posted by Millenium_edition
ah yes... but then you can loop through the oConversationWnd.Contacts to find it? and even on XP that will work because plus! fixes that
Take your pick, I didn't know about that for the oConversationWnd object. Learn something new every day.
|
|
07-19-2004 06:41 PM |
|
|
m0m0
New Member
Posts: 6
Joined: Jul 2004
|
O.P. RE: Toasts on receivers pc
i tried the one with the email comparison and it worked ... thx ... but the text (
Display Toast
Text: ***
Email: ***
) still appears in the message window at both pcs ... how can i avoid that?
thx
|
|
07-19-2004 08:26 PM |
|
|
Millenium_edition
Veteran Member
Posts: 1787 Reputation: 57
Joined: Apr 2003
|
RE: Toasts on receivers pc
|
|
07-19-2004 08:39 PM |
|
|
m0m0
New Member
Posts: 6
Joined: Jul 2004
|
O.P. RE: Toasts on receivers pc
and where shall i put that in?
|
|
07-19-2004 08:46 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|