I make a clicker application that will close the error windows in the application installed on the PC. The application works, it finds an error window, it finds the OK button, which you need to click, but you cannot, in fact, click this button.
I watched the code on pinvoke.net, took examples from there, but nothing comes out. Pressing I try to make through SendMessage .
appHandle is a window where you have to press a button, it is searched, everything is correct children[0].ToString() is the button itself, it is also searched correctly
Advise solutions to the problem? How to send a right click on the button in the application window?
SendMessage(appHandle, BM_CLICK,WM_LBUTTONDOWN, children[0].ToString());