用SendMessage函数模拟按钮的点击

方法1

pWnd->SendMessage(WM_COMMAND,((WPARAM)BN_CLICKED)<<8|(WPARAM)IDC_BUTTON1, 0L )

 

方法2

pBtn = pWnd->GetDlgItem(IDC_BUTTON1);

pBtn->SendMessage(WM_ LBUTTONDOWN,IDC_BUTTON1,0);

pBtn->SendMessage(WM_LBUTTONUP,IDC_BUTTON1,0);

 

方法3

pWnd->SendDlgItemMessage(IDC_RADIO1,BM_CLICK,0,0);

你可能感兴趣的:(message)