Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Docked Window Styles Collapse All
Subject Author Date
David Wiseman Sep 10, 2009 - 6:41 PM

G’day support:


Is it possible to control the style of a docked window as it docks, so that it doesn’t assume the style of the frame?


As an example, in the SDIDOCVIEW Sample, I have set the Main Frame window style as WS_EX_LAYERED to get a semi-tranparent window, but would like the toolbars to remain opaque when they dock with the frame. (When undocked, they are opaque, but as they dock, they seem to take the style of the Frame.)


Many thanks,


Dave


 

Technical Support Sep 11, 2009 - 7:22 AM

There are two types of layered windows though both are just windows with the WS_EX_LAYERED extended window style:

1) Simple layered windows with equal transparency for each pixel. These windows are initialized with the SetLayeredWindowAttributes() API. They are exactly like classic opaque windows, but they support transparency for all the window pixels and all the pixels can use only equal transparency. They may contain child windows.

2) Per-pixel transparent layered windows. These layered windows are very specific. They initialized with the UpdateLayeredWindow() API which assigns bitmap with per-pixel alpha channel to the layered window. The size of the layered window and bitmap size must be equal. As result, the bitmap is displayed on the screen with per-pixel transparency. The per-pixel transparent layered windows should not contain children windows and they does not use the WM_PAINT message. You should use the UpdateLayeredWindow() API to assign new per-pixel transparent bitmap. Nevertheless per-pixel transparent layered windows are also based on the HWND window handle, they cannot be compared with classic opaque window or simple layered windows.

Both types of layered windows should be used for displaying some small information on the screen. You should not make some big main frame window layered if it contains a lot of toolbar and resizable control bars. The simple layered windows does not allow your toolbars be opaque when entire main frame window is transparent. The per-pixel transparent layered windows are incompatible with MFC frames with children toolbars.