Article View: borland.public.cppbuilder.nativeapi
Article #4350Minimizing and restoring a maximized MDI child window
From: Pawel Tatera
Date: Sun, 19 Feb 2006 15:26
Date: Sun, 19 Feb 2006 15:26
66 lines
3229 bytes
3229 bytes
Hi.
I'd like to ask what to do to make a maximized MDI child window back to it's
previous position (size), before it was maximized?
I have a main window procedure that part of looks like this:
....
case WM_COMMAND:
HWND mdiActive = (HWND) SendMessage(mdi , WM_MDIGETACTIVE , 0 , 0);
switch (LOWORD(wParam)){
...
/* MDI BOX STUFF */
case IDM_TS_MDI_TILE:
SendMessage(mdi, WM_MDITILE , (WPARAM) (MDITILE_HORIZONTAL |
MDITILE_SKIPDISABLED) , 0);
break;
case IDM_TS_MDI_MAX:
SendMessage(mdi, WM_MDIMAXIMIZE , (WPARAM) mdiActive , 0);
break;
case IDM_TS_MDI_RESTORE:
SendMessage(mdi, WM_MDIRESTORE , (WPARAM) mdiActive , 0);
break;
case IDM_TS_MDI_CASCADE:
SendMessage(mdi, WM_MDICASCADE, 0, 0);
break;
...
IDM_TS_MDI_TILE, IDM_TS_MDI_MAX, IDM_TS_MDI_RESTORE, IDM_TS_MDI_CASCADE are
my custom message triggers defined elswere in the code.
Now when I press any of MDI child box system buttons
(minimize/maximize/close) or select from application menu option that
triggers any of above IDM... messages the MDI CHILD window reacts correctly,
it minimizes/closes itself.
After I maximize w child window, so it's icon moves into the main window
menu and system buttons (minimize/restore/close) show up under main window
system buttons, I can't force that active child window to minimize/restore
to it's previous position using system buttons (my custom IDM... triggers
(from application menu) all work fine; they make the child window to
minimize/restore).
I was trying to put WM_SYSCOMMAND into MDI child box procedure, but catching
SC_RESTORE doesn't seem to work for me. The piece of code from MDI child
proc. looks like this:
.....
case WM_SYSCOMMAND:
switch(wParam){
case SC_RESTORE:
MessageBox(NULL, "OK","Catching SC_RESTORE EVENT", MB_OK);
/*
placed MsgBox here to check if application reacts on mouse clicks on the
system restore button but
without effect; message box doesn't show up.
*/
break;
}
return DefMDIChildProc(hwnd, msg, wParam, lParam);
/* DefMDI... is called after application handles WM_SYSCOMMAND. */
Any idea what message should I catch/pass from main window proc./mdi proc.
to make the child window to minimize?
All help is welcome and appreciated.
Kind regards.
PawelT
Technical Details
Message-ID:
<43f88ea0@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,63b7e8d6c30a001f,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Pawel Tatera" <paweltatera@pa80.chodziez.sdi.tpnet.pl> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Minimizing and restoring a maximized MDI child window Date: Sun, 19 Feb 2006 16:26:39 +0100 Lines: 68 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 217.97.16.80 Message-ID: <43f88ea0@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1140362912 217.97.16.80 (19 Feb 2006 07:28:32 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!newshub.sdsu.edu!peer01.west.cox.net!cox.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail