Solved

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

Posted on 2004-04-05
4
578 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 500 total points
ID: 10759720
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
ID: 10759846
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
ID: 10760030
My fault entirely.

Please delete this question.
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 10760301
You'll have to request this by posting a message here:

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

634 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