SendMessage(hDlg, BN_CLICKED, 101, NULL);

解决方案 »

  1.   

    BM_CLICK
    An application sends a BM_CLICK message to simulate the user clicking a button. This message causes the button to receive the WM_LBUTTONDOWN and WM_LBUTTONUP messages, and the button's parent window to receive a BN_CLICKED notification message.To send this message, call the SendMessage function with the following parameters. SendMessage(
      (HWND) hWnd,              // handle to destination window 
      BM_CLICK,                 // message to send
      (WPARAM) wParam,          // not used; must be zero
      (LPARAM) lParam          // not used; must be zero
    );
    Parameters
    This message has no parameters. Return Values
    This message does not return a value.
      

  2.   

    为何参数不一样?sendMessage( int msg, int wParam, int lParam )
      

  3.   

    GetDlgItem(BUTTON_ID)->PostMessage(BM_CLICKED, NULL, NULL);
      

  4.   

    vary thank you ! 我终于搞定了