/// <summary>
/// This message is sent by an application to simulate the user clicking a button. This message causes the button to receive a WM_LBUTTONDOWN and a WM_LBUTTONUP message, and the button's parent window to receive a BN_CLICKED message.
/// </summary>
public enum ButtonControlMessages: uint
{
BM_GETCHECK = 0x00F0,
BM_SETCHECK = 0x00F1,
BM_GETSTATE = 0x00F2,
BM_SETSTATE = 0x00F3,
BM_SETSTYLE = 0x00F4,
BM_CLICK = 0x00F5,
BM_GETIMAGE = 0x00F6,
BM_SETIMAGE = 0x00F7
}
Example
// buttonWindowHandle - handle of Button window
SendMessage(buttonWindowHandle, BM_CLICK, (IntPtr)0, (IntPtr)0);