在MFC中增加调用如下函数即可
void CtestTOUMINGDUDlg::setTOUMING(void)
{SetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE,
GetWindowLong(this->GetSafeHwnd(),GWL_EXSTYLE)^0x80000);
HINSTANCE hinstance = LoadLibrary(_T("User32.dll"));
if(NULL != hinstance)
{
typedef BOOL (WINAPI*MyFunc)(HWND,COLORREF,BYTE,DWORD);
MyFunc pFunc = NULL;
pFunc = (MyFunc)GetProcAddress(hinstance,"SetLayeredWindowAttributes");
if(pFunc != NULL)
{
pFunc(this->GetSafeHwnd(),0,128/*透明度0-255*/,2);
}
FreeLibrary(hinstance);
}
}