How to set an on_Click event for newly createdControl ?

This is a discussion on How to set an on_Click event for newly createdControl ? within the Windows Programming forums, part of the Platform Specific Boards category; TIA: Ok, so far I've got GetWindowLongA, RegisterClassExA, CreateWindowExA, SetWindowTextA, GetWindowTextA, ShowWindow, UpdateWindow, all working. But now I need to ...

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    31

    How to set an on_Click event for newly createdControl ?

    TIA:
    Ok, so far I've got GetWindowLongA, RegisterClassExA, CreateWindowExA,
    SetWindowTextA, GetWindowTextA, ShowWindow, UpdateWindow, all working.

    But now I need to set an on_Click event for the newly createdControl .
    Pls, how do I go about this?

    Thanks...vmars316

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Juneda
    Posts
    287
    You should check the WM_LBUTTONDOWN message if you want the click on the mouse down, or the WM_LBUTTONUP if you want the event on the button release. Hope that helps.

    Niara

  3. #3
    Grey Wizard C_Sparky's Avatar
    Join Date
    Sep 2009
    Posts
    50
    Catch the message that it has been clicked in the parent message loop.

    Code:
    case WM_COMMAND:
          switch(LOWORD(wParam))
          {
                case IDC_BUTTON:
                   // button has been clicked
                break;
          }
    break;

  4. #4
    Registered User
    Join Date
    Jan 2010
    Posts
    31
    OK, Thanks...vmars316

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. The new FAQ
    By Hammer in forum A Brief History of Cprogramming.com
    Replies: 34
    Last Post: 08-30-2006, 11:05 AM
  2. Set Classes
    By Nicknameguy in forum C++ Programming
    Replies: 13
    Last Post: 10-31-2002, 02:56 PM
  3. Set Classes
    By Nicknameguy in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2002, 08:40 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 11:14 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21