Solved

How to catch status bar click event (re-post)

Posted on 2004-04-05
4
524 Views
Last Modified: 2013-11-20
I need to minimize the program on status bar click event in MFC.
How do I do that?
I asked that question, and the solution I accepted follows:

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
  if (pMsg->message == WM_LBUTTONDOWN)
    {
    CRect rect;
    CPoint point((DWORD)pMsg->lParam);

    m_wndStatusBar.GetClientRect(rect);

    if (rect.PtInRect(point))
      ActivateFrame(SW_MINIMIZE);
    }
     
  return CMDIFrameWnd::PreTranslateMessage(pMsg);
}

This doesn't work,
it will minimize the form on a click of a button or combo box elsewhere on the form.

Please help.
0
Comment
Question by:jd9288
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 500 total points
Comment Utility
I posted this on the other thread as well:

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
  if (pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd == m_wndStatusBar.m_hWnd)
    ActivateFrame(SW_MINIMIZE);
     
  return CMDIFrameWnd::PreTranslateMessage(pMsg);
}

Good Luck,
Steve
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
I'd recommend asking to have this question deleted. It's a continuation of your previous question:

http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20941410.html#10758544
0
 

Author Comment

by:jd9288
Comment Utility
My fault entirely.

Please delete this question.
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
You'll have to request this by posting a message here:

http://www.experts-exchange.com/Community_Support/
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now