BOOL CWaitDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// 设置窗体透明
SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,GetWindowLong(GetSafeHwnd(),GWL_EXSTYLE)|0x80000);
typedef BOOL (WINAPI *FSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
FSetLayeredWindowAttributes SetLayeredWindowAttributes ;
HINSTANCE hDll = LoadLibrary(_T("User32.DLL"));
SetLayeredWindowAttributes = (FSetLayeredWindowAttributes)GetProcAddress(hDll,"SetLayeredWindowAttributes");
if (SetLayeredWindowAttributes)
SetLayeredWindowAttributes(GetSafeHwnd(),RGB(0,0,0),128,2);
FreeLibrary(hDll);
if(m_GifPic.Load(MAKEINTRESOURCE(IDR_GIF1),_T("Gif")))
{
m_GifPic.Draw();
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
设置对话框背景透明
最新推荐文章于 2014-05-14 13:27:33 发布