using one button to post messages for other buttons

What's the easiest way to post the message for one button when pressing another?

Like:
CDlg::OnMyButton1() {
  SendMessage(IDC_MY_BUTTON2,0,0)
}

CDlg::OnMyButton2() {
  .. do something ..
}

This doesn't seem to work..  do I need to use ON_BN_CLICKED somehow??

Thanks.
klingejAsked:
Who is Participating?
 
AlexFMConnect With a Mentor Commented:
PostMessage(WM_COMMAND, IDC_MY_BUTTON2, 0);
0
All Courses

From novice to tech pro — start learning today.