Duplicate:
Is it possible to achieve the “Aero Glass” look on XP?
If I use Winforms and I write a win32 application with it, I can see the Aero glass effects in Vista but not in XP.
How could I achieve the same look across different platforms? I am using WPF.
As a side question, did Microsoft write the Aero glass effects using WPF? If so, shouldn't the glass effect be the default WPF look on the other platforms?
What "Aero effect" are you referring to? If you're talking about the window glass, then I'm afraid you're out of luck, as the glass effect is made possible only through Vista's Desktop Window Manager.
If you're simply looking for window transparency, rounded corners, etc., then this is certainly possible in XP. Check out this article for more information.
Ok, so most of the DWM stuff is handled by a DLL called dwmapi.dll, it is all in C++ COM because that is how Microsoft writes it's APIs, you may have noticed that to call the methods in the API you have to use some unmarshalled boolean types etc, this is because it has to reach unmanaged code, some of the operations that need to take place are too dangerous for .NET to watch over without interfering, you may also notice that all the return types aren't actually returns you put in Vars as "out" types so the code can modify them in memory and then that information can be read back into your managed .NET code. As far as a way to get similar effects in Windows XP, the only way I can think of is using Windows Blinds and then making a translucent WPF form with a gradient background (with a glass like effect) it would be quite easy to do, but the window will look out of place in Vista and XP and I don't think that it is such a good idea.
Hope this helps :P
Simon
Related
How do you put a Windows Form Application on top off everything on your screen?
Just setting the topmost-property isn't enough when you're running fullscreen games.
If anyone has a solution for good old Forms i'll also be happy
I've seen many posts on this forum that say it's impossible but i know it's not couse i've seen alot of apps (fraps, teamspeak overlay, xfire, etc) that does this.
If you want to use a graphics library to display something always on screen, you may want to start here on SO. There are wrapper libraries available like OpenTK for OpenGL. If you want to go the DirectX route you'll need to load in the C++ libraries and access them using P/Invoke. There's a good tutorial to start with on msdn. Wrappers for DirectX also exist in the form of SharpDX.
I'm wondering about that many new applications, I think most built in WPF, has this really cool Windows Aero Glass interfaces.
For example Seesmic or the upcoming Firefox 3.7
(source: crenk.com)
Searching in the internet most time it looks like you need a hack to realize this. But seriously: I don't think big software development teams use hacks to roll out their huge used products.
So my question is: Windows Aero Glass Areas - How to do?
Is it only possible with a hack?
Maybe it's just one property, i don't know. I'm WinForms developer so I never tested out WPF. But my Google search didn't look like It is easier with WPF.
To have Aero glass, you need to use the Desktop Window Manager. It is a Win32 DLL, so you need to P/Invoke it. Articles on how to do this are all over the Internet, ex. Link Using P/Invoke is definitely not a hack.
how to make somthing like this
Windows Forms Glass Effect, Make ImageBox transparent
I use VS 2010
If all you are looking for is the standard glass effect (which includes the blur), check out this article:
http://www.codeproject.com/KB/vista/AeroGlassForms.aspx
Basically, all you're doing is extending the window's frame (which already has the glass effect) into the client area. You have to call the DWM API that come with Windows Vista or later using a couple of P/invoke methods because this is not built into the .NET Framework.
EDIT: If you're looking for more control over the blur effect, you might look into more specifically the DwmEnableBlurBehindWindow function from the DWM API, although I have not used this myself.
Take a look at this:
http://msdn.microsoft.com/en-us/library/aa969512(VS.85).aspx
The MARGINS array is similar to margins on an HTML page. The first example on MSDN gives the margins for the glass effect 25 pixels in height on the bottom of the window.
This MS tutorial is fairly easy to understand and uses C#.
Windows API
So i know that the WinForms touches on the Windows API a little, but frankly its horrible. ESPECIALLY with the layered windows and flickering. So i was wondering if anyone has wrote partial, or full wrappers for the Windows API.Im particularly interested in the Layered Window aspect, but really any part of the API is a good place to start.
Update: I found the Windows API Code Pack here: http://code.msdn.microsoft.com/WindowsAPICodePack but it seems that it doesnt wrap Layered Windows? Am i correct in assuming this?
Native API (Windows)
Ive heard a little bit about the Native API, but im not quite sure what it is for? what features does it provide? would it be a good idea to look into?
Summary (Questions in a nutshell)
Does anyone know of an existing (partial or full) wrapper of the Windows API?
If the answer is no to question one, where would be a good resource to learn about it myself, and potentially write my own?
An explanation of the Native API? What does it do? Can I use it to make applications better? Can I even USE it at all?
An answer to any of those is highly appreciated :) thanks
You could start at PInvoke.NET.
The LayeredWindows actually work better in WinForms than windows.
The native windows controls don't even have the alpha channel support of the WinForms analogues, so native windows flicker, and require massive amounts of subclassing to override the painting to use alpha compatible routines.
You would be better off going to WPF. The windows team has not treated the native control's well at all, going so far as to remove support for a style (WS_EX_COMPOSITED) if aero glass is enabled which, given the way that windows controls paint, effectivly made it impossible for any application to paint flicker free if it uses child window's as controls.
WPF "draws" windows controls, but does not use discrete (native) child windows to represent individual controls. This gives it control over when and how its window surface is rendered.
The Windows API is huge. There is a ton of stuff in it. Windows Forms is a wrapper of parts of it. WPF is a wrapper of parts of it. Parts of the Base Class Libraries (eg System.IO.*) are wrappers of parts of it. The Code Pack is a wrapper specifically of things that were new in Vista and Windows 7 and not in Windows Forms or WPF.
Have you looked into WPF? Combined with P/Invoke of specific API functions, it might take you a long way towards where you want to be.
Can I use that effect on my controls just like the BlurEffect? If it's not available, is there a way to "acquire" it? Perhaps via the Reflector?
Which "Aero" effect are you referring to?
You can extend the glass effects into your client area in a WPF application via DwmExtendFrameIntoClientArea.
If you're just after the blurring, you could use BlurBitmapEffect from WPF directly.
No, it is not included.
Yet, there is a Glass Effect in plain WPF that works fine on XP too. It is not the exact duplicate of Aero Glass, but looks nice.