1. 程式人生 > >MFC 對話方塊半透明的實現

MFC 對話方塊半透明的實現

// 半透明的實現
//int CDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
//{
// if (CDialog::OnCreate(lpCreateStruct) == -1)
//  return -1;
// ////===============================================================
// /*SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^1000000);
// HINSTANCE hInst= LoadLibraryA("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(),0,158,2);
//  FreeLibrary(hInst);
// }*/
// //===============================================================
// return 0;
//}