透明DIALOG

类别:编程语言 点击:0 评论:0 推荐:

#define WS_EX_ALPHA   0x00080000
#define LWA_ALPHA   0x00000002
#define LWA_COLORKEY   0x00000001

 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;
 //取得SetLayeredWindowAttributes函数指针
 fun=(MYFUNC)GetProcAddress(hInst, "SetLayeredWindowAttributes");
 if(fun)
  fun(this->GetSafeHwnd(),0,230,2);
 FreeLibrary(hInst);
 }

本文地址:http://com.8s8s.com/it/it25222.htm