I use the following code(C++) to get the handle of a window (another application) and send message to one of the buttons to simulate a click and it works without any problem