Solved

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

Posted on 2004-04-05
4
549 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
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Shell script to login to remote m/c and execute commands 10 78
has22 challenge 11 95
Thin secure Windows 10 5 98
Problem to App source 6 40
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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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