在OnInitDialog()中加入如下代码
SetWindowLong(this->GetSafeHwnd(), GWL_EXSTYLE, GetWindowLong(this->GetSafeHwnd(), GWL_EXSTYLE ) | 0x80000 );
HINSTANCE hInst = LoadLibrary("User32.DLL");
if (hInst)
{
typedef BOOL (WINAPI *MYFUNC)(HWND, COLORREF, BYTE, DWORD);
MYFUNC fun = NULL;
fun = ( MYFUNC )GetProcAddress( hInst, "SetLayeredWindowAttributes" );
if (fun)
fun(this->m_hWnd, 0, 100, 2);
FreeLibrary(hInst);
}
this->ShowWindow(SW_SHOW);