1.添加
OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{//HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
return m_brush1;
2: m_brush1.CreateSolidBrush(RGB(255,255,255));
3. SetWindowPos(&this->wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
ModifyStyleEx(WS_EX_APPWINDOW,WS_EX_TOOLWINDOW,0);//隐藏任务栏
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(),RGB(255,255,255),128,1);
FreeLibrary(hInst);
}
注意:有颜色部分要对应。