Shoutbox

send message - 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: send message (/showthread.php?tid=81324)

send message by magemello on 01-30-2008 at 04:59 PM

hi.....i want send a message in a specific windows how can i do?

i have this windows

function OngiocoEvent_CtrlClicked(gioco, ControlId) {
  switch(ControlId) {
      case "gioca" :
     
      if((turno == squadra) && (cartapescata == 0))
      {
      cartapescata=1;
      CreaDomanda(gioco);
      }
      break; 
  }
}

when this windows is closed i use this function:

function OngiocoEvent_Destroyed(gioco, ExitCode) {
if(ExitCode ==2) {
   scrittura2.SendMessage("windows is closed");
   
   }
}

How i can send a message (windows is closed) in a windows where i have create  windows gioco?


RE: send message by roflmao456 on 01-30-2008 at 09:00 PM

if you're talking about the "SendMessage" Windows API,

code:
Interop.Call("user32","SendMessageW", hwnd, msg, wparam, lparam);
i don't use SendMessage much so this code might be wrong :tongue:

otherwise, if you're talking about sending a message to a conversation window, you can look it up in the scripting documentation for "ChatWnd::SendMessage"


edit:

after looking at your code, it looks like you want to display a message box.

you can use this :)
code:
Interop.Call("user32","MessageBoxW",0,"title or message","title or message 2",64);

/*
32 = Error
64 = Information
all i can think of atm.
*/


RE: send message by magemello on 01-31-2008 at 11:54 AM

No good ... i write another example


code:
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage)


   if(sMessage=="take")
   {
   idpartita=ChatWnd.Handle;
   return "";
   }
   
   if(sMessage=="send")
   {
    ChatWnd.SendMessage("hello");

   return "";
   }
}

i write in a first windows "take" ,and in another windows i write "send",but i want when  write "send"  ,"hello" message  is write in first windows where i take handle
RE: send message by roflmao456 on 01-31-2008 at 01:15 PM

ah, this should work
the code wasn't using a global variable.

code:
var idpartita;
function OnEvent_ChatWndSendMessage(ChatWnd, sMessage){
if(sMessage == "take"){
idpartita = ChatWnd;
return "";
}
if(sMessage == "send"){
idpartita.SendMessage("hello");
return "";
}
}

RE: send message by magemello on 01-31-2008 at 02:53 PM

very nice!!! I admire you :) thanks