VC实现半透明对话框的代码

VC实现半透明对话框的代码

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); 

}

......

}

你可能感兴趣的:(user,null,byte,fun,winapi)