Try this: typedef BOOL (__stdcall *PFUNCSETLAYEREDWINDOWATTR)(HWND, COLORREF, BYTE, DWORD); PFUNCSETLAYEREDWINDOWATTR m_pfSetLayeredWindowAttributes; HMODULE hUser32 = GetModuleHandle(_T("User32.dll")); if (hUser32) { m_pfSetLayeredWindowAttributes = (PFUNCSETLAYEREDWINDOWATTR)::GetProcAddress(hUser32, "SetLayeredWindowAttributes"); if (m_pfSetLayeredWindowAttributes) { ::SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE)^WS_EX_LAYERED); // After the SetWindowLong call, the layered window will not become visible // until the SetLayeredWindowAttributes function has been called for this window m_pfSetLayeredWindowAttributes(m_hWnd, 0, (BYTE)255, LWA_ALPHA); } } and then somewhere // Sets the transparency of the window void MakeTransparent(int nAlpha) { if (m_pfSetLayeredWindowAttributes) m_pfSetLayeredWindowAttributes(m_hWnd, 0, (BYTE)nAlpha, LWA_ALPHA); }