让你的窗口透明起来
#define WS_EX_LAYERED 0x00080000
#define LWA_COLORKEY 0x00000001
#define LWA_ALPHA 0x00000002
typedef BOOL (*_SetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
_SetLayeredWindowAttributes SetLayeredWindowAttributes;
void SetLayered(HWND hWnd,int Pos)
{
SetLayeredWindowAttributes = (_SetLayeredWindowAttributes)GetProcAddress(GetModuleHandle("user32.dll"),"SetLayeredWindowAttributes");
if ( SetLayeredWindowAttributes == NULL )
return ;
else{
__try{
SetWindowLong(hWnd,GWL_EXSTYLE,GetWindowLong(hWnd,GWL_EXSTYLE)WS_EX_LAYERED);
SetLayeredWindowAttributes(hWnd,RGB(0,0,0),Pos,LWA_ALPHA);
}
__except(EXCEPTION_EXECUTE_HANDLER){
AfxMessageBox("SYSTEM FALSE");
}
}
}
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论