如何在 C# 中使用 AutoIT 库中的 WinSetState 函数

Hes*_*urg 4 .net c# autoit-c#-wrapper

我想知道如何为此函数提供第三个参数,因为我找不到任何文档或我正在错误地查看文档。

  string windowTitle = "None Of Your Business";

   AutoItX3 auto = new AutoItX3(); // auto it object

   auto.WinSetState(windowTitle, "", 1); //function I am trying to call
Run Code Online (Sandbox Code Playgroud)

第三个参数是我在数字 1 中配音的地方,数据类型是整数,但使用 AutoIt Scite IDE 时的文档是这样说的:

参数 title 要改变状态的窗口的标题/hWnd/class。请参阅标题特殊定义。text 要改变状态的窗口文本。请参阅文本特殊定义。flag 已执行程序的“显示”标志:

  • @SW_HIDE = Hide window
    @SW_SHOW = Shows a previously hidden window
    @SW_MINIMIZE = Minimize window
    @SW_MAXIMIZE = Maximize window
    @SW_RESTORE = Undoes a window minimization or maximization
    @SW_DISABLE = Disables the window
    @SW_ENABLE = Enables the window Return Value Success:  1. Failure: 0 if the window is not found.
    
    Run Code Online (Sandbox Code Playgroud)

参考:https : //www.autoitscript.com/autoit3/docs/functions/WinSetState.htm

我正在尝试使用 @SW_MAXIMIZE 选项,我将如何提供它?

提前谢谢了。

Hes*_*urg 5

我发现你只需要引用如下创建的 autoit 对象:

auto.WinSetState(gameTitle, "", auto.SW_MAXIMIZE);
Run Code Online (Sandbox Code Playgroud)