SetWindowLong(m_hWnd,GWL_EXSTYLE,GetWindowLong(m_hWnd,GWL_EXSTYLE)^WS_EX_LAYERED);
HINSTANCE hInst = GetModuleHandle(_T("User32.DLL"));
if(hInst)
{
typedef BOOL (WINAPI *TestFun)(HWND,COLORREF,BYTE,DWORD);
//取得SetLayeredWindowAttributes函数指针
TestFun mytest = (TestFun)GetProcAddress(hInst, "SetLayeredWindowAttributes");
if(mytest)
mytest(m_hWnd,0,200,LWA_ALPHA);
}
![](https://img2024.cnblogs.com/blog/35695/202403/35695-20240328092537879-1189167464.jpg)