如何让VC的窗体变为透明

//=======================================
 SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,
  GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000);
 HINSTANCE hInst = LoadLibrary("User32.DLL"); //显式加载DLL
 if(hInst)
 {           
  typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD);         
  MYFUNC fun = NULL;    
  fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");//取得SetLayeredWindowAttributes函数指针
  if(fun)fun(this->GetSafeHwnd(),0,100,2);    
  FreeLibrary(hInst);
 }
 //========================================= 

你可能感兴趣的:(VC)