Solved

handling "minimize all"

Posted on 2002-04-01
5
198 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 52
only14 challenge 19 84
Message not shown 5 82
Increment column based of a FK 8 48
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

740 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