![]() |
| | #1 |
| Not stupid, just stupider Join Date: May 2007 Location: Earthland
Posts: 151
| Code: hChild = CreateWindowEx( NULL, "", NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, (HMENU)ID_CHILD, GetInstance(), NULL ); Cheers. EDIT: Sorry, I should've explained the situation more. What I'm trying to do is implement pages in my Tab Controls. I've got the tabs appearing and running fine, but I'm thinking I will add a child window for each page. When the user clicks on a tab, I'll use ShowWindow() to hide the old child window and display the new one. I've figured this would be a pretty good way of doing it (or is it?). So, more or less, how do you implement a child window into a tab, so that I can put in my other controls on the page? Last edited by yaya; 10-29-2009 at 04:45 PM. |
| yaya is offline | |
| | #2 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 224
| Try the DialogBox instead, just declare a template for the window (not necessary the inside controls) and a procedure for that window. Something like that, first setup the template on the resource file: Code: MYSAMPLEWINDOW DIALOG DISCARDABLE 0, 0, 100, 100 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION NOMAPP FONT 8, "MS Sans Serif" BEGIN END Code: #define MYSAMPLEWINDOW 1000 Code: BOOL CALLBACK MySampleWindowProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg)
{
default: return 0;
}
return 1;
}
Code: DialogBox(GetModuleHandle(0),MAKEINTRESOURCE(MYSAMPLEWINDOW),hwnd,MySampleWindowProc); Still another way to do it is creating your own window class, you can find more about that on catch22 (I'm not sure the section's name, but was something like custom controls from scratch). Hope that helps Niara |
| Niara is offline | |
| | #3 |
| Not stupid, just stupider Join Date: May 2007 Location: Earthland
Posts: 151
| Sorry, I should've explained the situation more. What I'm trying to do is implement pages in my Tab Controls. I've got the tabs appearing and running fine, but I'm thinking I will add a child window for each page. When the user clicks on a tab, I'll use ShowWindow() to hide the old child window and display the new one. I've figured this would be a pretty good way of doing it (or is it?). So, more or less, how do you implement a child window into a tab, so that I can put in my other controls on the page? |
| yaya is offline | |
| | #4 |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,359
| That is the way I do it. I 'draw' the dialog in the IDEs resource edtior, [the bit you have missed] create all the child dilalogs when the TAB is created and hide/show the appropriate one on TAB selection change.
__________________ "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter." Friedrich Nietzsche "I spent a lot of my money on booze, birds and fast cars......the rest I squandered." George Best "If you are going through hell....keep going." Winston Churchill |
| novacain is offline | |
| | #5 |
| Registered User Join Date: Mar 2005 Location: Juneda
Posts: 224
| Ok, I was thinking you needed a popup. As novacain said, that's also the way I do it. Niara |
| Niara is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pong is completed!!! | Shamino | Game Programming | 11 | 05-26-2005 10:50 AM |
| Adding colour & bmps to a Win 32 Window?? | carey_sizer | Windows Programming | 4 | 09-04-2004 05:55 PM |
| Child window inside child window | Magos | Windows Programming | 13 | 04-20-2004 06:51 AM |
| Child window with active (highlighted) title bar: Possible? | JasonD | Windows Programming | 7 | 10-16-2003 06:43 AM |
| opengl code not working | Unregistered | Windows Programming | 4 | 02-14-2002 10:01 PM |