对窗口半透明的实现

来源:互联网 发布:java的短息发送 编辑:程序博客网 时间:2024/05/21 13:15
ModifyStyleEx(0,0x00080000);
    HINSTANCE hInst = LoadLibrary(_T("User32.DLL")) ;
if ( hInst )
{
typedef BOOL (WINAPI * MYFUNC)(HWND, COLORREF, BYTE, DWORD) ;
MYFUNC fun = NULL ;


fun = (MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes") ;
if ( fun )
{
fun(this->GetSafeHwnd(), 0,128/*透明度0-255*/, 2) ;
}
FreeLibrary(hInst) ;
}