P
So ich habs jetzt realisiert mit RelayEvent,OnLBuutonDown,OnLButtonUp,MouseMove
Hier der Code:
void CTestToolBarCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
// pass this message to the ToolTip control
RelayEvent(WM_LBUTTONDOWN, (WPARAM)nFlags,
MAKELPARAM(LOWORD(point.x), LOWORD(point.y)));
COleControl::OnLButtonDown(nFlags, point);
}
void CTestToolBarCtrl::OnLButtonUp(UINT nFlags, CPoint point)
{
// pass this message to the ToolTip control
RelayEvent(WM_LBUTTONUP, (WPARAM)nFlags,
MAKELPARAM(LOWORD(point.x), LOWORD(point.y)));
COleControl::OnLButtonUp(nFlags, point);
}
void CTestToolBarCtrl::OnMouseMove(UINT nFlags, CPoint point)
{
// pass this message to the ToolTip control
RelayEvent(WM_MOUSEMOVE, (WPARAM)nFlags,
MAKELPARAM(LOWORD(point.x), LOWORD(point.y)));
COleControl::OnMouseMove(nFlags, point);
}
void CTestToolBarCtrl::RelayEvent(UINT message, WPARAM wParam, LPARAM lParam)
{
MessageBox("1");
// This function will create a MSG structure, fill it in a pass it to
// the ToolTip control, m_ttip. Note that we ensure the point is in window
// coordinates (relative to the control's window).
if(NULL != m_pToolTip2.m_hWnd)
{
MessageBox("1");
MSG msg;
msg.hwnd = m_hWnd;
msg.message = message;
msg.wParam = wParam;
msg.lParam = lParam;
msg.time = 0;
msg.pt.x = LOWORD(lParam);
msg.pt.y = HIWORD(lParam);
m_pToolTip2.RelayEvent(&msg);
}
}
Es funktioniert jetzt auch wunderbar im TestContainer aber nicht wenn ich es in ein Projekt include. Im Testcontainer erscheinen die MessageBoxen und im Projekt dann nicht.
Gruss pmb