Programmatically press a button on another application (C, Windows)

前端 未结 12 1380
小蘑菇
小蘑菇 2021-01-30 14:47

I\'m trying to use the following code to press a button on my other application:

HWND ButtonHandle;
if( (wnd = FindWindow(0, \"Do you want to save?\")) )
{   
           


        
12条回答
  •  孤街浪徒
    2021-01-30 15:29

    A non-C approach: Use Java and the java.awt.Robot class to move the mouse around perform real clicks (I guess there is something in the Windows World for this, too). Problem: You have to know where your button is :D

提交回复
热议问题