上传者: yinjie888
|
上传时间: 2022-03-11 16:13:38
|
文件大小: 1.8MB
|
文件类型: -
建立一个透明窗口,
brush = new CBrush(RGB(0,151,250));
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,WORD);
MYFUNC fun=NULL;
fun=(MYFUNC)GetProcAddress(hInst,"SetLayeredWindowAttributes");
if(fun)fun(this->GetSafeHwnd(),0,128,2);//128是透明度
if(fun)fun(this->GetSafeHwnd(),RGB(0,151,250),0,1);//去除指定颜色
FreeLibrary(hInst);
}