Solved

handling "minimize all"

Posted on 2002-04-01
5
193 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
  • 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 30

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 30

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ADO Memory leak with DELPHI 2007 37 155
deburging in oracle form 12 76
has77  challenge 9 67
zeroFront challenge 7 71
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…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now