展开全部
//在OnInitDialog里进行初始化,添加如下代码
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;
//取得SetLayeredWindowAttributes函数指针
fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
if(fun)
fun(this->GetSafeHwnd(),0,128,2);
FreeLibrary(hInst);
}
经典(引用他人的)
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;
//取得SetLayeredWindowAttributes函数指针
fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
if(fun)
fun(this->GetSafeHwnd(),0,128,2);
FreeLibrary(hInst);
}
经典(引用他人的)
展开全部
为对话框设置背景颜色、控件颜色
既然mfc对话框不好开发,
既然mfc对话框不好开发,
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
HBRUSH CUiuiDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
pDC->SetBkMode(TRANSPARENT);
// TODO: Return a different brush if the default is not desired
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
pDC->SetBkMode(TRANSPARENT);
// TODO: Return a different brush if the default is not desired
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询