Shoutbox

[?] Shadows on PlusWnds - 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: [?] Shadows on PlusWnds (/showthread.php?tid=95194)

[?] Shadows on PlusWnds by roflmao456 on 08-06-2010 at 08:46 PM

Just like the Windows Aero shadows.

Is it possible? :P

Would be really great if it is.


RE: [?] Shadows on PlusWnds by matty on 08-06-2010 at 11:45 PM

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);

RE: [?] Shadows on PlusWnds by roflmao456 on 08-07-2010 at 12:44 AM

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..


RE: [?] Shadows on PlusWnds by matty on 08-07-2010 at 04:19 AM

You asked for Windows Areo...

Not sure about XP I will have a look...


RE: [?] Shadows on PlusWnds by matty on 08-12-2010 at 01:54 PM

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.
RE: [?] Shadows on PlusWnds by whiz on 08-12-2010 at 04:03 PM

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.
RE: [?] Shadows on PlusWnds by Eljay on 08-12-2010 at 05:54 PM

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
RE: [?] Shadows on PlusWnds by roflmao456 on 08-14-2010 at 05:01 AM

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