Article View: borland.public.cppbuilder.nativeapi
Article #10249MDI child windows issue
From: Mark Morrisson
Date: Sun, 09 May 2004 09:37
Date: Sun, 09 May 2004 09:37
97 lines
3350 bytes
3350 bytes
Hi everyone,
I have a problem with my basic MDI application. When I maximize a child
window, it
does not make its Min/Max/Close buttons appear in the main window (MDI
frame) menu.
Why ? Here are the MDI-related parts of my program :
/* WinMain function */
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
cmdParam, int cmdShow)
{
...
wc.lpfnWndProc = MainWindow_WndProc;
wc.lpszClassName = CLASS_NAME;
...
RegisterClass(&wc);
wc.lpfnWndProc = Portfolio_WndProc;
wc.lpszMenuName = NULL;
wc.lpszClassName = "Portfolio";
RegisterClass(&wc);
...
g_hMainWindow = CreateWindow(CLASS_NAME,
"Stocks Analyzer",
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT,
GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
NULL,
NULL,
g_hInstance,
NULL);
}
/* Main frame window procedure */
LRESULT CALLBACK MainWindow_WndProc(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
case WM_CREATE:
{
CLIENTCREATESTRUCT ccs;
ccs.hWindowMenu = GetSubMenu(GetMenu(hwnd), 0);
ccs.idFirstChild = 9000;
g_hMDIClient = CreateWindow("MDICLIENT", NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
0, 0, 0, 0,
hwnd,
(HMENU) 8500,
g_hInstance,
(LPSTR) &ccs);
return 0;
}
...
}
return DefFrameProc(hwnd, g_hMDIClient, message, wParam, lParam);
}
/* Menu command "New" handler, which creates a child window */
void MenuFile_New(void)
{
g_hPortfolio = CreateMDIWindow("Portfolio",
"Mon portefeuille",
0,
CW_USEDEFAULT,
CW_USEDEFAULT,
600,
500,
g_hMDIClient,
g_hInstance,
NULL
);
}
/* Child window procedure */
LRESULT CALLBACK Portfolio_WndProc(HWND hwnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
...
return DefMDIChildProc(hwnd, message, wParam, lParam);
}
When I run the program, the MDI client windows appears on the main frame
client area. When I
click on "New" from the menu, a child window appears inside the MDI client
window client area,
but when I maximize this window, its buttons don't appear at the right of
the frame window's
menu bar (as it works in UltraEdit for instance). How come ?
Thanks in advance,
Mark
Technical Details
Message-ID:
<409dfc25@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!irazu.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,275dc6553c2c5e01,start X-Google-Attributes: gid10cc67,public From: "Mark Morrisson" <mark4@NO_SPAMvoila.fr> Newsgroups: borland.public.cppbuilder.nativeapi Subject: MDI child windows issue Date: Sun, 9 May 2004 11:37:23 +0200 Lines: 99 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 213.44.148.184 Message-ID: <409dfc25@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1084095525 213.44.148.184 (9 May 2004 02:38:45 -0700) Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!irazu.switch.ch!switch.ch!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail