CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    May 2009
    Posts
    26

    radio button and loss of functionality

    I wrote winapi application.Which during creation defined :
    Code:
    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:
    Code:
    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
    Code:
    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 window back, the keyboard control start to work properly.
    Thank you in advance
    Last edited by yakovm; April 4th, 2010 at 05:24 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured