Windows API to make Windows Vista and 7 semi-transparent screenshots - winapi

Windows Vista and Windows 7 display semi-transparent forms when Aero is activated. And some screen-taking applications such as WinSnap or Windows Clippings are able to capture those windows as a semi-transparent PNG image. What Windows API are they using to obtain such a beautiful capture ?

There isn't any, to my knowledge. If you look closely, at least WindowClippings takes two separate screenshots. One with white background and one with black background. It then uses those two screenshots to calculate the transparency of the glass pixels.

Related

XP Popup Menu Icons not Transparent when highlighted

I know XP is old, but I just have to know the issue here.
I don't see a way to provide a popup menu with anything like an icon or bitmap with a mask, only a bitmap. So, if I use a compatible bitmap, it will look transparent when the selection bar is not highlighting it, but when highlighted the entire graphic still shows (with a square button face color around it).
If I use a 32bit DIB with alpha, the transparent item just shows black (whereas Windows 10 handles the transparency fine - I presume Vista and Win7 would, too).
If I manually set all the A's to 0 in the DIB, it is still black (on Win10, the images where color would normally be appear white - I would have thought it would be transparent).
Anyway, was there ever a way to provide an icon (since it has a mask), or a bitmap with mask, to a menu so things like XP can handle it automatically (no owner draw)?
Is there a way to force loading of an .ICO file to be the 256 color version instead of the 32bit RGB/A version? I don't have a 24bit RGB graphic in the .ICO, so maybe XP would pick that if it existed instead?
I know GDI doesn't support alpha in all cases, but sometimes it does, and it appears the Windows version matters as well.
Does someone have a background on this, and can tell if this is a known XP issue with 32bit bitmaps?
On XP you must custom draw but not the entire thing, just the bitmap/icon.
On Windows 95/NT4 the only way to do this properly is to custom draw the entire menu item. Before Vista the menu look only changed once, the addition of flat menus in XP, so custom draw everything is certainly possible.
Some time around Windows 98/2000 the ability to set MENUITEMINFO.hbmpItem to HBMMENU_CALLBACK was added. Use DrawIconEx or a image list.
Vista added support for 32bit ARGB bitmaps. You should not use the callback method here because that will disable the new visual style.
See also:
Themed menu’s icons, a complete Vista and XP solution
MSJ cool custom draw

What are the parallel (equivalent) tiles of FlipTile, IconicTyle, CycleTile from WP8 in Windows 8?

What are the parallel (equivalent) tiles of FlipTile, IconicTyle, CycleTile from WP8 in Windows 8?
There are a lot in Windows 8 and they seem static.
Thanks!!!
There are no direct parallels with the Windows 8 and Windows Phone 8 tile templates.
While Windows Phone uses a "flip" to show multiple pieces of information on a single tile, Windows 8 uses a "peep" or slide animation to move between multiple tile faces. You should use whichever of the peek templates is most appropriate to the data you wish to display on the tile.
There is no direct equivalent of the WP8 IconicTileTemplate.
The nearest similar templates are TileSquareBlock or TileWideBlockAndText0X as these allow a large number to be displayed, but no icon.
The nearest thing Windows8 has to the CycleTileTemplate is TileWideImageCollection as that is the Win8 way of showing multiple images.
For Ref: List of Win8 Tile templates

Why is my application's window border grey in Windows 8, rather than being based off the desktop like other windows?

I have a large legacy application which is showing up with a perpetually grey border on every Windows 8 machine we run it on, while the other windows for other apps accurately use a color derived from the desktop background. For the life of me I can't find out why.
I've tried my best google-fu to crawl MSDN for APIs to control this but came up empty. The app looks like all others in Windows XP, Vista, and 7...just Windows 8 is grey in color. We definitely haven't added Win8 specific code to treat this otherwise.
It's just an MFC window on the outside, but inside it embeds a .NET/WPF component and a Direct3D 9-enabled visual area.
My best guess is it could somehow be related to having a Direct3D surface in the window, but I couldn't validate that anywhere.
Any help would be greatly appreciated!
Thanks
Edit: The grey matches the effect of not having focus, and we definitely do play games with window focus...so that could be it.
The problem was a developer overloaded OnNcActivate() and returned TRUE at the end. They needed to call up to the baseclass's (CWnd) OnNcActivate instead.
This was visible on Windows 7 as well if you looked close enough.
The Desktop in Windows 8 does not use transparency in window borders like Windows 7 and Vista did with the Aero Themes. If you are move the focus to another top window in your app, this could explain why your seeing the grey border. Try changing the colors for windows without the focus to something discernable from grey to verify that is what you are seeing.

Application Icon transparency issue (Windows Phone 7)

I'm writing a Windows Phone 7 app and have a icon (both tile icon and app icon). The icon has my little logo in the middle surrounded by a transparent background. But when I see the icons on the phone emulator the background is black. It stays black regardless of what theme is chosen (light or dark).
I would expect that the transparent background would've been filled in with the users chosen Accent Color like all the other icons on the phone (ie, settings etc) but this is not the case.
Do I have to do anything special to have a transparent background? Thanks!
My understanding is it was supposed to have been changed to work the way you expect, but for the moment it's only working for 1st party apps. My understanding is this is a bug. A timeframe hasn't been offered for resolution to my knowledge.

Windows Vista Desaturated: Grayscale UI

Occasionally working in Windows Vista the O.S. will desaturate the screen, rendering all colors as grayscale. Is there a way to do this programatically? Failing that, is there a way to do it by tweaking Vista settings?
Thanks.
Umm, if I had to guess, I'd say that Vista (and XP, by the way) are simply applying some sort of overlay to the whole screen. I'm guessing it's done by rendering an opaque rectangle with a blend mode of some sort. This is only my guess, though.
Dmitri's suspicion is correct. Windows essentially takes a screenshot and fades it, while displaying a popup in front of it. You can do the same if you need to.
You can test this by running a video or something that is animated, then selecting Shut Down to display that popup and dimmed background -- note that the video has stopped, and when you cancel the "shutdown" and return to your apps, you'll see that the video has continued in the background.
edit: I'm not aware of an existing function to do this, but nothing stops you from creating your own.

Resources