请问,想使按钮透明(某一种颜色),能否使用SetLayeredWindowAttributes?使用了下面得代码,好象不成功! //µÃµ½Í¼Æ¬´óС²¢µ÷Õû´°¿Ú´óСÊÊӦͼƬ
bitmap.GetBitmap(&bitInfo);


m_DC[0].CreateCompatibleDC(GetDC());
m_oldBitmap[0] = m_DC[0].SelectObject(&bitmap); //Ê×ÏÈ»ñµÃÑÚÂëÑÕÉ«
COLORREF maskColor   = crTransColorIn;

#define LWA_COLORKEY  0x00000001
#define WS_EX_LAYERED  0x00080000 typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes; HMODULE hUser32 = GetModuleHandle("user32.dll");
SetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32,"SetLayeredWindowAttributes");
SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE) | WS_EX_LAYERED);
SetLayeredWindowAttributes(GetSafeHwnd(), maskColor, 255, LWA_COLORKEY);
FreeLibrary(hUser32);