What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Alert(MsgBox in VB) Help?

Pages: (2): « First [ 1 ] 2 » Last »
Alert(MsgBox in VB) Help?
Author: Message:
Hit
New Member
*


Posts: 10
Joined: Aug 2006
O.P. Alert(MsgBox in VB) Help?
Somebody know how to do a Yes/No alert or msgbox?
And explain how to use please :D
08-21-2006 05:48 PM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: Alert(MsgBox in VB) Help?
code:
var result = Interop.Call('user32', 'MessageBoxW', 0, 'Main message text', 'Title text',4);

if yes was selected result will contain 6
if no was selected result will contain 7
08-21-2006 05:58 PM
Profile PM Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: Alert(MsgBox in VB) Help?
Hi Hit !!

To make a Yes/no msgbox, I will use my Basic knowledge to explain it to you ;)

code:
Val=Interop.Call("User32.dll", "MessageBoxW", WndHandle,'Message','Title', Param);

// WndHandle can set to 0 if MsgBox is not attached to a window
// Param :
// 4 = MB_YESNO
//
// 16 = MB_ICONERROR
// 48 = MB_ICONEXCLAMATION
// 32 = MB_ICONQUESTION
// 64 = MB_ICONINFORMATION
//
// So, if you want a Yes/No MsgBox with an error icon, Param=4|16
//
// If Yes button pressed : Val=6
// If No button pressed : Val=7


;)
08-21-2006 06:05 PM
Profile PM Web Find Quote Report
Hit
New Member
*


Posts: 10
Joined: Aug 2006
O.P. RE: Alert(MsgBox in VB) Help?
Whoow thx both :D
Fast!
But is it
If( val == 6) Then???

This post was edited on 08-21-2006 at 06:16 PM by Hit.
08-21-2006 06:14 PM
Profile E-Mail PM Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: Alert(MsgBox in VB) Help?
code:
var Val=Interop.Call("User32.dll", "MessageBoxW", 0,"Message","Title", 4|32);

if (Val==6) { // Yes
    // ....
}
else if (Val==7) { // No
    // ....
}

That's your question ? And good answer ?

This post was edited on 08-21-2006 at 06:26 PM by KnRd_WC.
08-21-2006 06:19 PM
Profile PM Web Find Quote Report
Hit
New Member
*


Posts: 10
Joined: Aug 2006
O.P. RE: Alert(MsgBox in VB) Help?
Yes thx it works
One more question you know how to block something sending
So if i type something it wont send if you click no
08-21-2006 06:28 PM
Profile E-Mail PM Find Quote Report
KnRd_WC
Junior Member
**

Avatar
Florian PAQUET

Posts: 74
Reputation: 1
35 / Male / Flag
Joined: Aug 2006
RE: RE: Alert(MsgBox in VB) Help?
quote:
Originally posted by Hit
One more question you know how to block something sending
So if i type something it wont send if you click no


If you want to send a message to a contact ??
Maybe I don't understand (I'm French ;)), but... what is "something" ??

For ALL messages
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
    var Val=Interop.Call("User32.dll", "MessageBoxW", ChatWnd.Handle,"Message","Title", 4|32);
    if (Val==6) { // Yes
        return Message;
    }
    else if (Val==7) { // No
        return "";
    }
}


For a DEFINED message
code:
function OnEvent_ChatWndSendMessage(ChatWnd,Message) {
    if (Message=="MyMessage") {
        var Val=Interop.Call("User32.dll", "MessageBoxW", ChatWnd.Handle,"Message","Title", 4|32);
        if (Val==6) { // Yes
            return Message;
        }
        else if (Val==7) { // No
            return "";
        }
    }
return Message;
}


This post was edited on 08-21-2006 at 06:44 PM by KnRd_WC.
08-21-2006 06:34 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Alert(MsgBox in VB) Help?
You mean, if the user tries to send a message it'll display a box and if the box result is No, it shouldn't send it?
Very easy, just let it return nothing! ;)
code:
} else if(Val == 7) {
   return;
}
If you use that code in the OnEvent_ChatWndSendMessage function (where I guess it is in), it will return nothing. This is because a ChatWndSendMessage event can return a string to the scripts parser telling what message has to be send. ;)

This post was edited on 08-21-2006 at 06:41 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-21-2006 06:38 PM
Profile E-Mail PM Web Find Quote Report
Hit
New Member
*


Posts: 10
Joined: Aug 2006
O.P. RE: Alert(MsgBox in VB) Help?
thx i finaly done my sure to send project
If i do return;
It still sends if i do return ""; message is gone it most stay there

This post was edited on 08-21-2006 at 06:46 PM by Hit.
08-21-2006 06:43 PM
Profile E-Mail PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Alert(MsgBox in VB) Help?
quote:
Originally posted by Hit
thx i finaly done my sure to send project
If i do return;
It still sends if i do return ""; message is gone it most stay there
Hmm, strange. I saw scripts just sending nothing with the return... But if that wouldn't work, I suggested you to use return "" anyway. :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-21-2006 06:57 PM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« 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