Posted on 2010-01-21 16:36
S.l.e!ep.¢% 阅读(760)
评论(0) 编辑 收藏 引用 所属分类:
VC
The
UpdateLayeredWindow function updates the position, size, shape, content, and translucency of a layered window.
UpdateLayeredWindow 更新分层窗体的 尽寸,形状,内容,半透明
语法:
BOOL UpdateLayeredWindow(
HWND hwnd,
HDC hdcDst,
POINT *pptDst,
SIZE *psize,
HDC hdcSrc,
POINT *pptSrc,
COLORREF crKey,
BLENDFUNCTION *pblend,
DWORD dwFlags
);
Parameters- hwnd
- [in] Handle to a layered window. A layered window is created by specifying WS_EX_LAYERED when creating the window with the CreateWindowEx function.
分层窗体的句柄,分层窗体是使用 CrteateWindowEx 创建时指定WS_EX_LAYERED
- hdcDst
- [in]
Handle to a device context (DC) for the screen. This handle is obtained by specifying NULL when calling the function. It is used for palette color matching when the window contents are updated. If hdcDst isNULL, the default palette will be used.
If hdcSrc is NULL, hdcDst must be NULL.
屏幕DC的句柄,这个句柄通过调用函数时指定为空来获取到. 它是用来跟调色板色彩搭配的,当窗体内容被更新时,如果 hdcDest 为 Null, 那么使用默认的调色板.
如果 hdcSrc 为空,那么 hdcDst 必须也为空
- pptDst
- [in] Pointer to a POINT structure that specifies the new screen position of the layered window. If the current position is not changing, pptDst can be NULL.
指向一个 POINT 结构指定分层窗体新的屏幕坐标. 如果当前窗体的位置不改变,那么 pptDst 可以为NULL
psize - [in] Pointer to a SIZE structure that specifies the new size of the layered window. If the size of the window is not changing, psize can be NULL. If hdcSrc is NULL, psize must be NULL.
- hdcSrc
- [in] Handle to a DC for the surface that defines the layered window. This handle can be obtained by calling the CreateCompatibleDC function. If the shape and visual context of the window are not changing, hdcSrc can be NULL.
指向分层窗体外层的DC, 这个句柄可以通过调用 CreateCompatibleDC 获取, 如果图形和窗体的虚拟DC没有改变,那么 hdcSrc 可以为NULL
- pptSrc
- [in] Pointer to a POINT structure that specifies the location of the layer in the device context. If hdcSrc is NULL, pptSrc should be NULL.
- crKey
- [in] COLORREF structure that specifies the color key to be used when composing the layered window. To generate a COLORREF, use the RGB macro.
构建分层窗体时使用的 color key
- pblend
- [in] Pointer to a BLENDFUNCTION structure that specifies the transparency value to be used when composing the layered window.
指向 BLENDFUNCTION 结构, 指明构建窗体时使用的透明值
- dwFlags
- [in] This parameter can be one of the following values.
ULW_ALPHA
- Use pblend as the blend function. If the display mode is 256 colors or less, the effect of this value is the same as the effect of ULW_OPAQUE.
ULW_COLORKEY
- Use crKey as the transparency color.
ULW_OPAQUE
- Draw an opaque layered window.
If hdcSrc is NULL, dwFlags should be zero.