passing button control 's input data into a program and manipulate it

I wish to have some buntrol controls, let say button A: 2, Button B:5 and Button C:8. If Button B is chosen, how can i pass the data:5 to a program so that i can take this data into an equation and manipulate it?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

One way to do it is to send it a message using either PostMessage or Send Message. You might want to defined your own message using WM_USER




Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hi kitlee !!
   Its just an extension to VikTor .

#define WM_MYMESSAGE  WM_USER + 1 //For button A
#define WM_MYMESSAGE  WM_USER + 2 //For button B
and so on.......

On click of buttons
PostMessage(hWnd,WM_MYMESSAGE, wParam,lParam);

In a program where u want to trap this message
Hook the message map for ON_MESSAGE(WM_MYMESSAGE, MyFunc);

void MyWndClass::MyFunc(WPARAM wParam,LPARAM lParam)
  //Do whatever u want here
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.