What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [?] Shadows on PlusWnds

[?] Shadows on PlusWnds
Author: Message:
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. [?] Shadows on PlusWnds
Just like the Windows Aero shadows.

Is it possible? :P

Would be really great if it is.
[quote]
Ultimatess6
: What a noob mod
08-06-2010 08:46 PM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Shadows on PlusWnds
js code:
    var Attribute = Interop.Allocate(4);
    Attribute.WriteDWORD(0, 2);
   
    Interop.Call('dwmapi.dll', 'DwmSetWindowAttribute', pPlusWnd.Handle, 2, Attribute, 4);
    var _MARGINS = Interop.Allocate(8);
    _MARGINS.WriteWORD(0, -1);
    _MARGINS.WriteWORD(2, -1);
    _MARGINS.WriteWORD(4, -1);
    _MARGINS.WriteWORD(6, -1);
    Interop.Call('dwmapi.dll', 'DwmExtendFrameIntoClientArea', pPlusWnd.Handle, _MARGINS);

This post was edited on 08-06-2010 at 11:47 PM by matty.
08-06-2010 11:45 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. RE: [?] Shadows on PlusWnds
Thanks matty. :)

I notice "Dwm" which would most likely only make that code work for Vista and 7.

Is it also possible for Windows XP? Maybe making a shadow similar to the one in my signature status..
[quote]
Ultimatess6
: What a noob mod
08-07-2010 12:44 AM
Profile PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Shadows on PlusWnds
You asked for Windows Areo...

Not sure about XP I will have a look...
08-07-2010 04:19 AM
Profile E-Mail PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [?] Shadows on PlusWnds
js code:
var nMsg = Interop.Call('user32', 'GetWindowLongW', pPlusWnd.Handle, (-16) /* GWL_EXSTYLE */);
nMsg = nMsg | 0x20000 /* CS_DROPSHADOW */;
Interop.Call('user32', 'SetWindowLongW', pPlusWnd.Handle, (-16) /* GWL_EXSTYLE */, nMsg);

Not sure how well this would work but please try it out.

This post was edited on 08-12-2010 at 01:56 PM by matty.
08-12-2010 01:54 PM
Profile E-Mail PM Find Quote Report
whiz
Senior Member
****


Posts: 568
Reputation: 8
– / – / Flag
Joined: Nov 2008
RE: [?] Shadows on PlusWnds
quote:
Originally posted by matty
js code:
var nMsg = Interop.Call('user32', 'GetWindowLongW', pPlusWnd.Handle, (-16) /* GWL_EXSTYLE */);
nMsg = nMsg | 0x20000 /* CS_DROPSHADOW */;
Interop.Call('user32', 'SetWindowLongW', pPlusWnd.Handle, (-16) /* GWL_EXSTYLE */, nMsg);

Not sure how well this would work but please try it out.
Just tried it on XP, but doesn't appear to do anything.
08-12-2010 04:03 PM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: [?] Shadows on PlusWnds
CS_DROPSHADOW is a class style (hence "CS_") and can be applied using SetClassLong. However, it will affect all Plus! windows as they share the same class.

Also, it only affects windows created after it is called, even though it requires a window handle. So to affect only one window you need to do something very illogical like:
  • Create an invisible window
  • Use SetClassLong on invisible window to enable shadows for the Plus! class
  • Close invisible window
  • Create your window (which will now have a shadow)
  • Put the original class back so other windows aren't affected

I would code it up, but I would feel dirty doing so :P
08-12-2010 05:54 PM
Profile PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
O.P. RE: [?] Shadows on PlusWnds
quote:
Originally posted by whiz
quote:
Originally posted by matty
[code=js][/code]

Not sure how well this would work but please try it out.
Just tried it on XP, but doesn't appear to do anything.
Same here. :P

quote:
Originally posted by Eljay
[...]
Sounds like a really crappy and possibly cpu intensive method..
I guess the window creating process will be a bit more slower :P
[quote]
Ultimatess6
: What a noob mod
08-14-2010 05:01 AM
Profile PM Web Find Quote Report
« 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