Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 117
Expand macro to ask for filename column 8 37
dog bark java program 15 112
Making an alias 7 101
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

821 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