设置窗口或者控件的透明度
例子参考:
LRESULT
CALLBACK
DialogProc(
HWND
hWnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
hwndPro =
hWnd
;
static
HBRUSH
OrgBrush, hBrush;
WCHAR
msg[] =
L" "
;
PAINTSTRUCT
ps;
HANDLE
hfStart;
switch
(
message
)
{
case
WM_COMMAND
:
{
if
(
LOWORD
(
wParam
) ==
IDC_UP1
)
//按钮1
{
HANDLE
HTJtoK = CreateThread(
NULL
, 0, ThreadFunJtoK,
NULL
, 0, 0);
}
else
if
(
LOWORD
(
wParam
) ==
IDC_UP2
)
//按钮2
{
HANDLE
HTKtoJ = CreateThread(
NULL
, 0, ThreadFunKtoJ,
NULL
, 0, 0);
}
}
break
;
case
WM_INITDIALOG
:
{
SetWindowLong
(
hWnd
,
GWL_EXSTYLE
,
GetWindowLong
(
hWnd
,
GWL_EXSTYLE
) |
WS_EX_LAYERED
);
// 设置透明度 0 - completely transparent 255 - opaque
SetLayeredWindowAttributes(
hWnd
, 0,70,
LWA_ALPHA
); //透明度70