// 상수 정의
#ifndef WS_EX_LAYERED
#define WS_EX_LAYERED                0x00080000
#define LWA_COLORKEY                 0x00000001
#define LWA_ALPHA                    0x00000002
#endif

// USER32.DLL 에서 import할 함수형
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);

// 멤버변수로 보관
lpfnSetLayeredWindowAttributes m_pSetLayeredWindowAttributes;

// 이제부터 코드 추가 부분...
// USER32.DLL로부터 함수를 import한다.
HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
m_pSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32, "SetLayeredWindowAttributes");

// import가 제대로 됐는지 체크한다.
if (NULL == m_pSetLayeredWindowAttributes)
    return FALSE;

// 다이얼로그의 현재 상태를 체크하고 WS_EX_LAYERED 속성을 추가한다.
SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);

// 윈도우를 70% 가시화
m_pSetLayeredWindowAttributes(m_hWnd, 0, (255 / 70) * 100, LWA_ALPHA);