开发者

click on a button in another application from my C# application?

开发者 https://www.devze.com 2023-02-09 03:00 出处:网络
I want to click on a button in another application from my C# application , and I don\'t have the source code for the application that contains the button

I want to click on a button in another application from my C# application ,

and I don't have the source code for the application that contains the button

let us开发者_如何学JAVA say as an example ...can I use windows calculator from my application by clicking its buttons Programmatically

I am using c# and .NET

I think I must use windows api to do this

does anybody have any idea????


Yes, it's not too complicated. You can use FindWindowEx to get the window handle, then iterate through the windows elements and use sendmessage or postmessage to send the WM_Click message.

Here's a codeproject project that does exactly what you want.

Code project

0

精彩评论

暂无评论...
验证码 换一张
取 消