Windows 7 aero glass
Click on the Start Button and type in check the windows experience index and hit Enter. Next, click Refresh Now. If you still have problems try running the Aero Troubleshooting utility by clicking on the Start Button and typing in Find an fix problems with transparency and then hit Enter. As a last resort you can try the old Windows Vista registry hack to enable Aero glass on low end systems. Let me know if this helps you in the comments below.
How to Block Specific Driver or Kill Processes from Command Prompt Tweaks. Click on Next button. To display Aero effects such as transparency in Windows 7, follow these steps: Make sure that Windows Experience Index has been calculated and computed.
Click on Start menu. The troubleshooting wizard will try to detect any problem by running a series of checks against various components required to make Aero works and running, such as video memory, Desktop Windows Manager DWM service, color depth, theme, power settings and etc. The final parameter, fTransitionOnMaximized, is a bit misleading. Since the glass effect is turned off on windows that are maximized, you'd think this flag would have something to do with that.
This flag actually controls whether or not the window transitions to the maximized color when there is a maximized window on the desktop. Unfortunately, if you set this parameter to true, when you render the window you'll get a region without the transparency, just the aurora effect.
The dwFlags parameter is how you tell the interface which parameters you are setting; when you want to set a parameter, you'll need to turn on the corresponding bit in the dwFlags parameter. This is consistent throughout the DWM interface. Don't forget that you'll have to render the glass color into the region.
Using the same black brush that was used in DwmExtendFrameIntoClientArea will work fine for creating a glass effect on the specified region. It's easy to see that DWM has provided two interfaces for you-the more complicated one that lets you construct an arbitrarily shaped region, and the simple one that just lets you extend the window frames glass effect into your client area so you can draw additional controls and the like onto something that looks like it's part of the title bar.
In both cases, you have to worry about what happens to the region's shape when the window is resized and update the area to render the glass effect in if it's not the entire client area. The source code that accompanies this article will allow you to set both an extended client frame or a region and to toggle the composition flag as well.
Using glass as a background on your window is a bit tricky. If you render anything naturally opaque such as GDI functions , you'll get your item rendered on glass, though sometimes with unexpected results. One particular gotcha is that rendering a GDI item in black uses the bit pattern 0xwhich also happens to be a completely transparent black if you are using an alpha channel.
This means that if you draw with a black GDI brush or pen you'll get a transparent color, not a black one. The biggest problem this presents is when you try to use the default text color in a control of a text label that sits on the glass area.
Since the default text color is usually black, the DWM will consider this to be transparent and the text will be written in the glass incorrectly. An example can be seen in Figure As you can see, it's nearly illegible because it's actually incorrectly rendered text that shows up as gray, not black. Happily, there are a number of ways around this problem. Using owner-draw controls is one. Rendering to a bitmap that has an alpha channel is another. Fortunately, the easiest way to get text on controls is to let the.
NET Framework 2. This is easily accomplished by setting the UseCompatibleTextRendering property on your controls. By default, this property is set to false so that controls written for previous versions of the.
NET Framework will render the same. But if you set it to true, your text will come out looking correct. You can set the property globally with the Application. You can just edit this to set it to true as shown below and all your controls will look correct when written on a glass window. You should enable the glass effect just before you start rendering your window. The composition engine will look at the alpha values of your window and will apply the blur effect to those regions that are not opaque.
This can be a problem when using some GDI functions because they don't preserve alpha values. Getting the glass effect in DirectX applications is done the same way. All you need to do is to control the alpha value of the render target in addition to using one of the two glass-enabling DWM functions. Wherever you've told the DWM to use glass, it'll use the alpha value of the render target. Anywhere else, the render target should be opaque or you'll get undefined behavior. Thumbnails are live display-only windows on open applications rendered by the DWM.
You can essentially request a thumbnail of an application's window and have it rendered in your application. The thumbnail API will provide you with a live representation of an application's window. Thumbnails are simple to use, as most of the hard work is done for you by Windows.
The hard part is getting hold of an app's HWND. The OS takes care of updating from then on. Whenever the source window is changed, the change is reflected in the target window. To use a thumbnail, you must first register a thumbnail using the DwmRegisterThumbnail function. You provide two window handles, the source HWND that is, the window you want the thumbnail view of and the target HWND the window where you want the thumbnail rendered.
When you are finished using a thumbnail, you have to let the DWM know that the relationship is ending by calling DwmUnregisterThumbnail. After you have created a thumbnail, the DwmRegisterThumbnail function returns a thumbnail handle and all further thumbnail functions will take this handle as an argument.
You'll have to call DwmUpdateThumbnailProperties after you register a thumbnail to get the thumbnail updating. Example code for a form that renders a live thumbnail of another window is shown in Figure In addition to the two functions for registering and unregistering a thumbnail, there are two other functions that work with thumbnails.
DwmQueryThumbnailSourceSize returns the source size of the specified thumbnail. You can also specify the opacity of the thumbnail if you don't want it to be totally opaque by using the opacity member, where 0 is transparent and is opaque.
If you want the thumbnail to be invisible, you can set the fVisible flag to false. If you want to use just a windows' client area for the thumbnail instead of the entire source window which will include the non-client areas such as the frame and title bar , you can set the fSourceClientAreaOnly Boolean to true.
The dwFlags parameter is how you tell the interface which parameter s you are setting. When you set a parameter, you'll need to turn on the corresponding bit in the dwFlags parameter.
Finally, there's no restriction as to the size of the target window-it's perfectly legal to use the thumbnail interface to magnify the source window or to shrink it. There is a restriction about maintaining the aspect ratio. The aspect ratio of the source window is always maintained. If the source window changes size, the thumbnail will change size as well to maintain itself within the boundaries specified.
In the source code that accompanies this article, there's a button that will create a small live thumbnail of the main application window, as seen in Figure The thumbnail rendering is live, which you can easily see. If you change the main application window, you'll see the thumbnail update. You will find that with a little ingenuity, it's pretty easy to create your own task switcher using thumbnails and the FindWindow and GetWindow Win32 functions.
That was a whirlwind tour of the DWM interfaces. I think you'll be able to find some nifty applications for these APIs.
0コメント