Posted on 2010-01-21 16:36
S.l.e!ep.¢% 閱讀(770)
評論(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.