我想在游戏中模拟按下游戏中的一个BUTTON,这个BUTTON我找到了,但想让他在游戏进入时自动按下,请问我该怎么去实现?

解决方案 »

  1.   

    SendMessage(H, WM_Command, MakeWParam(IdBtn,BN_CLICKED), HndControl);
      

  2.   

    你首先需要获得那个Button的Handle才能进一步操作的如果Button的位置是固定的,也可以使用Mouse_Event模拟点击操作(需要保证Game的Windows是在最上面的)
      

  3.   

    SendMessage(H, WM_Command, MakeWParam(IdBtn,BN_CLICKED), HndControl);
    HndControl是什么意思,请讲解下。
      

  4.   

    procedure TForm1.Button2Click(Sender: TObject);
    begin
    SendMessage(button1.handle, WM_Command, MakeWParam(button1.handle,BN_CLICKED), 0);
    end;