Posted on 2010-05-21 23:35
S.l.e!ep.¢% 阅读(215)
评论(0) 编辑 收藏 引用 所属分类:
VC
// TODO: Add extra initialization here
#define WS_EX_TRANSPARENT 0x00000020L
#define WS_EX_LAYERED 0x00080000
DWORD dwNewLong = GetWindowLong(m_hWnd, GWL_EXSTYLE);
dwNewLong |= WS_EX_TRANSPARENT |WS_EX_LAYERED;
SetWindowLong(m_hWnd, GWL_EXSTYLE, dwNewLong);
HINSTANCE hInst = LoadLibrary("User32.DLL");
typedef BOOL (WINAPI *MYFUNC)(HWND,COLORREF,BYTE,DWORD);
MYFUNC fun = NULL;
//取得SetLayeredWindowAttributes函数指针
fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
if(fun)fun(this->GetSafeHwnd(),0, 255, 2 );