Please help me(

Hello Everybody!!!
Can anyone help me with my problem in C++, I've got window, which written with code. In my window located buttons("New Game", "Set Player" ... and so on). My question is the following:
If we click "New Game" button, can I open new panel in my window! Here is my code:
=============================================================================
#include <windows.h>
const char g_szClassName[] = "myWindowClass";
#define ID_BUTTON1 1
#define ID_BUTTON2 2
#define ID_BUTTON3 3
#define ID_BUTTON4 4
#define ID_BUTTON5 5
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
switch(msg){
case WM_CREATE:{
CreateWindow(TEXT("BUTTON"), TEXT("New Game"),
WS_VISIBLE | WS_CHILD ,
120, 80, 80, 25,
hwnd, (HMENU) ID_BUTTON1, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("Set Player"),
WS_VISIBLE | WS_CHILD ,
120, 120, 80, 25,
hwnd, (HMENU) ID_BUTTON2, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("Records"),
WS_VISIBLE | WS_CHILD ,
120, 160, 80, 25,
hwnd, (HMENU) ID_BUTTON3, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("About"),
WS_VISIBLE | WS_CHILD ,
120, 200, 80, 25,
hwnd, (HMENU) ID_BUTTON4, NULL, NULL);
CreateWindow(TEXT("BUTTON"), TEXT("Quit"),
WS_VISIBLE | WS_CHILD ,
120, 240, 80, 25,
hwnd, (HMENU) ID_BUTTON5, NULL, NULL);
break;
}
case WM_COMMAND:{
//=============================================================================
if(LOWORD(wParam) == ID_BUTTON1){
//H E R E I W A N T T O S H O W T H E N E X T P A N E L
}
//=============================================================================
break;
}

case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}

Thanks!!!
Last edited on
I think I would look into the tab control with having that many windows. Or I guess you could call SetWindowPos() to bring the window to the foreground when the button is clicked.
You could design a new dialog box and present it there. If you want something embedded, then most likely a custom control is best. So start simple, then move to more complex things. Try the dialog box first. Then see if you can make it a custom control or maybe see if there's a control out there that you think you can use.
Topic archived. No new replies allowed.