Solved

handling "minimize all"

Posted on 2002-04-01
5
200 Views
Last Modified: 2013-11-20
Hi.
I know how to handle a "minimize" command...

void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam) {
     if(nID==SC_MINIMIZE)

...but I do not know how to handle "minimize all"
ie: from the start bar, or by pressing Windows key + 'M'.

Does anybody know how to do this?

Thanks.
0
Comment
Question by:bwilhelm
[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
  • 2
5 Comments
 
LVL 4

Expert Comment

by:pagladasu
ID: 6911210
Add these three lines of code:
keybd_event(VK_LWIN, 0, 0, 0);
keybd_event(77, 0, 0, 0);
keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);
0
 
LVL 31

Expert Comment

by:Zoppo
ID: 6912355
Hi bwilhelm,

generally the window which is being minimized (either with 'Minimize' or 'Minimize All')
recieves a WM_SIZE message with wParam == SIZE_MINIMIZED.

You can handle this message but I think that you can't distinguish how the window
is minimized.

hope that helps,

ZOPPO
0
 

Author Comment

by:bwilhelm
ID: 6913013
Thanks for the input so far.

The keybd_event() suggestion seems to synthesize
a minimize command, which is not what I'm looking for.

I do get the WM_SIZE/SIZE_MINIMIZED, but it is too late
to ignore the message.  Minimize is already being
performed.

I would like to trap the "minimize all" command and
ignore it, leaving the window displayed, like I can
do for normal "minimize" via the WM_SYSCOMMAND/SC_MINIMIZE
handling.

Thanks for any additional hints.
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 300 total points
ID: 6917524
Hmm ... sorry, but I found no way to catch the MINIMIZE ALL command ... but,
to avoid that a window can be minimized at all it should be ok to create it
without the WS_MINIMIZEBOX style, i.e. with implementing a PreCreateWindow()
like this:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
 if( !CMDIFrameWnd::PreCreateWindow(cs) )
  return FALSE;
 cs.style &= ~WS_MINIMIZEBOX;
 return TRUE;
}

hope that helps,

ZOPPO
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

734 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