VC透明窗口实现

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

你可能感兴趣的:(VC)