HWND child;
int iHitTestResult = -1;
+ TRACE("ProcessMouseDown %d %d %d\n", msg->message, msg->wParam, msg->lParam);
+
// Don't do anything if another window is capturing the mouse.
HWND cCapture = ::GetCapture();
if (cCapture && cCapture != m_captureHwnd && m_current->type != TrackedMenuEntry)
TRACE("MouseDown %d\n", m_isLButtonDown);
- BOOL isTracking = FALSE;
if (entry)
{
ScreenToClient(child, &pt);
iHitTestResult = SendMessageW(child, TB_HITTEST, 0, (LPARAM) &pt);
- isTracking = entry->mb->_IsTracking();
if (iHitTestResult >= 0)
{
HWND child;
int iHitTestResult = -1;
+ TRACE("ProcessMouseUp %d %d %d\n", msg->message, msg->wParam, msg->lParam);
+
// Don't do anything if another window is capturing the mouse.
HWND cCapture = ::GetCapture();
if (cCapture && cCapture != m_captureHwnd && m_current->type != TrackedMenuEntry)
TRACE("MouseUp %d\n", m_isLButtonDown);
- BOOL isTracking = FALSE;
if (entry)
{
ScreenToClient(child, &pt);
iHitTestResult = SendMessageW(child, TB_HITTEST, 0, (LPARAM) &pt);
- isTracking = entry->mb->_IsTracking();
if (iHitTestResult >= 0)
{
HRESULT CMenuFocusManager::PlaceHooks()
{
+ if (m_hMsgFilterHook)
+ {
+ WARN("GETMESSAGE hook already placed!\n");
+ return S_OK;
+ }
+ if (m_hMsgFilterHook)
+ {
+ WARN("MSGFILTER hook already placed!\n");
+ return S_OK;
+ }
if (m_current->type == TrackedMenuEntry)
{
TRACE("Entering MSGFILTER hook...\n");
HRESULT hr;
StackEntry * old = m_current;
+ TRACE("UpdateFocus\n");
+
if (old)
SetCapture(NULL);
HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb)
{
+ DbgPrint("PushMenuBar %p\n", mb);
+
+ mb->AddRef();
+
_ASSERT(m_bandCount == 0);
HRESULT hr = PushToArray(MenuBarEntry, mb, NULL);
HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb)
{
+ DbgPrint("PushTrackedPopup %p\n", mb);
+
+ mb->AddRef();
+
_ASSERT(!m_current || m_current->type != TrackedMenuEntry);
HRESULT hr = PushToArray(MenuPopupEntry, mb, NULL);
HRESULT CMenuFocusManager::PushTrackedPopup(HMENU popup)
{
+ DbgPrint("PushTrackedPopup %p\n", popup);
+
_ASSERT(m_bandCount > 0);
_ASSERT(!m_current || m_current->type != TrackedMenuEntry);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- TRACE("PushTrackedPopup %p\n", popup);
+ DbgPrint("PushTrackedPopup %p\n", popup);
m_selectedMenu = popup;
m_selectedItem = -1;
m_selectedItemFlags = 0;
CMenuBand * mbc;
HRESULT hr;
+ DbgPrint("PopMenuBar %p\n", mb);
+
+ if (m_current == m_entryUnderMouse)
+ {
+ m_entryUnderMouse = NULL;
+ }
+
hr = PopFromArray(&type, &mbc, NULL);
if (FAILED_UNEXPECTEDLY(hr))
{
mbc->_SetParentBand(NULL);
+ mbc->Release();
+
hr = UpdateFocus();
if (FAILED_UNEXPECTEDLY(hr))
return hr;
CMenuBand * mbc;
HRESULT hr;
+ DbgPrint("PopMenuPopup %p\n", mb);
+
+ if (m_current == m_entryUnderMouse)
+ {
+ m_entryUnderMouse = NULL;
+ }
+
hr = PopFromArray(&type, &mbc, NULL);
if (FAILED_UNEXPECTEDLY(hr))
{
mbc->_SetParentBand(NULL);
+ mbc->Release();
+
hr = UpdateFocus();
if (FAILED_UNEXPECTEDLY(hr))
return hr;
HMENU hmenu;
HRESULT hr;
+ DbgPrint("PopTrackedPopup %p\n", popup);
+
hr = PopFromArray(&type, NULL, &hmenu);
if (FAILED_UNEXPECTEDLY(hr))
{