Erik Wiggins
March 22nd, 2004, 10:23 AM
Ok I'm really strugelling with MDI creation. So I'm going to take it one step at a time. I know that my Frame window works because when I run it as a stand alone window it works fine. When I try to add Client window creation into the picture everything compiles right but nothing shows on the screen. My first question is with the Client Create Struncture.
I have my Frame window created and it's handle is hWnd. It has a Menu IDR_Menu1. IDR_MENU1 has to drop down menu's File and Window.
First, am I correct in assuming that you must have a menu with a Window submenu assigned to the Framewindow class?
Second, with the given information is this correct?
hWindowMenu = GetSubMenu(GetMenu(hWnd),1)
Third, idFirstChild where does it come from. How do I use it right? I've tried a define statment
#define ID_FIRSTCHILD 5000
WM_CREATE
{
CLIENTCREATESTRUCT ccs;
ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd),1)
ccs.idFirstChild = ID_FIRSTCHILD;
CreateWindowEx(
WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT,
"MDICLIENT",
(LPCTSTR) NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT0,
hWnd,
NULL,
hInst,
(LPSTR) &ccs
);
}
brake;
I've even tried adding it as a menu item and assigning it to the menu ID. What is the correct way to do this?
At this point I'm not sure I've done anything right and trial and error don't seem to be working. I've tried creating the child window using CreateWindowEx. Iv'e tried to do it by sendinf a WM_MDICREATE message to the client window. I've also tried the CreateMDIWindow function. I've tried doing all these from the WM_CREATE for the frame window and from WinMain it's self. Nothing seems to work. I finally tried skipping the child window all together and just making a frame and client window. At which point I get the same resault the program compiles properly. When I try to exacute I get nothing, No window appaers what so ever. TaskManager however does show the program runing underprocess and I have to end task to recompile my code. All of the toturials are adding so much extra to the source code that I can't desifer what is base code and what is for all the extra stuff. MSDN leave alot of stuff out assuming you already know stuff you are tring to learn. So please I need someone to hold my hand and walk me through creating a simple MDI that does nothing exsept for open and close windows. At this point I'd settle for a well anoatated workspace as long as it only does the very basics.
I have my Frame window created and it's handle is hWnd. It has a Menu IDR_Menu1. IDR_MENU1 has to drop down menu's File and Window.
First, am I correct in assuming that you must have a menu with a Window submenu assigned to the Framewindow class?
Second, with the given information is this correct?
hWindowMenu = GetSubMenu(GetMenu(hWnd),1)
Third, idFirstChild where does it come from. How do I use it right? I've tried a define statment
#define ID_FIRSTCHILD 5000
WM_CREATE
{
CLIENTCREATESTRUCT ccs;
ccs.hWindowMenu = GetSubMenu(GetMenu(hWnd),1)
ccs.idFirstChild = ID_FIRSTCHILD;
CreateWindowEx(
WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT,
"MDICLIENT",
(LPCTSTR) NULL,
WS_CHILD | WS_CLIPCHILDREN | WS_VSCROLL | WS_HSCROLL,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT0,
hWnd,
NULL,
hInst,
(LPSTR) &ccs
);
}
brake;
I've even tried adding it as a menu item and assigning it to the menu ID. What is the correct way to do this?
At this point I'm not sure I've done anything right and trial and error don't seem to be working. I've tried creating the child window using CreateWindowEx. Iv'e tried to do it by sendinf a WM_MDICREATE message to the client window. I've also tried the CreateMDIWindow function. I've tried doing all these from the WM_CREATE for the frame window and from WinMain it's self. Nothing seems to work. I finally tried skipping the child window all together and just making a frame and client window. At which point I get the same resault the program compiles properly. When I try to exacute I get nothing, No window appaers what so ever. TaskManager however does show the program runing underprocess and I have to end task to recompile my code. All of the toturials are adding so much extra to the source code that I can't desifer what is base code and what is for all the extra stuff. MSDN leave alot of stuff out assuming you already know stuff you are tring to learn. So please I need someone to hold my hand and walk me through creating a simple MDI that does nothing exsept for open and close windows. At this point I'd settle for a well anoatated workspace as long as it only does the very basics.