OpenKeyWord  Version: 426, Datum:
AUI.cs
1 #region Header
2 /*
3  ==============================================================================
4  Author: Zoltan Hrabovszki <zh@openkeyword.de>
5 
6  Copyright © 2012, 2013, 2014, 2015 IT-Beratung Hrabovszki
7  www.OpenKeyWord.de
8  ==============================================================================
9 
10  This file is part of OpenKeyWord.
11 
12  OpenKeyWord is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenKeyWord is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenKeyWord. If not, see <http://www.gnu.org/licenses/>.
24 
25  Diese Datei ist Teil von OpenKeyWord.
26 
27  OpenKeyWord ist Freie Software: Sie können es unter den Bedingungen
28  der GNU General Public License, wie von der Free Software Foundation,
29  Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren
30  veröffentlichten Version, weiterverbreiten und/oder modifizieren.
31 
32  OpenKeyWord wird in der Hoffnung, dass es nützlich sein wird, aber
33  OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite
34  Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.
35  Siehe die GNU General Public License für weitere Details.
36 
37  Sie sollten eine Kopie der GNU General Public License zusammen mit
38  OpenKeyWord erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>.
39 */
40 #endregion Header
41 
42 namespace OKW.GUI.AUI
43 {
44  using System;
45  using System.Collections.Generic;
46  using System.Runtime.InteropServices;
47  using System.Text;
48 
49  public class AutoItX_NONO
50  {
51  #region Fields
52 
53  public const int AU3_INTDEFAULT = -2147483647; // "Default" value for _some_ int parameters(largest negative number)
54  public const int ERROR = 1;
55  public const int SW_HIDE = 2;
56  public const int SW_MAXIMIZE = 3;
57  public const int SW_MINIMIZE = 4;
58  public const int SW_RESTORE = 5;
59  public const int SW_SHOW = 6;
60  public const int SW_SHOWDEFAULT = 7;
61  public const int SW_SHOWMAXIMIZED = 8;
62  public const int SW_SHOWMINIMIZED = 9;
63  public const int SW_SHOWMINNOACTIVE = 10;
64  public const int SW_SHOWNA = 11;
65  public const int SW_SHOWNOACTIVATE = 12;
66  public const int SW_SHOWNORMAL = 13;
67  public const int VERSION = 109;
68 
69  const string AUTOITX3_DLL = @"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll";
70 
71  #endregion Fields
72 
73  #region Methods
74 
82  public static void BlockInput(int flag)
83  {
84  AU3_BlockInput(flag);
85  }
86 
99  public static int ControlClick(
100  string fpsTitle,
101  string vsText,
102  string vsControl,
103  string vsButton,
104  int viNumClicks,
105  int viX,
106  int viY)
107  {
108  return AU3_ControlClick(fpsTitle, vsText, vsControl, vsButton, viNumClicks, viX, viY);
109  }
110 
118  public static int ControlClick(string fpsTitle, string vsControl)
119  {
120  return AU3_ControlClick(fpsTitle, string.Empty, vsControl, string.Empty, 1, 0, 0);
121  }
122 
131  public static int ControlDisable(string fpsTitle, string vsText, string vsControl)
132  {
133  return AU3_ControlDisable(fpsTitle, vsText, vsControl);
134  }
135 
144  public static int ControlEnable(string fpsTitle, string vsText, string vsControl)
145  {
146  return AU3_ControlEnable(fpsTitle, vsText, vsControl);
147  }
148 
157  public static int ControlFocus(string fpsTitle, string vsText, string vsControl)
158  {
159  return AU3_ControlFocus(fpsTitle, vsText, vsControl);
160  }
161 
169  public static int ControlFocus(string fpsTitle, string vsControl)
170  {
171  return AU3_ControlFocus(fpsTitle, string.Empty, vsControl);
172  }
173 
180  public static string ControlGetHandle(string fpsTitle, string vsText, string vsControl)
181  {
182  //----------------------------------------------------------------------
183  // A number big enought to hold result, trailing bytes will be 0
184  //----------------------------------------------------------------------
185  byte[] RetText = new byte[50];
186 
187  AU3_ControlGetHandle(fpsTitle, vsText, vsControl, RetText, RetText.Length);
188 
189  //----------------------------------------------------------------------
190  // May need to convert back to a string or int
191  //----------------------------------------------------------------------
192  return Encoding.ASCII.GetString(RetText).TrimEnd('\0');
193  }
194 
203  public static Position2D ControlGetPos(string fpsTitle, string vsText, string vsControl)
204  {
205  Position2D pos;
206  pos.X = AU3_ControlGetPosX(fpsTitle, vsText, vsControl);
207  pos.Y = AU3_ControlGetPosY(fpsTitle, vsText, vsControl);
208  pos.Height = AU3_ControlGetPosHeight(fpsTitle, vsText, vsControl);
209  pos.Width = AU3_ControlGetPosWidth(fpsTitle, vsText, vsControl);
210 
211  return pos;
212  }
213 
221  public static string ControlGetText(string fpsTitle, string vsText, string vsControl)
222  {
223  //----------------------------------------------------------------------
224  // A number big enought to hold result, trailing bytes will be 0
225  //----------------------------------------------------------------------
226  byte[] byteRetText = new byte[10000];
227 
228  AU3_ControlGetText(fpsTitle, vsText, vsControl, byteRetText, byteRetText.Length);
229  AU3_Sleep(1000);
230 
231  //----------------------------------------------------------------------
232  // May need to convert back to a string or int
233  //----------------------------------------------------------------------
234  return Encoding.ASCII.GetString(byteRetText).TrimEnd('\0');
235  }
236 
245  public static int ControlHide(string fpsTitle, string vsText, string vsControl)
246  {
247  return AU3_ControlHide(fpsTitle, vsText, vsControl);
248  }
249 
260  public static int ControlMove(string fpsTitle, string vsText, string vsControl, int vsX, int vsY)
261  {
262  int height = ControlGetPos(fpsTitle, vsText, vsControl).Height;
263  int width = ControlGetPos(fpsTitle, vsText, vsControl).Width;
264  return AU3_ControlMove(fpsTitle, vsText, vsControl, vsX, vsY, height, width);
265  }
266 
279  public static int ControlMove(string fpsTitle, string vsText, string vsControl, int vsX, int vsY, int vsHeight, int vsWidth)
280  {
281  return AU3_ControlMove(fpsTitle, vsText, vsControl, vsX, vsY, vsHeight, vsWidth);
282  }
283 
299  public static int ControlSend(string fpsTitle, string vsText, string vsControl, string vsSendText, int vsMode)
300  {
301  return AU3_ControlSend(fpsTitle, vsText, vsControl, vsSendText, vsMode);
302  }
303 
312  public static int ControlShow(string fpsTitle, string vsText, string vsControl)
313  {
314  return AU3_ControlShow(fpsTitle, vsText, vsControl);
315  }
316 
325  public static int MouseClick(string vsButton, int viX, int viY)
326  {
327  return MouseClick(vsButton, viX, viY, 1, 1);
328  }
329 
336  public static int MouseClick(string vsButton)
337  {
338  int mousex = AU3_MouseGetPosX();
339  int mousey = AU3_MouseGetPosY();
340  return MouseClick(vsButton, mousex, mousey);
341  }
342 
353  public static int MouseClick(string vsButton, int viX, int viY, int viClicks, int viSpeed)
354  {
355  //----------------------------------------------------------------------
356  // MouseClick wasn't working with out first MouseMove call
357  //----------------------------------------------------------------------
358  AU3_MouseMove(viX, viY, 10);
359  return AU3_MouseClick(vsButton, viX, viY, viClicks, viSpeed);
360  }
361 
373  public static int MouseClickDrag(string vsButton, int viX1, int viY1, int viX2, int viY2, int viSpeed)
374  {
375  return AU3_MouseClickDrag(vsButton, viX1, viY1, viX2, viY2, viSpeed);
376  }
377 
384  public static void MouseDown(string vsButton)
385  {
386  AU3_MouseDown(vsButton);
387  }
388 
393  public static PointXY MouseGetPos()
394  {
395  PointXY point;
396  point.X = AU3_MouseGetPosX();
397  point.Y = AU3_MouseGetPosY();
398 
399  return point;
400  }
401 
407  public static void MouseMove(int viX, int viY)
408  {
409  MouseMove(viX, viY, 1);
410  }
411 
418  public static void MouseMove(int viX, int viY, int viSpeed)
419  {
420  AU3_MouseMove(viX, viY, viSpeed);
421  }
422 
429  public static void MouseUp(string vsButton)
430  {
431  AU3_MouseUp(vsButton);
432  }
433 
443  public static int PixelChecksum(int left, int top, int right, int bottom, int step)
444  {
447 
448  int sum = 0;
449  for (int viX = left; viX <= right; viX += step)
450  {
451  for (int viY = top; viY <= bottom; viY += step)
452  {
453  sum += AU3_PixelGetColor(viX, viY);
454  }
455  }
456 
457  return sum;
458  }
459 
468  public static int PixelChecksum(int left, int top, int right, int bottom)
469  {
470  return PixelChecksum(left, top, right, bottom, 10);
471  }
472 
479  public static int PixelGetColor(int viX, int viY)
480  {
481  return AU3_PixelGetColor(viX, viY);
482  }
483 
484  public static int PixelGetColor(int viX, int viY, IntPtr handle)
485  {
486  AU3_AutoItSetOption("PixelCoordMode", 2);
487  return 0;
488  }
489 
503  public static int[] PixelSearch(int left, int top, int right, int bottom, int color, int shade, int step)
504  {
505  // object coord = AU3_PixelSearch(left, top, right, bottom, color, shade, step);
506 
507  // Here we check to see if it found the pixel or not. It always returns a 1 in C# if it did not.
508  // if (coord.ToString() != "1")
509  // {
510  // //We have to turn "object coord" into a useable array since it contains the coordinates we need.
511  // object[] pixelCoord = (object[])coord;
512 
513  // //Now we cast the object array to integers so that we can use the data inside.
514  // return new int[] {(int)pixelCoord[0],(int)pixelCoord[1] };
515  // }
516  return null;
517  }
518 
523  public static void ProcessClose(string process)
524  {
525  AU3_ProcessClose(process);
526  }
527 
533  public static bool ProcessExists(string process)
534  {
535  return AU3_ProcessExists(process) != 0;
536  }
537 
543  public static void ProcessWait(string process, int timeout)
544  {
545  AU3_ProcessWait(process, timeout);
546  }
547 
553  public static void ProcessWaitClose(string process, int timeout)
554  {
555  AU3_ProcessWaitClose(process, timeout);
556  }
557 
562  public static void Run(string process)
563  {
564  Run(process, string.Empty);
565  }
566 
572  public static void Run(string process, string dir)
573  {
574  Run(process, dir, SW_SHOWMAXIMIZED);
575  }
576 
588  public static void Run(string process, string dir, int showflag)
589  {
590  AU3_Run(process, dir, showflag);
591  }
592 
598  public static void Send(string text)
599  {
600  Send(text, 5, 5);
601  }
602 
612  public static void Send(string text, int viSpeed)
613  {
614  Send(text, viSpeed, 5);
615  }
616 
632  public static void Send(string text, int viSpeed, int downLen)
633  {
634  SetOptions("AuXWrapper.SendKeyDelay", viSpeed);
635  SetOptions("AuXWrapper.SendKeyDownDelay", downLen);
636  Send(0, text);
637  }
638 
647  public static void Send(int viMode, string vsText)
648  {
649  AU3_Send(vsText, viMode);
650  }
651 
658  public static void Send(string vsText, string fpsTitle, string vsControl)
659  {
660  //----------------------------------------------------------------------
661  // Set control focus and then send text to that control
662  //----------------------------------------------------------------------
663  ControlFocus(fpsTitle, vsControl);
664  Send(vsText);
665  }
666 
667  public static void SendRand(string vsText, int speedMin, int speedMax)
668  {
669  Random rand = new Random();
670  for (int a = 0; a < vsText.Length; a++)
671  {
672  SetOptions("AuXWrapper.SendKeyDownDelay", rand.Next(10, 25));
673  Console.WriteLine(Convert.ToString(vsText[a]));
674  AU3_Send(vsText[a].ToString(), 0);
675  /* Bing_Bot.Macro.delay(rand.Next(speedMin, speedMax));*/
676  }
677  }
678 
682  public static void SetOptions()
683  {
684  SetOptions(true, 250);
685  }
686 
696  public static void SetOptions(string sOption, int iValue)
697  {
698  AU3_AutoItSetOption(sOption, iValue);
699  }
700 
704  public static void SetOptions(bool vbWindowTitleExactMatch, int viSendKeyDelay)
705  {
706  //----------------------------------------------------------------------
707  // WinTitleMatchMode
708  // Alters the method that is used to match window titles during search operations.
709  // 1 = Match the title from the start(default)
710  // 2 = Match any substring in the title
711  // 3 = Exact title match
712  // 4 = Advanced mode, see Window Titles & Text(Advanced)
713  // -1 to -4 = force lower case match according to other type of match.
714  //----------------------------------------------------------------------
715  if (vbWindowTitleExactMatch)
716  {
717  //----------------------------------------------------------------------
718  // Match exact title when looking for windows
719  //----------------------------------------------------------------------
720  SetOptions("WinTitleMatchMode", 1);
721  }
722  else
723  {
724  //----------------------------------------------------------------------
725  // Match any substring in the title when looking for windows
726  //----------------------------------------------------------------------
727  SetOptions("WinTitleMatchMode", 2);
728  }
729 
730  //----------------------------------------------------------------------
731  // SendKeyDelay
732  // Alters the the length of the brief pause in between sent keystrokes.
733  // Time in milliseconds to pause(default=5). Sometimes a value of 0
734  // does not work; use 1 instead.
735  //----------------------------------------------------------------------
736  SetOptions("SendKeyDelay", viSendKeyDelay);
737 
738  //----------------------------------------------------------------------
739  // WinWaitDelay
740  // Alters how long a script should briefly pause after a successful
741  // window-related operation. Time in milliseconds to pause(default=250).
742  //----------------------------------------------------------------------
743  SetOptions("WinWaitDelay", 250);
744 
745  //----------------------------------------------------------------------
746  // WinDetectHiddenText
747  // Specifies if hidden window text can be "seen" by the window matching functions.
748  // 0 = Do not detect hidden text(default)
749  // 1 = Detect hidden text
750  //----------------------------------------------------------------------
751  SetOptions("WinDetectHiddenText", 1);
752 
753  //----------------------------------------------------------------------
754  // CaretCoordMode
755  // Sets the way coords are used in the caret functions, either absolute
756  // coords or coords relative to the current active window:
757  // 0 = relative coords to the active window
758  // 1 = absolute screen coordinates(default)
759  // 2 = relative coords to the client area of the active window
760  //----------------------------------------------------------------------
761  SetOptions("CaretCoordMode", 2);
762 
763  //----------------------------------------------------------------------
764  // PixelCoordMode
765  // Sets the way coords are used in the pixel functions, either absolute
766  // coords or coords relative to the window defined by hwnd(default active window):
767  // 0 = relative coords to the defined window
768  // 1 = absolute screen coordinates(default)
769  // 2 = relative coords to the client area of the defined window
770  //----------------------------------------------------------------------
771  SetOptions("PixelCoordMode", 2);
772 
773  //----------------------------------------------------------------------
774  // MouseCoordMode
775  // Sets the way coords are used in the mouse functions, either absolute
776  // coords or coords relative to the current active window:
777  // 0 = relative coords to the active window
778  // 1 = absolute screen coordinates(default)
779  // 2 = relative coords to the client area of the active window
780  //----------------------------------------------------------------------
781  SetOptions("MouseCoordMode", 2);
782  }
783 
788  public static void Sleep(int iMilliseconds)
789  {
790  AU3_Sleep(iMilliseconds);
791  }
792 
799  public static void ToolTip(string sTip, int viX, int viY)
800  {
801  AU3_ToolTip(sTip, viX, viY);
802  }
803 
808  public static void ToolTip(string sMessage)
809  {
810  //----------------------------------------------------------------------
811  // Pad the message being displayed
812  //----------------------------------------------------------------------
813  if (!string.IsNullOrEmpty(sMessage))
814  {
815  sMessage = string.Format("\r\n {0} \r\n ", sMessage);
816  }
817 
818  //----------------------------------------------------------------------
819  // Set the tooltip to display the message
820  //----------------------------------------------------------------------
821  ToolTip(sMessage, 0, 0);
822  }
823 
828  public static void WinActivate(string fpsTitle)
829  {
830  AU3_WinActivate(fpsTitle, string.Empty);
831  }
832 
838  public static void WinActivate(string fpsTitle, int waitactivetimeout)
839  {
840  AU3_WinActivate(fpsTitle, string.Empty);
841  AU3_WinWaitActive(fpsTitle, string.Empty, waitactivetimeout);
842  System.Threading.Thread.Sleep(1000);
843  }
844 
850  public static void WinActivate(string fpsTitle, string vsText)
851  {
852  AU3_WinActivate(fpsTitle, vsText);
853  }
854 
863  public static int WinExists(string fpsTitle)
864  {
865  return AU3_WinExists(fpsTitle, string.Empty);
866  }
867 
877  public static int WinExists(string fpsTitle, string vsText)
878  {
879  return AU3_WinExists(fpsTitle, vsText);
880  }
881 
887  public static string WinGetHandle(string fpsTitle)
888  {
889  // ----------------------------------------------------------------------
890  // A number big enought to hold result, trailing bytes will be 0
891  // ----------------------------------------------------------------------
892  byte[] RetText = new byte[50];
893 
894  AU3_WinGetHandle(fpsTitle, string.Empty, RetText, RetText.Length);
895 
896  //----------------------------------------------------------------------
897  // May need to convert back to a string or int
898  //----------------------------------------------------------------------
899  return Encoding.ASCII.GetString(RetText).TrimEnd('\0');
900  }
901 
908  public static string WinGetText(string fpsTitle, string vsText)
909  {
910  //----------------------------------------------------------------------
911  // A number big enought to hold result, trailing bytes will be 0
912  //----------------------------------------------------------------------
913  byte[] byteRetText = new byte[10000];
914 
915  AU3_WinGetText(fpsTitle, vsText, byteRetText, byteRetText.Length);
916 
917  // ----------------------------------------------------------------------
918  // May need to convert back to a string or int
919  // ----------------------------------------------------------------------
920  return Encoding.ASCII.GetString(byteRetText).TrimEnd('\0');
921  }
922 
928  public static string WinGetText(string fpsTitle)
929  {
930  return WinGetText(fpsTitle, string.Empty);
931  }
932 
939  public static void WinMove(string fpsTitle, int viX, int viY)
940  {
941  int xLen = AU3_WinGetPosWidth(fpsTitle, string.Empty);
942  int yLen = AU3_WinGetPosHeight(fpsTitle, string.Empty);
943  WinMove(fpsTitle, viX, viY, xLen, yLen);
944  }
945 
954  public static void WinMove(string fpsTitle, int viX, int viY, int viWidth, int viHeight)
955  {
956  AU3_WinMove(fpsTitle, string.Empty, viX, viY, viWidth, viHeight);
957  }
958 
964  public static int WinWait(string fpsTitle)
965  {
966  return AU3_WinWait(fpsTitle, string.Empty, 3000);
967  }
968 
979  public static int WinWaitActive(string fpsTitle, string vsText, int iTimeout)
980  {
981  return AU3_WinWaitActive(fpsTitle, vsText, iTimeout);
982  }
983 
993  public static int WinWaitActive(string fpsTitle, int iTimeout)
994  {
995  return AU3_WinWaitActive(fpsTitle, string.Empty, iTimeout);
996  }
997 
1006  public static int WinWaitActive(string fpsTitle)
1007  {
1008  return AU3_WinWaitActive(fpsTitle, string.Empty, 3000);
1009  }
1010 
1016  public static void WinWaitActiveWindow(string fpsTitle)
1017  {
1018  // ----------------------------------------------------------------------
1019  // Wait for the window
1020  // ----------------------------------------------------------------------
1021  WinWait(fpsTitle);
1022 
1023  // ----------------------------------------------------------------------
1024  // Set the window as the active window
1025  // ----------------------------------------------------------------------
1026  WinActivate(fpsTitle);
1027 
1028  // ----------------------------------------------------------------------
1029  // Wait until the window is active, then proceed
1030  // ----------------------------------------------------------------------
1031  WinWaitActive(fpsTitle);
1032  }
1033 
1034  public Position2D WinGetPos(string fpsTitle, string vsText)
1035  {
1036  Position2D pos;
1037  pos.X = AU3_WinGetPosX(fpsTitle, vsText);
1038  pos.Y = AU3_WinGetPosY(fpsTitle, vsText);
1039  pos.Height = AU3_WinGetPosHeight(fpsTitle, vsText);
1040  pos.Width = AU3_WinGetPosWidth(fpsTitle, vsText);
1041  return pos;
1042  }
1043 
1044  // AU3_API long WINAPI AU3_AutoItSetOption(const char *szOption, long nValue);
1045  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1046  private static extern int AU3_AutoItSetOption([MarshalAs(UnmanagedType.LPStr)] string Option, int Value);
1047 
1048  // AU3_API void WINAPI AU3_BlockInput(long nFlag);
1049  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1050  private static extern void AU3_BlockInput(int Flag);
1051 
1052  // AU3_API long WINAPI AU3_CDTray(const char *szDrive, const char *szAction);
1053  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1054  private static extern int AU3_CDTray(
1055  [MarshalAs(UnmanagedType.LPStr)] string Drive,
1056  [MarshalAs(UnmanagedType.LPStr)] string Action);
1057 
1058  // AU3_API void WINAPI AU3_ClipGet(char *szClip, int nBufSize);
1059  // Use like this:
1060  // byte[] returnclip = new byte[200]; //any sufficiently long lenght will do
1061  // AU3_ClipGet(returnclip, returnclip.Length);
1062  // clipdata = new ASCIIEncoding().GetString(returnclip);
1063  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1064  private static extern void AU3_ClipGet(byte[] Clip, int BufSize);
1065 
1066  // AU3_API void WINAPI AU3_ClipPut(const char *szClip);
1067  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1068  private static extern void AU3_ClipPut([MarshalAs(UnmanagedType.LPStr)] string Clip);
1069 
1070  // AU3_API long WINAPI AU3_ControlClick(const char *szTitle, const char *szText, const char *szControl, const char *szButton, long nNumClicks, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nX, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nY);
1071  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1072  private static extern int AU3_ControlClick(
1073  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1074  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1075  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1076  [MarshalAs(UnmanagedType.LPStr)] string Button,
1077  int NumClicks,
1078  int X,
1079  int Y);
1080 
1081  // AU3_API void WINAPI AU3_ControlCommand(const char *szTitle, const char *szText, const char *szControl, const char *szCommand, const char *szExtra, char *szResult, int nBufSize);
1082  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1083  private static extern void AU3_ControlCommand(
1084  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1085  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1086  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1087  [MarshalAs(UnmanagedType.LPStr)] string Command,
1088  [MarshalAs(UnmanagedType.LPStr)] string Extra,
1089  [MarshalAs(UnmanagedType.LPStr)] byte[] Result,
1090  int BufSize);
1091 
1092  // AU3_API long WINAPI AU3_ControlDisable(const char *szTitle, const char *szText, const char *szControl);
1093  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1094  private static extern int AU3_ControlDisable(
1095  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1096  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1097  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1098 
1099  // AU3_API long WINAPI AU3_ControlEnable(const char *szTitle, const char *szText, const char *szControl);
1100  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1101  private static extern int AU3_ControlEnable(
1102  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1103  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1104  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1105 
1106  // AU3_API long WINAPI AU3_ControlFocus(const char *szTitle, const char *szText, const char *szControl);
1107  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1108  private static extern int AU3_ControlFocus(
1109  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1110  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1111  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1112 
1113  // AU3_API void WINAPI AU3_ControlGetFocus(const char *szTitle, const char *szText, char *szControlWithFocus, int nBufSize);
1114  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1115  private static extern void AU3_ControlGetFocus(
1116  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1117  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1118  byte[] ControlWithFocus,
1119  int BufSize);
1120 
1121  // AU3_API void WINAPI AU3_ControlGetHandle(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, const char *szControl, char *szRetText, int nBufSize);
1122  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1123  private static extern void AU3_ControlGetHandle(
1124  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1125  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1126  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1127  byte[] RetText,
1128  int BufSize);
1129 
1130  // AU3_API long WINAPI AU3_ControlGetPosHeight(const char *szTitle, const char *szText, const char *szControl);
1131  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1132  private static extern int AU3_ControlGetPosHeight(
1133  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1134  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1135  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1136 
1137  // AU3_API long WINAPI AU3_ControlGetPosWidth(const char *szTitle, const char *szText, const char *szControl);
1138  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1139  private static extern int AU3_ControlGetPosWidth(
1140  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1141  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1142  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1143 
1144  // AU3_API long WINAPI AU3_ControlGetPosX(const char *szTitle, const char *szText, const char *szControl);
1145  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1146  private static extern int AU3_ControlGetPosX(
1147  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1148  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1149  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1150 
1151  // AU3_API long WINAPI AU3_ControlGetPosY(const char *szTitle, const char *szText, const char *szControl);
1152  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1153  private static extern int AU3_ControlGetPosY(
1154  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1155  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1156  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1157 
1158  // AU3_API void WINAPI AU3_ControlGetText(const char *szTitle, const char *szText, const char *szControl, char *szControlText, int nBufSize);
1159  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1160  private static extern void AU3_ControlGetText(
1161  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1162  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1163  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1164  byte[] ControlText,
1165  int BufSize);
1166 
1167  // AU3_API long WINAPI AU3_ControlHide(const char *szTitle, const char *szText, const char *szControl);
1168  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1169  private static extern int AU3_ControlHide(
1170  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1171  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1172  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1173 
1174  // AU3_API void WINAPI AU3_ControlListView(const char *szTitle, const char *szText, const char *szControl, const char *szCommand, const char *szExtra1, const char *szExtra2, char *szResult, int nBufSize);
1175  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1176  private static extern void AU3_ControlListView(
1177  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1178  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1179  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1180  [MarshalAs(UnmanagedType.LPStr)] string Command,
1181  [MarshalAs(UnmanagedType.LPStr)] string Extral1,
1182  [MarshalAs(UnmanagedType.LPStr)] string Extra2,
1183  byte[] Result,
1184  int BufSize);
1185 
1186  // AU3_API long WINAPI AU3_ControlMove(const char *szTitle, const char *szText, const char *szControl, long nX, long nY, /*[in,defaultvalue(-1)]*/long nWidth, /*[in,defaultvalue(-1)]*/long nHeight);
1187  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1188  private static extern int AU3_ControlMove(
1189  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1190  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1191  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1192  int X,
1193  int Y,
1194  int Width,
1195  int Height);
1196 
1197  // AU3_API long WINAPI AU3_ControlSend(const char *szTitle, const char *szText, const char *szControl, const char *szSendText, /*[in,defaultvalue(0)]*/long nMode);
1198  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1199  private static extern int AU3_ControlSend(
1200  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1201  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1202  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1203  [MarshalAs(UnmanagedType.LPStr)] string SendText,
1204  int Mode);
1205 
1206  // AU3_API long WINAPI AU3_ControlSetText(const char *szTitle, const char *szText, const char *szControl, const char *szControlText);
1207  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1208  private static extern int AU3_ControlSetText(
1209  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1210  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1211  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1212  [MarshalAs(UnmanagedType.LPStr)] string fpsControlText);
1213 
1214  // AU3_API long WINAPI AU3_ControlShow(const char *szTitle, const char *szText, const char *szControl);
1215  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1216  private static extern int AU3_ControlShow(
1217  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1218  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1219  [MarshalAs(UnmanagedType.LPStr)] string fpsControl);
1220 
1221  // AU3_API void WINAPI AU3_ControlTreeView(const char *szTitle, const char *szText, const char *szControl, const char *szCommand, const char *szExtra1, const char *szExtra2, char *szResult, int nBufSize);
1222  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1223  private static extern void AU3_ControlTreeView(
1224  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1225  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1226  [MarshalAs(UnmanagedType.LPStr)] string fpsControl,
1227  [MarshalAs(UnmanagedType.LPStr)] string Command,
1228  [MarshalAs(UnmanagedType.LPStr)] string Extra1,
1229  [MarshalAs(UnmanagedType.LPStr)] string Extra2,
1230  byte[] Result,
1231  int BufSize);
1232 
1233  // AU3_API void WINAPI AU3_DriveMapAdd(const char *szDevice, const char *szShare, long nFlags, /*[in,defaultvalue("")]*/const char *szUser, /*[in,defaultvalue("")]*/const char *szPwd, char *szResult, int nBufSize);
1234  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1235  private static extern void AU3_DriveMapAdd(
1236  [MarshalAs(UnmanagedType.LPStr)] string Device,
1237  [MarshalAs(UnmanagedType.LPStr)] string Share,
1238  int Flags,
1239  [MarshalAs(UnmanagedType.LPStr)] string User,
1240  [MarshalAs(UnmanagedType.LPStr)] string Pwd,
1241  byte[] Result,
1242  int BufSize);
1243 
1244  // AU3_API long WINAPI AU3_DriveMapDel(const char *szDevice);
1245  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1246  private static extern int AU3_DriveMapDel([MarshalAs(UnmanagedType.LPStr)] string Device);
1247 
1248  // AU3_API void WINAPI AU3_DriveMapGet(const char *szDevice, char *szMapping, int nBufSize);
1249  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1250  private static extern void AU3_DriveMapDel(
1251  [MarshalAs(UnmanagedType.LPStr)] string Device,
1252  byte[] Mapping,
1253  int BufSize);
1254 
1255  // AU3_API long AU3_error(void);
1256  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1257  private static extern int AU3_error();
1258 
1259  // AU3_API long WINAPI AU3_IniDelete(const char *szFilename, const char *szSection, const char *szKey);
1260  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1261  private static extern int AU3_IniDelete(
1262  [MarshalAs(UnmanagedType.LPStr)] string Filename,
1263  [MarshalAs(UnmanagedType.LPStr)] string Section,
1264  [MarshalAs(UnmanagedType.LPStr)] string Key);
1265 
1266  // AU3_API void WINAPI AU3_IniRead(const char *szFilename, const char *szSection, const char *szKey, const char *szDefault, char *szValue, int nBufSize);
1267  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1268  private static extern int AU3_IniRead(
1269  [MarshalAs(UnmanagedType.LPStr)] string Filename,
1270  [MarshalAs(UnmanagedType.LPStr)] string Section,
1271  [MarshalAs(UnmanagedType.LPStr)] string Key,
1272  [MarshalAs(UnmanagedType.LPStr)] string Default,
1273  byte[] Value,
1274  int BufSize);
1275 
1276  // AU3_API void WINAPI AU3_Init(void);
1277  // Uncertain if this is needed
1278  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1279  private static extern void AU3_Init();
1280 
1281  // AU3_API long WINAPI AU3_IniWrite(const char *szFilename, const char *szSection, const char *szKey, const char *szValue);
1282  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1283  private static extern int AU3_IniWrite(
1284  [MarshalAs(UnmanagedType.LPStr)] string Filename,
1285  [MarshalAs(UnmanagedType.LPStr)] string Section,
1286  [MarshalAs(UnmanagedType.LPStr)] string Key,
1287  [MarshalAs(UnmanagedType.LPStr)] string Value);
1288 
1289  // AU3_API long WINAPI AU3_IsAdmin(void);
1290  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1291  private static extern int AU3_IsAdmin();
1292 
1293  // AU3_API long WINAPI AU3_MouseClick(/*[in,defaultvalue("LEFT")]*/const char *szButton, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nX, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nY, /*[in,defaultvalue(1)]*/long nClicks, /*[in,defaultvalue(-1)]*/long nSpeed);
1294  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1295  private static extern int AU3_MouseClick(
1296  [MarshalAs(UnmanagedType.LPStr)] string Button,
1297  int x,
1298  int y,
1299  int clicks,
1300  int speed);
1301 
1302  // AU3_API long WINAPI AU3_MouseClickDrag(const char *szButton, long nX1, long nY1, long nX2, long nY2, /*[in,defaultvalue(-1)]*/long nSpeed);
1303  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1304  private static extern int AU3_MouseClickDrag(
1305  [MarshalAs(UnmanagedType.LPStr)] string Button,
1306  int X1,
1307  int Y1,
1308  int X2,
1309  int Y2,
1310  int Speed);
1311 
1312  // AU3_API void WINAPI AU3_MouseDown(/*[in,defaultvalue("LEFT")]*/const char *szButton);
1313  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1314  private static extern void AU3_MouseDown([MarshalAs(UnmanagedType.LPStr)] string Button);
1315 
1316  // AU3_API long WINAPI AU3_MouseGetCursor(void);
1317  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1318  private static extern int AU3_MouseGetCursor();
1319 
1320  // AU3_API long WINAPI AU3_MouseGetPosX(void);
1321  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1322  private static extern int AU3_MouseGetPosX();
1323 
1324  // AU3_API long WINAPI AU3_MouseGetPosY(void);
1325  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1326  private static extern int AU3_MouseGetPosY();
1327 
1328  // AU3_API long WINAPI AU3_MouseMove(long nX, long nY, /*[in,defaultvalue(-1)]*/long nSpeed);
1329  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1330  private static extern int AU3_MouseMove(int X, int Y, int Speed);
1331 
1332  // AU3_API void WINAPI AU3_MouseUp(/*[in,defaultvalue("LEFT")]*/const char *szButton);
1333  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1334  private static extern void AU3_MouseUp([MarshalAs(UnmanagedType.LPStr)] string Button);
1335 
1336  // AU3_API void WINAPI AU3_MouseWheel(const char *szDirection, long nClicks);
1337  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1338  private static extern void AU3_MouseWheel([MarshalAs(UnmanagedType.LPStr)] string Direction, int Clicks);
1339 
1340  // AU3_API long WINAPI AU3_Opt(const char *szOption, long nValue);
1341  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1342  private static extern int AU3_Opt([MarshalAs(UnmanagedType.LPStr)] string Option, int Value);
1343 
1344  // AU3_API long WINAPI AU3_PixelChecksum(long nLeft, long nTop, long nRight, long nBottom, /*[in,defaultvalue(1)]*/long nStep);
1345  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1346  private static extern int AU3_PixelChecksum(int Left, int Top, int Right, int Bottom, int Step);
1347 
1348  // AU3_API long WINAPI AU3_PixelGetColor(long nX, long nY);
1349  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1350  private static extern int AU3_PixelGetColor(int X, int Y);
1351 
1352  // AU3_API void WINAPI AU3_PixelSearch(long nLeft, long nTop, long nRight, long nBottom, long nCol, /*default 0*/long nVar, /*default 1*/long nStep, LPPOINT pPointResult);
1353  // Use like this:
1354  // int[] result = {0,0};
1355  // try
1356  // {
1357  // AU3_PixelSearch(0, 0, 800, 000,0xFFFFFF, 0, 1, result);
1358  // }
1359  // catch { }
1360  // It will crash if the color is not found, have not be able to determin why
1361  // The AutoItX3Lib.AutoItX3Class version has similar problems and is the only function to return an object
1362  // so contortions are needed to get the data from it ie:
1363  // int[] result = {0,0};
1364  // object resultObj;
1365  // AutoItX3Lib.AutoItX3Class autoit = new AutoItX3Lib.AutoItX3Class();
1366  // resultObj = autoit.PixelSearch(0, 0, 800, 600, 0xFFFF00,0,1);
1367  // Type t = resultObj.GetType();
1368  // if (t == typeof(object[]))
1369  // {
1370  // object[] obj = (object[])resultObj;
1371  // result[0] = (int)obj[0];
1372  // result[1] = (int)obj[1];
1373  // }
1374  // When it fails it returns an object = 1 but when it succeeds it is object[X,Y]
1375  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1376  private static extern void AU3_PixelSearch(
1377  int Left,
1378  int Top,
1379  int Right,
1380  int Bottom,
1381  int Col,
1382  int Var,
1383  int Step,
1384  int[] PointResult);
1385 
1386  // AU3_API long WINAPI AU3_ProcessClose(const char *szProcess);
1387  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1388  private static extern int AU3_ProcessClose([MarshalAs(UnmanagedType.LPStr)] string Process);
1389 
1390  // AU3_API long WINAPI AU3_ProcessExists(const char *szProcess);
1391  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1392  private static extern int AU3_ProcessExists([MarshalAs(UnmanagedType.LPStr)] string Process);
1393 
1394  // AU3_API long WINAPI AU3_ProcessSetPriority(const char *szProcess, long nPriority);
1395  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1396  private static extern int AU3_ProcessSetPriority(
1397  [MarshalAs(UnmanagedType.LPStr)] string Process,
1398  int Priority);
1399 
1400  // AU3_API long WINAPI AU3_ProcessWait(const char *szProcess, /*[in,defaultvalue(0)]*/long nTimeout);
1401  // Not checked jde
1402  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1403  private static extern int AU3_ProcessWait(
1404  [MarshalAs(UnmanagedType.LPStr)] string Process,
1405  int Timeout);
1406 
1407  // AU3_API long WINAPI AU3_ProcessWaitClose(const char *szProcess, /*[in,defaultvalue(0)]*/long nTimeout);
1408  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1409  private static extern int AU3_ProcessWaitClose(
1410  [MarshalAs(UnmanagedType.LPStr)] string Process,
1411  int Timeout);
1412 
1413  // AU3_API long WINAPI AU3_RegDeleteKey(const char *szKeyname);
1414  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1415  private static extern int AU3_RegDeleteKey([MarshalAs(UnmanagedType.LPStr)] string fpsKeyname);
1416 
1417  // AU3_API long WINAPI AU3_RegDeleteVal(const char *szKeyname, const char *szValuename);
1418  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1419  private static extern int AU3_RegDeleteVal(
1420  [MarshalAs(UnmanagedType.LPStr)] string fpsKeyname,
1421  [MarshalAs(UnmanagedType.LPStr)] string ValueName);
1422 
1423  // AU3_API void WINAPI AU3_RegEnumKey(const char *szKeyname, long nInstance, char *szResult, int nBufSize);
1424  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1425  private static extern void AU3_RegEnumKey(
1426  [MarshalAs(UnmanagedType.LPStr)] string fpsKeyname,
1427  int Instance,
1428  byte[] Result,
1429  int BusSize);
1430 
1431  // AU3_API void WINAPI AU3_RegEnumVal(const char *szKeyname, long nInstance, char *szResult, int nBufSize);
1432  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1433  private static extern void AU3_RegEnumVal(
1434  [MarshalAs(UnmanagedType.LPStr)] string fpsKeyname,
1435  int Instance,
1436  byte[] Result,
1437  int BufSize);
1438 
1439  // AU3_API void WINAPI AU3_RegRead(const char *szKeyname, const char *szValuename, char *szRetText, int nBufSize);
1440  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1441  private static extern void AU3_RegRead(
1442  [MarshalAs(UnmanagedType.LPStr)] string fpsKeyname,
1443  [MarshalAs(UnmanagedType.LPStr)] string Valuename,
1444  byte[] RetText,
1445  int BufSize);
1446 
1447  // AU3_API long WINAPI AU3_RegWrite(const char *szKeyname, const char *szValuename, const char *szType, const char *szValue);
1448  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1449  private static extern int AU3_RegWrite(
1450  [MarshalAs(UnmanagedType.LPStr)] string fpsKeyname,
1451  [MarshalAs(UnmanagedType.LPStr)] string Valuename,
1452  [MarshalAs(UnmanagedType.LPStr)] string Type,
1453  [MarshalAs(UnmanagedType.LPStr)] string Value);
1454 
1455  // AU3_API long WINAPI AU3_Run(const char *szRun, /*[in,defaultvalue("")]*/const char *szDir, /*[in,defaultvalue(1)]*/long nShowFlags);
1456  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1457  private static extern int AU3_Run(
1458  [MarshalAs(UnmanagedType.LPStr)] string Run,
1459  [MarshalAs(UnmanagedType.LPStr)] string Dir,
1460  int ShowFlags);
1461 
1462  // AU3_API long WINAPI AU3_RunAsSet(const char *szUser, const char *szDomain, const char *szPassword, int nOptions);
1463  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1464  private static extern int AU3_RunAsSet(
1465  [MarshalAs(UnmanagedType.LPStr)] string User,
1466  [MarshalAs(UnmanagedType.LPStr)] string Domain,
1467  [MarshalAs(UnmanagedType.LPStr)] string Password,
1468  int Options);
1469 
1470  // AU3_API long WINAPI AU3_RunWait(const char *szRun, /*[in,defaultvalue("")]*/const char *szDir, /*[in,defaultvalue(1)]*/long nShowFlags);
1471  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1472  private static extern int AU3_RunWait(
1473  [MarshalAs(UnmanagedType.LPStr)]string Run,
1474  [MarshalAs(UnmanagedType.LPStr)]string Dir,
1475  int ShowFlags);
1476 
1477  // AU3_API void WINAPI AU3_Send(const char *szSendText, /*[in,defaultvalue(0)]*/long nMode);
1478  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1479  private static extern void AU3_Send([MarshalAs(UnmanagedType.LPStr)] string SendText, int Mode);
1480 
1481  // AU3_API long WINAPI AU3_Shutdown(long nFlags);
1482  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1483  private static extern int AU3_Shutdown(int Flags);
1484 
1485  // AU3_API void WINAPI AU3_Sleep(long nMilliseconds);
1486  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1487  private static extern void AU3_Sleep(int Milliseconds);
1488 
1489  // AU3_API void WINAPI AU3_StatusbarGetText(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, /*[in,defaultvalue(1)]*/long nPart, char *szStatusText, int nBufSize);
1490  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1491  private static extern void AU3_StatusbarGetText(
1492  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1493  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1494  int Part,
1495  byte[] StatusText,
1496  int BufSize);
1497 
1498  // AU3_API void WINAPI AU3_ToolTip(const char *szTip, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nX, /*[in,defaultvalue(AU3_INTDEFAULT)]*/long nY);
1499  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1500  private static extern void AU3_ToolTip([MarshalAs(UnmanagedType.LPStr)]string Tip, int X, int Y);
1501 
1502  // AU3_API void WINAPI AU3_WinActivate(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1503  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1504  private static extern void AU3_WinActivate(
1505  [MarshalAs(UnmanagedType.LPStr)]string fpsTitle,
1506  [MarshalAs(UnmanagedType.LPStr)]string fpsText);
1507 
1508  // AU3_API long WINAPI AU3_WinActive(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1509  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1510  private static extern int AU3_WinActive(
1511  [MarshalAs(UnmanagedType.LPStr)]string fpsTitle,
1512  [MarshalAs(UnmanagedType.LPStr)]string fpsText);
1513 
1514  // AU3_API long WINAPI AU3_WinClose(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1515  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1516  private static extern int AU3_WinClose(
1517  [MarshalAs(UnmanagedType.LPStr)]string fpsTitle,
1518  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1519 
1520  // AU3_API long WINAPI AU3_WinExists(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1521  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1522  private static extern int AU3_WinExists(
1523  [MarshalAs(UnmanagedType.LPStr)]string fpsTitle,
1524  [MarshalAs(UnmanagedType.LPStr)]string fpsText);
1525 
1526  // AU3_API long WINAPI AU3_WinGetCaretPosX(void);
1527  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1528  private static extern int AU3_WinGetCaretPosX();
1529 
1530  // AU3_API long WINAPI AU3_WinGetCaretPosY(void);
1531  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1532  private static extern int AU3_WinGetCaretPosY();
1533 
1534  // AU3_API void WINAPI AU3_WinGetClassList(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, char *szRetText, int nBufSize);
1535  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1536  private static extern void AU3_WinGetClassList(
1537  [MarshalAs(UnmanagedType.LPStr)]string fpsTitle,
1538  [MarshalAs(UnmanagedType.LPStr)]string fpsText,
1539  byte[] RetText,
1540  int BufSize);
1541 
1542  // AU3_API long WINAPI AU3_WinGetClientSizeHeight(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1543  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1544  private static extern int AU3_WinGetClientSizeHeight(
1545  [MarshalAs(UnmanagedType.LPStr)]string fpsTitle,
1546  [MarshalAs(UnmanagedType.LPStr)]string fpsText);
1547 
1548  // AU3_API long WINAPI AU3_WinGetClientSizeWidth(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1549  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1550  private static extern int AU3_WinGetClientSizeWidth(
1551  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1552  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1553 
1554  // AU3_API void WINAPI AU3_WinGetHandle(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, char *szRetText, int nBufSize);
1555  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1556  private static extern void AU3_WinGetHandle(
1557  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1558  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1559  byte[] RetText,
1560  int BufSize);
1561 
1562  // AU3_API long WINAPI AU3_WinGetPosHeight(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1563  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1564  private static extern int AU3_WinGetPosHeight(
1565  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1566  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1567 
1568  // AU3_API long WINAPI AU3_WinGetPosWidth(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1569  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1570  private static extern int AU3_WinGetPosWidth(
1571  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1572  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1573 
1574  // AU3_API long WINAPI AU3_WinGetPosX(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1575  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1576  private static extern int AU3_WinGetPosX(
1577  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1578  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1579 
1580  // AU3_API long WINAPI AU3_WinGetPosY(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1581  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1582  private static extern int AU3_WinGetPosY(
1583  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1584  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1585 
1586  // AU3_API void WINAPI AU3_WinGetProcess(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, char *szRetText, int nBufSize);
1587  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1588  private static extern void AU3_WinGetProcess(
1589  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1590  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1591  byte[] RetText,
1592  int BufSize);
1593 
1594  // AU3_API long WINAPI AU3_WinGetState(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1595  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1596  private static extern int AU3_WinGetState(
1597  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1598  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1599 
1600  // AU3_API void WINAPI AU3_WinGetText(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, char *szRetText, int nBufSize);
1601  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1602  private static extern void AU3_WinGetText(
1603  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1604  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1605  byte[] RetText,
1606  int BufSize);
1607 
1608  // AU3_API void WINAPI AU3_WinGetTitle(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, char *szRetText, int nBufSize);
1609  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1610  private static extern void AU3_WinGetTitle(
1611  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1612  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1613  byte[] RetText,
1614  int BufSize);
1615 
1616  // AU3_API long WINAPI AU3_WinKill(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText);
1617  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1618  private static extern int AU3_WinKill(
1619  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1620  [MarshalAs(UnmanagedType.LPStr)] string fpsText);
1621 
1622  // AU3_API long WINAPI AU3_WinMenuSelectItem(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, const char *szItem1, const char *szItem2, const char *szItem3, const char *szItem4, const char *szItem5, const char *szItem6, const char *szItem7, const char *szItem8);
1623  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1624  private static extern int AU3_WinMenuSelectItem(
1625  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1626  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1627  [MarshalAs(UnmanagedType.LPStr)] string Item1,
1628  [MarshalAs(UnmanagedType.LPStr)] string Item2,
1629  [MarshalAs(UnmanagedType.LPStr)] string Item3,
1630  [MarshalAs(UnmanagedType.LPStr)] string Item4,
1631  [MarshalAs(UnmanagedType.LPStr)] string Item5,
1632  [MarshalAs(UnmanagedType.LPStr)] string Item6,
1633  [MarshalAs(UnmanagedType.LPStr)] string Item7,
1634  [MarshalAs(UnmanagedType.LPStr)] string Item8);
1635 
1636  // AU3_API void WINAPI AU3_WinMinimizeAll();
1637  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1638  private static extern void AU3_WinMinimizeAll();
1639 
1640  // AU3_API void WINAPI AU3_WinMinimizeAllUndo();
1641  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1642  private static extern void AU3_WinMinimizeAllUndo();
1643 
1644  // AU3_API long WINAPI AU3_WinMove(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, long nX, long nY, /*[in,defaultvalue(-1)]*/long nWidth, /*[in,defaultvalue(-1)]*/long nHeight);
1645  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1646  private static extern int AU3_WinMove(
1647  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1648  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1649  int fpiX,
1650  int fpiY,
1651  int fpiWidth,
1652  int fpiHeight);
1653 
1654  // AU3_API long WINAPI AU3_WinSetOnTop(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, long nFlag);
1655  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1656  private static extern int AU3_WinMove(
1657  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1658  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1659  int Flags);
1660 
1661  // AU3_API long WINAPI AU3_WinSetState(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, long nFlags);
1662  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1663  private static extern int AU3_WinSetState(
1664  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1665  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1666  int Flags);
1667 
1668  // AU3_API long WINAPI AU3_WinSetTitle(const char *szTitle,/*[in,defaultvalue("")]*/ const char *szText, const char *szNewTitle);
1669  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1670  private static extern int AU3_WinSetTitle(
1671  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1672  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1673  [MarshalAs(UnmanagedType.LPStr)] string NewTitle);
1674 
1675  // AU3_API long WINAPI AU3_WinSetTrans(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, long nTrans);
1676  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1677  private static extern int AU3_WinSetTrans(
1678  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1679  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1680  int Trans);
1681 
1682  // AU3_API long WINAPI AU3_WinWait(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, /*[in,defaultvalue(0)]*/long nTimeout);
1683  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1684  private static extern int AU3_WinWait(
1685  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1686  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1687  int Timeout);
1688 
1689  // AU3_API long WINAPI AU3_WinWaitActive(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, /*[in,defaultvalue(0)]*/long nTimeout);
1690  [DllImport(@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError = true, CharSet = CharSet.Auto)]
1691  private static extern int AU3_WinWaitActive(
1692  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1693  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1694  int Timeout);
1695 
1696  // AU3_API long WINAPI AU3_WinWaitClose(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, /*[in,defaultvalue(0)]*/long nTimeout);
1697  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1698  private static extern int AU3_WinWaitClose(
1699  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1700  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1701  int fpiTimeout);
1702 
1703  // AU3_API long WINAPI AU3_WinWaitNotActive(const char *szTitle, /*[in,defaultvalue("")]*/const char *szText, /*[in,defaultvalue(0)]*/long nTimeout);
1704  [DllImport(AUTOITX3_DLL, SetLastError = true, CharSet = CharSet.Auto)]
1705  private static extern int AU3_WinWaitNotActive(
1706  [MarshalAs(UnmanagedType.LPStr)] string fpsTitle,
1707  [MarshalAs(UnmanagedType.LPStr)] string fpsText,
1708  int Timeout);
1709 
1710  #endregion Methods
1711 
1712  #region Nested Types
1713 
1714  public struct PointXY
1715  {
1716  #region Fields
1717 
1718  public int X;
1719  public int Y;
1720 
1721  #endregion Fields
1722  }
1723 
1724  // These are used in a few functions to return multiple values(GetWinPos, MouseGetPos)
1725  public struct Position2D
1726  {
1727  #region Fields
1728 
1729  public int Height;
1730  public int Width;
1731  public int X;
1732  public int Y;
1733 
1734  #endregion Fields
1735  }
1736 
1737  #endregion Nested Types
1738 
1739  #region Other
1740 
1741  //----------------------------------------------------------------------
1742  // From memory optional parameters are not supported in DotNet so fill in all fields even if just "".
1743  // Be prepared to play around a bit with which fields need values and what those value are.
1744  //
1745  // The big advantage of using AutoItX3 like this is that you don't have to register
1746  // the dll with windows and more importantly you get away from the many issues involved in
1747  // publishing the application and the binding to the dll required.
1748  //
1749  // Get definitions by using "DLL Export Viewer" utility to get Properties Definitions
1750  // "DLL Export Viewer" is from http://www.nirsoft.net
1751  //----------------------------------------------------------------------
1752  #endregion Other
1753  }
1754 }
static int WinWaitActive(string fpsTitle, string vsText, int iTimeout)
Pauses execution of the script until the requested window is active.
Definition: AUI.cs:979
static int WinExists(string fpsTitle, string vsText)
Checks to see if a specified window exists.
Definition: AUI.cs:877
static PointXY MouseGetPos()
Retrieves the current position of the mouse cursor.
Definition: AUI.cs:393
static void ProcessWait(string process, int timeout)
Pauses script execution until a given process exists.
Definition: AUI.cs:543
static int ControlShow(string fpsTitle, string vsText, string vsControl)
Shows a control that was hidden.
Definition: AUI.cs:312
static void Run(string process, string dir, int showflag)
Runs an external program.
Definition: AUI.cs:588
static int ControlMove(string fpsTitle, string vsText, string vsControl, int vsX, int vsY, int vsHeight, int vsWidth)
Moves a control within a window.
Definition: AUI.cs:279
static int ControlClick(string fpsTitle, string vsText, string vsControl, string vsButton, int viNumClicks, int viX, int viY)
Sends a mouse click command to a given control.
Definition: AUI.cs:99
static void ProcessClose(string process)
Terminates a named process.
Definition: AUI.cs:523
static string WinGetText(string fpsTitle, string vsText)
Retrieves the text from a window.
Definition: AUI.cs:908
static int WinExists(string fpsTitle)
Checks to see if a specified window exists.
Definition: AUI.cs:863
static void Sleep(int iMilliseconds)
Pause script execution.
Definition: AUI.cs:788
static void ToolTip(string sMessage)
Creates a padded tooltip in the top-left part of the screen.
Definition: AUI.cs:808
static int PixelChecksum(int left, int top, int right, int bottom, int step)
Generates a checksum for a region of pixels.
Definition: AUI.cs:443
static int MouseClick(string vsButton, int viX, int viY)
Perform a mouse click operation.
Definition: AUI.cs:325
static string ControlGetText(string fpsTitle, string vsText, string vsControl)
Retrieves the text from a window.
Definition: AUI.cs:221
static int PixelGetColor(int viX, int viY)
Returns a pixel color according to x,y pixel coordinates.
Definition: AUI.cs:479
static string WinGetText(string fpsTitle)
Retrieves the text from a window.
Definition: AUI.cs:928
static void MouseUp(string vsButton)
Perform a mouse up event at the current mouse position.
Definition: AUI.cs:429
static int WinWaitActive(string fpsTitle)
Pauses execution of the script until the requested window is active.
Definition: AUI.cs:1006
static Position2D ControlGetPos(string fpsTitle, string vsText, string vsControl)
Retrieves the position and size of a control relative to it's window.
Definition: AUI.cs:203
static void Run(string process, string dir)
Runs an external program.
Definition: AUI.cs:572
static void MouseDown(string vsButton)
Perform a mouse down event at the current mouse position.
Definition: AUI.cs:384
static void Send(string text)
Sends simulated keystrokes to the active window.
Definition: AUI.cs:598
static string ControlGetHandle(string fpsTitle, string vsText, string vsControl)
Retrieves the internal handle of a control.
Definition: AUI.cs:180
static void BlockInput(int flag)
Disable/enable the mouse and keyboard.
Definition: AUI.cs:82
static void Run(string process)
Runs an external program.
Definition: AUI.cs:562
static int ControlMove(string fpsTitle, string vsText, string vsControl, int vsX, int vsY)
Moves a control within a window.
Definition: AUI.cs:260
static int[] PixelSearch(int left, int top, int right, int bottom, int color, int shade, int step)
Searches a rectangle of pixels for the pixel color provided.(NOT IMPLIMENTED)
Definition: AUI.cs:503
static void MouseMove(int viX, int viY)
Moves the mouse pointer.
Definition: AUI.cs:407
static int WinWaitActive(string fpsTitle, int iTimeout)
Pauses execution of the script until the requested window is active.
Definition: AUI.cs:993
static int ControlHide(string fpsTitle, string vsText, string vsControl)
Hides a control.
Definition: AUI.cs:245
static void WinActivate(string fpsTitle)
Activate a window.
Definition: AUI.cs:828
static void MouseMove(int viX, int viY, int viSpeed)
Moves the mouse pointer.
Definition: AUI.cs:418
static void Send(string text, int viSpeed)
Sends simulated keystrokes to the active window.
Definition: AUI.cs:612
static int PixelChecksum(int left, int top, int right, int bottom)
Generates a checksum for a region of pixels.
Definition: AUI.cs:468
static bool ProcessExists(string process)
Checks to see if a specified process exists.
Definition: AUI.cs:533
static string WinGetHandle(string fpsTitle)
Retrieves the internal handle of a window.
Definition: AUI.cs:887
static int ControlClick(string fpsTitle, string vsControl)
Sends a mouse click command to a given control.
Definition: AUI.cs:118
static void Send(int viMode, string vsText)
Sends simulated keystrokes to the active window.
Definition: AUI.cs:647
static int MouseClick(string vsButton, int viX, int viY, int viClicks, int viSpeed)
Perform a mouse click operation.
Definition: AUI.cs:353
static void Send(string vsText, string fpsTitle, string vsControl)
Sends simulated keystrokes to the specified control.
Definition: AUI.cs:658
static void ToolTip(string sTip, int viX, int viY)
Creates a tooltip anywhere on the screen.
Definition: AUI.cs:799
static void WinActivate(string fpsTitle, int waitactivetimeout)
Activates(gives focus to) a window.(incorporates WinWaitActive)
Definition: AUI.cs:838
static void WinMove(string fpsTitle, int viX, int viY)
Moves and/or resizes a window.
Definition: AUI.cs:939
static int MouseClick(string vsButton)
Perform a mouse click operation.
Definition: AUI.cs:336
static void WinMove(string fpsTitle, int viX, int viY, int viWidth, int viHeight)
Moves and/or resizes a window.
Definition: AUI.cs:954
static void SetOptions(string sOption, int iValue)
Changes the operation of various AutoIt functions/parameters.
Definition: AUI.cs:696
static void SetOptions()
Set recommended default AutoIt functions/parameters.
Definition: AUI.cs:682
static int ControlEnable(string fpsTitle, string vsText, string vsControl)
Disables a "grayed-out" control.
Definition: AUI.cs:144
static void SetOptions(bool vbWindowTitleExactMatch, int viSendKeyDelay)
Set recommended default AutoIt functions/parameters.
Definition: AUI.cs:704
static int ControlSend(string fpsTitle, string vsText, string vsControl, string vsSendText, int vsMode)
Sends a string of characters to a control.
Definition: AUI.cs:299
static int WinWait(string fpsTitle)
Pauses execution of the script until the requested window exists.
Definition: AUI.cs:964
static int ControlDisable(string fpsTitle, string vsText, string vsControl)
Enables a "grayed-out" control.
Definition: AUI.cs:131
static void WinWaitActiveWindow(string fpsTitle)
Pauses execution of the script until the requested window exists, activates it and then waits again u...
Definition: AUI.cs:1016
static int MouseClickDrag(string vsButton, int viX1, int viY1, int viX2, int viY2, int viSpeed)
Perform a mouse click and drag operation.
Definition: AUI.cs:373
static void WinActivate(string fpsTitle, string vsText)
Activates(gives focus to) a window.
Definition: AUI.cs:850
static int ControlFocus(string fpsTitle, string vsText, string vsControl)
Sets input focus to a given control on a window.
Definition: AUI.cs:157
static void ProcessWaitClose(string process, int timeout)
Pauses script execution until a given process does not exist.
Definition: AUI.cs:553
static void Send(string text, int viSpeed, int downLen)
Sends simulated keystrokes to the active window.
Definition: AUI.cs:632
Definition: Core.cs:40
static int ControlFocus(string fpsTitle, string vsControl)
Sets input focus to a given control on a window.
Definition: AUI.cs:169