各位大俠。我在MFC 框架類中加Button事件,想實現View窗口透明,結果整個框架窗口全部透明了,改怎麼改啊?、謝謝!著急!!
void CMainFrame::onbutton1:
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;
fun=(MYFUNC)GetProcAddress(hInst,"SetLayeredWindowAttributes");
if(fun)
fun(this->GetSafeHwnd(),0,70,2);
FreeLibrary(hInst);
}
fun(this->GetSafeHwnd(),0,70,2);
修改成
{
pWnd=((CFrameWnd*)(AfxGetApp()->m_pMainWnd))->GetActiveView();
fun(pWnd>GetSafeHwnd(),0,70,2);
}