quote:
Originally posted by J-Thread
So you want to know when a plugin (or other program) calls the MessengerPlus_DisplayToast?
That will not be easy to do, especially not with C# or VB.NET. I'm quite sure it IS possible, but I don't exactly know how.
You will have to intercept the so called "Window Messages", then you'll have to find out if it was registered as "MessengerPlus_DisplayToast" and then you'll have to get the inputs back by translating the int's back to a string.
The function to do this is usually called "WndProc", you might try searching for that. Take a look at the "SetWindowsHook" function also.
It's actually really easy to catch MessengerPlus_DisplayToast. Just use SetWindowsHookEx, GetCurrentThreadId, and CallWndProc and/or GetMsgProc.
code:
int nMsg = RegisterWindowMessage("MessengerPlus_DisplayToast");
is a key line: use a line like this in your own plugin, and save the value of nMsg to use in your CallWndProc/GetMsgProc.
If you like, I can post sample C++. The C# will be very similar.