Article View: borland.public.cppbuilder.nativeapi
Article #4355Re: Minimizing and restoring a maximized MDI child window
From: Pawel Tatera
Date: Mon, 20 Feb 2006 18:21
Date: Mon, 20 Feb 2006 18:21
50 lines
2665 bytes
2665 bytes
Hi again.
I found only one part solution. I have noticed that when I maximize the MDI
child window the WM_SYSCOMMAND's of a child become WM_COMMANDS of the main
window. So I can do something like this inside the main window procedure:
switch (message){
...
case WM_COMMAND:
mdiActive = (HWND) SendMessage(mdi , WM_MDIGETACTIVE , 0 , 0);
switch (LOWORD(wParam)){
case IDM_TS_MDI_RESTORE:
case SC_RESTORE:
SendMessage(mdi, WM_MDIRESTORE , (WPARAM) mdiActive , 0);
break;
....
}
return 0; //when processing WM_COMMAND application must return 0;
...
I have set MDI box procedure to leave WM_SYSCOMMAND for default processing.
The above proc. looks and works very nice. The child window restores itself
from maximized to restored position.
Unfortunately (for me) other commands (SC_MINIMIZE, SC_CLOSE) make the
application to crash.
(it ates all CPU resources and hangs).
It happens when I modify above proc. so it looks like this:
switch (message){
...
case WM_COMMAND:
mdiActive = (HWND) SendMessage(mdi , WM_MDIGETACTIVE , 0 , 0);
switch (LOWORD(wParam)){
case IDM_TS_MDI_RESTORE:
case SC_RESTORE:
SendMessage(mdi, WM_MDIRESTORE , (WPARAM) mdiActive , 0);
break;
case SC_MINIMIZE: //as a WM_COMMAND
SendMessage(mdi, WM_SYSCOMMAND, (WPARAM) SC_MINIMIZE, 0);
break;
....
}
return 0;
...
Does anyone have a solution for that??
Thanks in advance.
PawelT
Technical Details
Message-ID:
<43fa0908@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43f88ea0@newsgroups.borland.com> <43f8bfe7$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,63b7e8d6c30a001f 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 References: <43f88ea0@newsgroups.borland.com> <43f8bfe7$1@newsgroups.borland.com> Subject: Re: Minimizing and restoring a maximized MDI child window Date: Mon, 20 Feb 2006 19:21:13 +0100 Lines: 52 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: <43fa0908@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1140459784 217.97.16.80 (20 Feb 2006 10:23:04 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!feeder.enertel.nl!nntpfeed-01.ops.asmr-01.energis-idc.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail