您的位置:首页 > 其它

mfc 窗口透明设置

2014-12-03 14:16 246 查看
SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,

GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE) | 0x80000);

HINSTANCE hInst=LoadLibrary("User32.DLL");

if(hInst)

{

typedef BOOL (WINAPI * MYFUNC)(HWND,COLORREF,BYTE,DWORD);

MYFUNC fun=NULL;

fun=(MYFUNC)GetProcAddress(hInst,"SetLayeredWindowAttributes");

if(fun)

fun(this->GetSafeHwnd(),0,255,2);

FreeLibrary(hInst);

}

备注: fun(this->GetSafeHwnd(),0,255,2); 参数2---时255处的数字代表透明度 。

fun(this->GetSafeHwnd(),RGB(128,128,128),128,1); 1代表对RGB内的颜色透明。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: