Shoutbox

Change Mainwindow color? - 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: Change Mainwindow color? (/showthread.php?tid=74426)

Change Mainwindow color? by Intosia on 05-16-2007 at 11:02 AM

Is it possible to change the Main Windows and/or Chat Window colors with a plugin? Through Send Messages? I tried the reg key 'Lastcolor' (or something) but that didnt do anyhting... :(


RE: Change Mainwindow color? by Matti on 05-16-2007 at 01:47 PM

Yes, it is possible! :D I just figured it out! :)

code:
//Change color of a ChatWnd.
Interop.Call("user32", "SendMessageW", ChatWnd.Handle, 0x0111 /* WM_COMMAND */, 35117, 0);
//Change color of the contact list (thus also the default color in new conversations). Make sure the contact list is open for this to work.
Interop.Call("user32", "SendMessageW", Messenger.ContactListWndHandle, 0x0111 /* WM_COMMAND */, 35117, 0);
//Reset the color in a ChatWnd to the default (contact list) color.
Interop.Call("user32", "SendMessageW", ChatWnd.Handle, 0x0111 /* WM_COMMAND */, 35119, 0);
//Reset the color of the contact list to the default Messenger color (#feffff). Or in other words: set the color to the first color swatch.
Interop.Call("user32", "SendMessageW", Messenger.ContactListWndHandle, 0x0111 /* WM_COMMAND */, 35100, 0);
//Reset the color of a ChatWnd to the default Messenger color.
Interop.Call("user32", "SendMessageW", ChatWnd.Handle, 0x0111 /* WM_COMMAND */, 35100, 0);
A note on the last 2 commands: you can choose from any swatch available on the panel. There are 12 swatches and to get the command, you'll need to add 35100 to the index, e.g. the 2nd color has index 1 (counting starts at 0) so the command would be 35101... or just look it up in ResHack > msgsres.dll > 4004 > 945 beginning at line 131.
RE: Change Mainwindow color? by Matti on 05-16-2007 at 03:16 PM

quote:
Originally posted by Intosia
Owww sweet dude :) May i ask how u figured this out?? I tried API-Monitor, and other tools but got nowhere :S :P
I opened ResHack, opened "C:\Program Files\MSN Messenger\msgslang.dll" and looked for the message displayed with the button (eg: "Kleur wijzigen" since I'm on a Dutch version). Then, I looked at the number of the string and searched for it with ResHack in "C:\Program Files\MSN Messenger\msgsres.dll". Then, I ended up in a UIFILE of the color pick popup and looked at the cmdid. That number is the command you have to send to the window with SendMessageW. Another example of what you can do with these commands is explained in Eljay's reply to [Request] Webcam Command.
RE: Change Mainwindow color? by Intosia on 05-16-2007 at 04:07 PM

NL ;) Nice find :)

But one problem... When i use the second code  (contactlist), it shows me the colordialog...?

Ow and you're talking about the indexes of the colors. I understand that, but what i want to use a custom color?... 8-)


RE: Change Mainwindow color? by Intosia on 05-24-2007 at 01:50 PM

So no custom color is possible? Argg 2bad... have a nice idea for a script but this drops a bomb on it :D


RE: Change Mainwindow color? by Matti on 05-24-2007 at 03:22 PM

Well, as far as I know there's no way to actually set the color by using a SendMessage call. These messages are all just provided by the Messenger client core itself. If they'd need a command which could change the color without the use of a color window, they could add it. But I doubt they would, or even better: I doubt they'd ever need such command.

I am sure there's another, more difficult way to do this but I don't really know how this should be done.

Note: it seems like SendMessage can return a value depending on the message sent. Maybe try to look if it's something useful? If it returns something to control the color window, you could easily set the color you want... I'm just too bored to have a look at it myself at the moment. :P


RE: Change Mainwindow color? by Intosia on 05-24-2007 at 04:22 PM

Well I guess you're right... Dont think its possible with SendMessage. I had a look at the function in msncore.dll And there are alot contain 'color' and stuff, but thats all to difficult for me :D Thx anyway :)