问题描述
- SetWindowLong出现的问题
- 各位大侠。我在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)(HWNDCOLORREFBYTEDWORD); MYFUNC fun=NULL; fun=(MYFUNC)GetProcAddress(hInstSetLayeredWindowAttributes""); if(fun) fun(this->GetSafeHwnd()0702); FreeLibrary(hInst); }
解决方案
fun(this->GetSafeHwnd()0702);
修改成
{
pWnd=((CFrameWnd*)(AfxGetApp()->m_pMainWnd))->GetActiveView();
fun(pWnd>GetSafeHwnd()0702);
}
时间: 2025-01-07 16:39:20