I wrote winapi application.Which during creation defined :

CreateGLWindow(hwnd,"OpenGL",800,600,16,fullscreen);
CreateWindow(TEXT("button"), TEXT("Choose Shading Mode"),
WS_CHILD | WS_VISIBLE | BS_GROUPBOX,10, 610, 300, 120, hwnd, (HMENU) 0,hInstance, NULL);
CreateWindow(TEXT("button"), TEXT("Wireframe"),
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,20, 630, 100, 30, hwnd, (HMENU)IDC_M_WIRE , hInstance, NULL);
CreateWindow(TEXT("button"), TEXT("Flat"),
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,20, 660, 100, 30, hwnd, (HMENU)IDC_M_FLAT , hInstance, NULL);
CreateWindow(TEXT("button"), TEXT("Smooth"),
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,20, 690, 100, 30, hwnd, (HMENU)IDC_M_SMOOTH , hInstance,NULL);

in CreateGLWindow it calls:

CreateWindow( wc.lpszClassName, TEXT("Graphics"),
WS_OVERLAPPEDWINDOW | WS_VISIBLE,10, 10, 800, 800, 0, 0, hInstance, 0);

The procedure is controlled via keyboard and radio buttons defined above

case
WM_KEYDOWN: // Is A Key Being Held Down?
{
switch LOWORD(wParam)
{
//======================
//Move forward/backward
// to Z axis
//======================
//Move forward
case VK_DOWN :
stateM->incZ();
break;
//Move backward
case VK_UP:
stateM->decZ();
break;
}
}
case
WM_COMMAND:
{
switch(LOWORD(wParam))
{
//Set WIRE Model (Edges only)
case IDC_M_WIRE:
stateM->setWire();
break;
//Set FLAT Shading Model
case IDC_M_FLAT:
stateM->setFlat();
break;
//Set SMOOTH Shading Model
case IDC_M_SMOOTH:
stateM->setSmooth();
break;
}
}

When the application is controlled via keyboard it works properly,but when I set one of the radio buttons - it performs the functionality it has to perform when radio- button is checked AND when I want to control via keyboard (after it) I can't no more control it like before.
It seems that application doesn't react on keyboard messages.(But during debug I do see that the keyboard messages are accepted)
Only when I minimize and maximize application back the keyboard control start to work properly.
Thank you in advance

Recommended Answers

All 2 Replies

I think you need to be using the style WS_GROUP on line 5 in addition to what you already have.

I think you need to be using the style WS_GROUP on line 5 in addition to what you already have.

I added.Thanks.But it didn`t solve the problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.