本文整理汇总了C++中SWindow::SSendMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ SWindow::SSendMessage方法的具体用法?C++ SWindow::SSendMessage怎么用?C++ SWindow::SSendMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SWindow
的用法示例。
在下文中一共展示了SWindow::SSendMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnKeyDown
void SListBoxEx::OnKeyDown( TCHAR nChar, UINT nRepCnt, UINT nFlags )
{
int nNewSelItem = -1;
SWindow *pOwner = GetOwner();
if (pOwner && (nChar == VK_ESCAPE))
{
pOwner->SSendMessage(WM_KEYDOWN, nChar, MAKELONG(nFlags, nRepCnt));
return;
}
if (nChar == VK_DOWN && m_iSelItem < GetItemCount() - 1)
nNewSelItem = m_iSelItem+1;
else if (nChar == VK_UP && m_iSelItem > 0)
nNewSelItem = m_iSelItem-1;
else if (pOwner && nChar == VK_RETURN)
nNewSelItem = m_iSelItem;
else if(nChar == VK_PRIOR)
{
OnScroll(TRUE,SB_PAGEUP,0);
}else if(nChar == VK_NEXT)
{
OnScroll(TRUE,SB_PAGEDOWN,0);
}
if(nNewSelItem!=-1)
{
EnsureVisible(nNewSelItem);
NotifySelChange(m_iSelItem,nNewSelItem);
}
}
示例2: OnFrameMouseWheel
void SwndContainerImpl::OnFrameMouseWheel( UINT uMsg,WPARAM wParam,LPARAM lParam )
{
SWindow *pWndTarget =SWindowMgr::GetWindow(m_hCapture);
if(!pWndTarget)
{
if(IsSendWheel2Hover())
{
m_hHover=SwndFromPoint(CPoint(GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam)),FALSE);
pWndTarget=SWindowMgr::GetWindow(m_hHover);
}else
{
pWndTarget = SWindowMgr::GetWindow(m_focusMgr.GetFocusedHwnd());
}
}
if(pWndTarget && !pWndTarget->IsDisabled(TRUE))
{
BOOL bMsgHandled = FALSE;
pWndTarget->SSendMessage(uMsg,wParam,lParam,&bMsgHandled);
SetMsgHandled(bMsgHandled);
}else
{
SetMsgHandled(FALSE);
}
}
示例3: OnSwitchClick
bool SFlyWnd::OnSwitchClick( EventArgs *pEvt )
{
//让窗口可以更新hover状态
SWindow *pBtn = (SWindow*)(pEvt->sender);
pBtn->SSendMessage(WM_MOUSELEAVE);
SwitchState(!m_bEndPos);
return true;
}
示例4: OnKeyDown
void SComboEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
SWindow *pOwner = GetOwner();
if (pOwner && (nChar == VK_DOWN || nChar == VK_ESCAPE))
{
pOwner->SSendMessage(WM_KEYDOWN, nChar, MAKELONG(nFlags, nRepCnt));
return;
}
SetMsgHandled(FALSE);
}
示例5: OnChar
void SListBoxEx::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
SWindow *pOwner = GetOwner();
if (pOwner)
pOwner->SSendMessage(WM_CHAR, nChar, MAKELONG(nFlags, nRepCnt));
}
示例6: OnFrameMouseMove
void SwndContainerImpl::OnFrameMouseMove(UINT uFlag,CPoint pt)
{
SWindow *pCapture=SWindowMgr::GetWindow(m_hCapture);
if(pCapture)
{//有窗口设置了鼠标捕获,不需要判断是否有TrackMouseEvent属性,也不需要判断客户区与非客户区的变化
SWindow * pHover=pCapture->IsContainPoint(pt,FALSE)?pCapture:NULL;
SWND hHover=pHover?pHover->GetSwnd():NULL;
if(hHover!=m_hHover)
{//检测鼠标是否在捕获窗口间移动
SWindow *pOldHover=SWindowMgr::GetWindow(m_hHover);
m_hHover=hHover;
if(pOldHover)
{
if(m_bNcHover) pOldHover->SSendMessage(WM_NCMOUSELEAVE);
pOldHover->SSendMessage(WM_MOUSELEAVE);
}
if(pHover && !(pHover->GetState()&WndState_Hover))
{
if(m_bNcHover) pHover->SSendMessage(WM_NCMOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
pHover->SSendMessage(WM_MOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
}
}
pCapture->SSendMessage(m_bNcHover?WM_NCMOUSEMOVE:WM_MOUSEMOVE,uFlag,MAKELPARAM(pt.x,pt.y));
}
else
{//没有设置鼠标捕获
SWND hHover=SwndFromPoint(pt,FALSE);
SWindow * pHover=SWindowMgr::GetWindow(hHover);
if(m_hHover!=hHover)
{//hover窗口发生了变化
SWindow *pOldHover=SWindowMgr::GetWindow(m_hHover);
m_hHover=hHover;
if(pOldHover)
{
BOOL bLeave=TRUE;
if(pOldHover->GetStyle().m_bTrackMouseEvent)
{//对于有监视鼠标事件的窗口做特殊处理
bLeave = !pOldHover->IsContainPoint(pt,FALSE);
}
if(bLeave)
{
if(m_bNcHover) pOldHover->SSendMessage(WM_NCMOUSELEAVE);
pOldHover->SSendMessage(WM_MOUSELEAVE);
}
}
if(pHover && !pHover->IsDisabled(TRUE) && !(pHover->GetState() & WndState_Hover))
{
m_bNcHover=pHover->OnNcHitTest(pt);
if(m_bNcHover) pHover->SSendMessage(WM_NCMOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
pHover->SSendMessage(WM_MOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
}
}
else if(pHover && !pHover->IsDisabled(TRUE))
{//窗口内移动,检测客户区和非客户区的变化
BOOL bNcHover=pHover->OnNcHitTest(pt);
if(bNcHover!=m_bNcHover)
{
m_bNcHover=bNcHover;
if(m_bNcHover)
{
pHover->SSendMessage(WM_NCMOUSEHOVER,uFlag,MAKELPARAM(pt.x,pt.y));
}
else
{
pHover->SSendMessage(WM_NCMOUSELEAVE);
}
}
}
if(pHover && !pHover->IsDisabled(TRUE))
pHover->SSendMessage(m_bNcHover?WM_NCMOUSEMOVE:WM_MOUSEMOVE,uFlag,MAKELPARAM(pt.x,pt.y));
}
//处理trackMouseEvent属性
SPOSITION pos = m_lstTrackMouseEvtWnd.GetHeadPosition();
while(pos)
{
SWND swnd = m_lstTrackMouseEvtWnd.GetNext(pos);
SWindow *pWnd = SWindowMgr::GetWindow(swnd);
if(!pWnd)
{
UnregisterTrackMouseEvent(swnd);
}else if(pWnd->IsVisible(TRUE))
{
BOOL bInWnd = pWnd->IsContainPoint(pt,FALSE);
if(bInWnd && !(pWnd->GetState() & WndState_Hover))
{
pWnd->SSendMessage(WM_MOUSEHOVER);
}else if(!bInWnd && (pWnd->GetState() & WndState_Hover))
{
pWnd->SSendMessage(WM_MOUSELEAVE);
}
}
}
}