本文整理汇总了C++中OnNcPaint函数的典型用法代码示例。如果您正苦于以下问题:C++ OnNcPaint函数的具体用法?C++ OnNcPaint怎么用?C++ OnNcPaint使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OnNcPaint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
LRESULT CEICFrameWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch( uMsg )
{
case WM_CREATE: lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
case WM_CLOSE: lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
case WM_DESTROY: lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
#if defined(UI_BUILD_FOR_WIN32) && !defined(UI_BUILD_FOR_WINCE)
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
case WM_NCPAINT: lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
case WM_NCHITTEST: lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
case WM_GETMINMAXINFO: lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
#endif
case WM_SIZE: lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
case WM_SYSCOMMAND: lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
default:
bHandled = FALSE;
}
if( bHandled ) return lRes;
if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
示例2: DefWindowProc
LRESULT CFrameHolder::OnNcActivate(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
mb_NcActive = (wParam != 0);
if (gpConEmu->IsGlass() || !gpSet->isTabsInCaption)
return DefWindowProc(hWnd, uMsg, wParam, lParam);
//return DefWindowProc(hWnd, uMsg, wParam, lParam);
// We can get WM_NCACTIVATE before we're actually visible. If we're not
// visible, no need to paint.
if (!IsWindowVisible(hWnd))
{
return 0;
}
// Force paint our non-client area otherwise Windows will paint its own.
//RedrawWindow(hWnd, NULL, NULL, RDW_UPDATENOW);
//OnPaint(TRUE);
LRESULT lRc;
//if (!mb_NcActive)
//{
// // При потере фокуса (клик мышкой по другому окну) лезут глюки отрисовки этого нового окна
// lRc = DefWindowProc(hWnd, uMsg, wParam, lParam);
//}
//else
//{
lRc = NC_Wrapper(hWnd, uMsg, wParam, lParam);
//}
//lRc = DefWindowProc(hWnd, uMsg, wParam, lParam);
//NC_Redraw(hWnd);
OnNcPaint(hWnd, WM_NCPAINT, 1, 0);
return lRc;
}
示例3: Default
void CSkinWin::OnSize(UINT nType, int cx, int cy)
{
//Default();
CWnd *pWnd = CWnd::FromHandle(m_hWnd);
CRect wr;
Default();
pWnd->GetWindowRect(wr);
pWnd->Invalidate();
OnNcPaint(0);
// if ( m_bTrans )
// SetWindowRgn( m_hWnd, GetRegion(wr.Width(), wr.Height() ), TRUE );
// else
// SetWindowRgn( m_hWnd, NULL, TRUE );
if (m_bTrans)
{
// The operating system does not make a copy of the region,
// so do not make any further function calls with this region handle,
// and do not close this region handle
HRGN hrgn = GetRegion(wr.Width(), wr.Height());
SetWindowRgn(m_hWnd, hrgn, TRUE);
DeleteObject(hrgn); //wyw
}
else
SetWindowRgn(m_hWnd, NULL, TRUE);
}
示例4: switch
//////////////////
// Message handler handles caption-related messages
//
BOOL CCaptionPainter::RelayEvent(MSG* pMsg)
{
switch (pMsg->message)
{
case WM_MOUSEMOVE:
return OnMouseMoveMsg(pMsg->pt);
case WM_LBUTTONUP:
return OnLButtonUp(pMsg->lParam, pMsg->pt);
case WM_NCPAINT:
return OnNcPaint(HRGN(pMsg->wParam));
case WM_NCACTIVATE:
return OnNcActivate(pMsg->wParam);
case WM_SETTEXT:
return OnSetText((LPCTSTR)pMsg->lParam);
case WM_SYSCOLORCHANGE:
case WM_SETTINGCHANGE:
Invalidate();
//m_pParentDlg->SendMessage(m_nPaintMsg, 0, 0L);
return FALSE;
}
return FALSE;
}
示例5: OnNcPaint
BOOL CSkinFrameWnd::OnNcActivate(BOOL bActive)
{
// TODO: 在此加入您的訊息處理常式程式碼和 (或) 呼叫預設值
OnNcPaint();
return TRUE;
//return CFrameWndEx::OnNcActivate(bActive);
}
示例6: switch
LRESULT WindowImplBase::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch (uMsg)
{
case WM_CREATE: lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
case WM_CLOSE: lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
case WM_DESTROY: lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
#if defined(WIN32) && !defined(UNDER_CE)
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
case WM_NCPAINT: lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
case WM_NCHITTEST: lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
case WM_GETMINMAXINFO: lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
case WM_MOUSEWHEEL: lRes = OnMouseWheel(uMsg, wParam, lParam, bHandled); break;
#endif
case WM_SIZE: lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
case WM_SYSCOMMAND: lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
case WM_KEYDOWN: lRes = OnKeyDown(uMsg, wParam, lParam, bHandled); break;
case WM_KILLFOCUS: lRes = OnKillFocus(uMsg, wParam, lParam, bHandled); break;
case WM_SETFOCUS: lRes = OnSetFocus(uMsg, wParam, lParam, bHandled); break;
case WM_LBUTTONUP: lRes = OnLButtonUp(uMsg, wParam, lParam, bHandled); break;
case WM_LBUTTONDOWN: lRes = OnLButtonDown(uMsg, wParam, lParam, bHandled); break;
case WM_MOUSEMOVE: lRes = OnMouseMove(uMsg, wParam, lParam, bHandled); break;
default: bHandled = FALSE; break;
}
if (bHandled) return lRes;
lRes = HandleCustomMessage(uMsg, wParam, lParam, bHandled);
if (bHandled) return lRes;
if (paint_manager_.MessageHandler(uMsg, wParam, lParam, lRes)) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
示例7: switch
//消息循环
LRESULT CMainDlg::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch( uMsg )
{
case WM_CREATE: lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
case WM_CLOSE: lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
case WM_DESTROY: lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
case WM_NCPAINT: lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
case WM_NCHITTEST: lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
case WM_SIZE: lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
case WM_GETMINMAXINFO: lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
case WM_SYSCOMMAND: lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
case WM_COPYDATA: lRes = OnCopyData(uMsg, wParam, lParam, bHandled); break;
case WM_USER_PROG: lRes = OnUserProg(uMsg, wParam, lParam, bHandled); break;
case WM_USER_TEXTPRINT:lRes = OnUserPrint(uMsg, wParam, lParam, bHandled); break;
case WM_USER_DELETE_ITEM: lRes = OnUserCloseListItem(uMsg, wParam, lParam, bHandled); break;
default:
bHandled = FALSE;
}
if( bHandled ) return lRes;
if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}
示例8: OnNcPaint
BOOL CSkinItemEdit::OnSetFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* lpResult)
{
LRESULT ls;
OnNcPaint(0, 0, 0, &ls);
//::PostMessage(m_hWnd, WM_NCPAINT, 0, 0);
return CSkinItem::OnSetFocus(uMsg, wParam, lParam, lpResult);
}
示例9: OnNcPaint
BOOL CSkinDialog::OnNcActivate(BOOL bActive)
{
// TODO: Add your message handler code here and/or call default
m_bActive = bActive?true:false;
OnNcPaint();
return TRUE;
// return CXTPDialog::OnNcActivate(bActive);
}
示例10: OnNcPaint
LRESULT CChatBkDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// TODO: Add your specialized code here and/or call the base class
if (message == 0x125)
{
OnNcPaint();
}
if (message == 0x00AE || //WM_NCUAHDRAWCAPTION
message == 0x00AF) //WM_NCUAHDRAWFRAME)
{
OnNcPaint();
return 0;
}
return CDialog::WindowProc(message, wParam, lParam);
}
示例11: GetSystemMenu
BOOL CSkinWin::PopupSysMenu(CPoint point)
{
CWnd * pWnd = CWnd::FromHandle(m_hWnd);
CMenu SysMenu;
HMENU HTest;
HTest = GetSystemMenu(m_hWnd, FALSE) ;
if ( ! HTest )
{
return FALSE;
}
SysMenu.Attach( GetSystemMenu(m_hWnd, FALSE) );
// when gray menuitem, a strange line appears!!
try
{
#if 0
SysMenu.EnableMenuItem( SC_SIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED );
if ( m_winstate == 0 )
{
SysMenu.EnableMenuItem( SC_MINIMIZE, MF_BYCOMMAND|MF_ENABLED );
SysMenu.EnableMenuItem( SC_MAXIMIZE, MF_BYCOMMAND|MF_ENABLED );
SysMenu.EnableMenuItem( SC_RESTORE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED );
}
else if ( m_winstate == 1 )
{
SysMenu.EnableMenuItem( SC_MAXIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED );
SysMenu.EnableMenuItem( SC_RESTORE, MF_BYCOMMAND|MF_ENABLED );
}
else if ( m_winstate == 2 )
{
SysMenu.EnableMenuItem( SC_MINIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED );
SysMenu.EnableMenuItem( SC_RESTORE, MF_BYCOMMAND|MF_ENABLED );
}
if (!m_minable)
{
SysMenu.EnableMenuItem( SC_MINIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
}
if (!m_maxable)
{
SysMenu.EnableMenuItem( SC_MAXIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED);
}
#endif
SysMenu.TrackPopupMenu( 0, point.x, point.y, pWnd );
SysMenu.Detach();
}
catch (...)
{
}
OnNcPaint(0);
return TRUE;
}
示例12: OnNcPaint
BOOL CSkinWin::OnNcActivate(BOOL bActive)
{
m_bActive = bActive;
OnNcPaint(0);
if ( !bActive )
{
return 1;
}
else
return 0;
}
示例13: switch
//
//******************************************************************
// Function Name : DefWindowProc
// Function : QA: 32574
// Param : UINT message, WPARAM wParam, LPARAM lParam
// Return : LRESULT
// Create :
// Update : ±èÁ¤¹®, 2009/10/09 VS 2008 Upgrade¸¦ À§ÇÑ ÀÛ¾÷
// Comment :
//******************************************************************
LRESULT SECTreeCtrl::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
// Handle messages ourselves.
switch(message)
{
case WM_NCPAINT:
OnNcPaint((HRGN)wParam);
break;
default:
return CWnd::DefWindowProc(message, wParam, lParam);
}
return 0;
}
示例14: switch
LRESULT CWin::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
LRESULT lRes = 0;
BOOL bHandled = TRUE;
switch (uMsg)
{
case WM_CREATE: lRes = OnCreate(uMsg, wParam, lParam, bHandled); break;
case WM_CLOSE: lRes = OnClose(uMsg, wParam, lParam, bHandled); break;
case WM_DESTROY: lRes = OnDestroy(uMsg, wParam, lParam, bHandled); break;
#if defined(WIN32) && !defined(UNDER_CE)
//case WM_NCCREATE: lRes = OnNcCreate(uMsg, wParam, lParam, bHandled); break;
case WM_NCMOUSEMOVE: lRes = OnNCMouseMove(uMsg, wParam, lParam, bHandled); break;
case WM_NCMOUSELEAVE: lRes = OnNCMouseLeave(uMsg, wParam, lParam, bHandled); break;
case WM_NCACTIVATE: lRes = OnNcActivate(uMsg, wParam, lParam, bHandled); break;
case WM_NCCALCSIZE: lRes = OnNcCalcSize(uMsg, wParam, lParam, bHandled); break;
case WM_NCPAINT: lRes = OnNcPaint(uMsg, wParam, lParam, bHandled); break;
case WM_NCHITTEST: lRes = OnNcHitTest(uMsg, wParam, lParam, bHandled); break;
case WM_GETMINMAXINFO: lRes = OnGetMinMaxInfo(uMsg, wParam, lParam, bHandled); break;
case WM_MOUSEWHEEL: lRes = OnMouseWheel(uMsg, wParam, lParam, bHandled); break;
#endif
case WM_ERASEBKGND: lRes = OnEraseBkGnd(uMsg, wParam, lParam, bHandled); break;
case WM_SIZE: lRes = OnSize(uMsg, wParam, lParam, bHandled); break;
case WM_CHAR: lRes = OnChar(uMsg, wParam, lParam, bHandled); break;
case WM_SYSCOMMAND: lRes = OnSysCommand(uMsg, wParam, lParam, bHandled); break;
case WM_KEYDOWN: lRes = OnKeyDown(uMsg, wParam, lParam, bHandled); break;
case WM_KILLFOCUS: lRes = OnKillFocus(uMsg, wParam, lParam, bHandled); break;
case WM_SETFOCUS: lRes = OnSetFocus(uMsg, wParam, lParam, bHandled); break;
case WM_LBUTTONUP: lRes = OnLButtonUp(uMsg, wParam, lParam, bHandled); break;
case WM_LBUTTONDOWN: lRes = OnLButtonDown(uMsg, wParam, lParam, bHandled); break;
case WM_MOUSEMOVE: lRes = OnMouseMove(uMsg, wParam, lParam, bHandled); break;
case WM_MOUSELEAVE: lRes = OnMouseLeave(uMsg, wParam, lParam, bHandled); break;
case WM_MOUSEHOVER: lRes = OnMouseHover(uMsg, wParam, lParam, bHandled); break;
case WM_HOTKEY: lRes = OnHotKey(uMsg, wParam, lParam, bHandled); break;
// case WM_TIMER: lRes = OnTimer(uMsg, wParam, lParam, bHandled); break;//OnTimer响应有小问题
case WM_MOVING: lRes = OnMoving(uMsg, wParam, lParam, bHandled); break;
case WM_SIZING: lRes = OnSizing(uMsg, wParam, lParam, bHandled); break;
case WM_SHOWWINDOW: lRes = OnShowWindow(uMsg, wParam, lParam, bHandled); break;
case WM_COMMAND: lRes = OnCommand(uMsg, wParam, lParam, bHandled); break;
// case WM_PAINT: lRes = OnPaint(uMsg, wParam, lParam, bHandled); break;//OnPaint响应有问题
case WM_MENUCOMMAND: lRes = OnMenuCommand(uMsg, wParam, lParam, bHandled); break;
default: bHandled = FALSE; break;
}
if (bHandled) return lRes;
lRes = ProcessWindowMessage(uMsg, wParam, lParam, bHandled);
if (bHandled) return lRes;
if(_paintManager && _paintManager->MessageHandler(uMsg,wParam,lParam,lRes))
return lRes;
return __super::HandleMessage(uMsg,wParam,lParam);
}
示例15: Maximize
void CSkinWin::OnSysCommand(UINT nID, LPARAM lParam)
{
if ( nID == SC_MAXIMIZE )
{
Maximize();
}
else if ( nID == SC_RESTORE && m_winstate == 1 )
{
Restore();
}
else if ( nID == SC_RESTORE && m_winstate == 2 )
{
ShowWindow( m_hWnd, SW_RESTORE );
m_winstate = m_oldwinstate;
OnNcPaint(0);
}
else if(nID == SC_MINIMIZE)
{
Minimize();
}
else
Default();
OnNcPaint(0);
}