SetTransparence(int value)
{
SetWindowLong(GetSafeHwnd(),GWL_EXSTYLE,
GetWindowLong(GetSafeHwnd(),GWL_EXSTYLE) | 0x80000); //设置窗口扩展风格
typedef BOOL (WINAPI *FSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
FSetLayeredWindowAttributes SetLayeredWindowAttributes; //声明函数
HINSTANCE hInst = LoadLibrary(_T("User32.DLL")); //加载User32.DLL
SetLayeredWindowAttributes = (FSetLayeredWindowAttributes)
GetProcAddress(hInst,"SetLayeredWindowAttributes");
if(SetLayeredWindowAttributes)
SetLayeredWindowAttributes(GetSafeHwnd(),RGB(0,0,0),value,2); //根据value的值设置窗体透明度
FreeLibrary(hInst); //释放动态链接库
}