VC:背景透明(SetWindowLong()、GetSafeHwnd()、HINSTANCE 、LoadLibrary()、GetProcAddress()、FreeLibrary())

1、在构造函数中:

       //背景透明

/*    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,222,2);   //128

FreeLibrary(hInst);  

}

*/

原文地址:https://www.cnblogs.com/shenchao/p/2737755.html