建立一个透明窗口,
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);
}
1