Shoutbox

get the handle of a toast? - 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: get the handle of a toast? (/showthread.php?tid=64670)

get the handle of a toast? by AberNStein on 08-08-2006 at 06:47 PM

is it possible to get the handle of a toast so that i can kill it from a script?


RE: get the handle of a toast? by Shondoit on 08-08-2006 at 08:26 PM

Why do you want to kill it?
MP!L has a lot of options for toast, you could turn toasts off for some events...


RE: get the handle of a toast? by deAd on 08-08-2006 at 10:19 PM

Use FindWindow (look it up on MSDN). Set class name to 0 and the title to whatever text is inside the toast. Or, you can just turn off toasts in the registry because by killing it there will be a flash ;)


RE: get the handle of a toast? by Stigmata on 08-08-2006 at 10:25 PM

the way i used to do it in a old old old program

subclass messenger (tutorial in vb: http://forum.mess.be/index.php?showtopic=52&view=findpost&p=131134)

if i get a popup with the class name of the toast just used send message WM_Close... :)

and hey presto :)


RE: RE: get the handle of a toast? by AberNStein on 08-09-2006 at 04:34 AM

quote:
Originally posted by Shondoit
Why do you want to kill it?
MP!L has a lot of options for toast, you could turn toasts off for some events...

in my script clicking the toast focuses the conversation window. i want to make it so that if the user focuses the conversation window themself the toast kills itself. also, multiple toasts might be made for the same conversation window. i want to make it so that clicking one of them kills them all.

quote:
Originally posted by Stigmata
the way i used to do it in a old old old program

subclass messenger (tutorial in vb: http://forum.mess.be/index.php?showtopic=52&view=findpost&p=131134)

if i get a popup with the class name of the toast just used send message WM_Close... :)

and hey presto :)

thanks
i haven't coded in vb for at least seven years. is it possible to register the dll then call everything from jscript?
RE: get the handle of a toast? by Shondoit on 08-09-2006 at 10:33 AM

You can use Interop.Call() for that
I will post a snippet later on


-EDIT- I did some testing, and it won't work, first of all, a toast does not have a caption, second, a toast uses 'DirectUIHWND' as a classname, this is the same as a conversation window...
If you want to find a toast, you don't have any way of telling a convo and a toast appart.
(MP!L uses '#32770 (Dialog)' as a Classname)


RE: get the handle of a toast? by RaceProUK on 08-09-2006 at 02:46 PM

quote:
Originally posted by Shondoit
MP!L uses '#32770 (Dialog)' as a Classname
And that immediately removes that avenue, since just about every single program written for Windows uses a window of the Dialog class. So using FindWindow() with the class '#32770' could retrieve a Word Format Paragraph dialog for example.

Don't worry Shondoit: I'm just adding, not correcting ;)
RE: get the handle of a toast? by AberNStein on 08-09-2006 at 08:46 PM

it seems i'm once again at the "code your own toasts" stage
gah