Jul 4, 2012 at 12:37pm UTC
yes in c++
My code is :
#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){
//Here I want to show next Panel ...
MessageBox(hwnd, "Button is clicked", "Title of MessageBox", MB_ICONINFORMATION);
}
break;
}
Last edited on Jul 4, 2012 at 12:38pm UTC