BYTE byTrans = 128; // 0 - 255
LONG lOldStyle;
const DWORD WS_EX_LAYERED = 0x80000;
const DWORD LWA_ALPHA = 0x2;
typedef BOOL (_stdcall *API_TYPE)(HWND,COLORREF,BYTE,DWORD);
API_TYPE SetLayeredWindowAttributes;
HMODULE hUser32 = ::GetModuleHandle( _T("user32.dll"));
SetLayeredWindowAttributes = (API_TYPE)::GetProcAddress( hUser32, "SetLayeredWindowAttributes");
if( SetLayeredWindowAttributes)
{
lOldStyle = GetWindowLong( m_hWnd, GWL_EXSTYLE);
long lret;
lret = SetWindowLong( m_hWnd, GWL_EXSTYLE, lOldStyle | WS_EX_LAYERED);
int ret;
ret = SetLayeredWindowAttributes( m_hWnd, 0, byTrans, LWA_ALPHA);
}
// 요걸로 하면 되긴 되는데...
// 다이얼로그의 스타일이 child 일때는 무조건 실패당..안댄다는얘기..ㅡㅡ
// 팝업스타일일때만 가능
LONG lOldStyle;
const DWORD WS_EX_LAYERED = 0x80000;
const DWORD LWA_ALPHA = 0x2;
typedef BOOL (_stdcall *API_TYPE)(HWND,COLORREF,BYTE,DWORD);
API_TYPE SetLayeredWindowAttributes;
HMODULE hUser32 = ::GetModuleHandle( _T("user32.dll"));
SetLayeredWindowAttributes = (API_TYPE)::GetProcAddress( hUser32, "SetLayeredWindowAttributes");
if( SetLayeredWindowAttributes)
{
lOldStyle = GetWindowLong( m_hWnd, GWL_EXSTYLE);
long lret;
lret = SetWindowLong( m_hWnd, GWL_EXSTYLE, lOldStyle | WS_EX_LAYERED);
int ret;
ret = SetLayeredWindowAttributes( m_hWnd, 0, byTrans, LWA_ALPHA);
}
// 요걸로 하면 되긴 되는데...
// 다이얼로그의 스타일이 child 일때는 무조건 실패당..안댄다는얘기..ㅡㅡ
// 팝업스타일일때만 가능