45 using System.Collections.Generic;
46 using System.Runtime.InteropServices;
53 public const int AU3_INTDEFAULT = -2147483647;
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;
69 const string AUTOITX3_DLL =
@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll";
108 return AU3_ControlClick(fpsTitle, vsText, vsControl, vsButton, viNumClicks, viX, viY);
120 return AU3_ControlClick(fpsTitle,
string.Empty, vsControl,
string.Empty, 1, 0, 0);
131 public static int ControlDisable(
string fpsTitle,
string vsText,
string vsControl)
133 return AU3_ControlDisable(fpsTitle, vsText, vsControl);
144 public static int ControlEnable(
string fpsTitle,
string vsText,
string vsControl)
146 return AU3_ControlEnable(fpsTitle, vsText, vsControl);
157 public static int ControlFocus(
string fpsTitle,
string vsText,
string vsControl)
159 return AU3_ControlFocus(fpsTitle, vsText, vsControl);
171 return AU3_ControlFocus(fpsTitle,
string.Empty, vsControl);
185 byte[] RetText =
new byte[50];
187 AU3_ControlGetHandle(fpsTitle, vsText, vsControl, RetText, RetText.Length);
192 return Encoding.ASCII.GetString(RetText).TrimEnd(
'\0');
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);
221 public static string ControlGetText(
string fpsTitle,
string vsText,
string vsControl)
226 byte[] byteRetText =
new byte[10000];
228 AU3_ControlGetText(fpsTitle, vsText, vsControl, byteRetText, byteRetText.Length);
234 return Encoding.ASCII.GetString(byteRetText).TrimEnd(
'\0');
245 public static int ControlHide(
string fpsTitle,
string vsText,
string vsControl)
247 return AU3_ControlHide(fpsTitle, vsText, vsControl);
260 public static int ControlMove(
string fpsTitle,
string vsText,
string vsControl,
int vsX,
int vsY)
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);
279 public static int ControlMove(
string fpsTitle,
string vsText,
string vsControl,
int vsX,
int vsY,
int vsHeight,
int vsWidth)
281 return AU3_ControlMove(fpsTitle, vsText, vsControl, vsX, vsY, vsHeight, vsWidth);
299 public static int ControlSend(
string fpsTitle,
string vsText,
string vsControl,
string vsSendText,
int vsMode)
301 return AU3_ControlSend(fpsTitle, vsText, vsControl, vsSendText, vsMode);
312 public static int ControlShow(
string fpsTitle,
string vsText,
string vsControl)
314 return AU3_ControlShow(fpsTitle, vsText, vsControl);
325 public static int MouseClick(
string vsButton,
int viX,
int viY)
327 return MouseClick(vsButton, viX, viY, 1, 1);
338 int mousex = AU3_MouseGetPosX();
339 int mousey = AU3_MouseGetPosY();
340 return MouseClick(vsButton, mousex, mousey);
353 public static int MouseClick(
string vsButton,
int viX,
int viY,
int viClicks,
int viSpeed)
358 AU3_MouseMove(viX, viY, 10);
359 return AU3_MouseClick(vsButton, viX, viY, viClicks, viSpeed);
373 public static int MouseClickDrag(
string vsButton,
int viX1,
int viY1,
int viX2,
int viY2,
int viSpeed)
375 return AU3_MouseClickDrag(vsButton, viX1, viY1, viX2, viY2, viSpeed);
386 AU3_MouseDown(vsButton);
396 point.X = AU3_MouseGetPosX();
397 point.Y = AU3_MouseGetPosY();
409 MouseMove(viX, viY, 1);
418 public static void MouseMove(
int viX,
int viY,
int viSpeed)
420 AU3_MouseMove(viX, viY, viSpeed);
431 AU3_MouseUp(vsButton);
443 public static int PixelChecksum(
int left,
int top,
int right,
int bottom,
int step)
449 for (
int viX = left; viX <= right; viX += step)
451 for (
int viY = top; viY <= bottom; viY += step)
453 sum += AU3_PixelGetColor(viX, viY);
470 return PixelChecksum(left, top, right, bottom, 10);
481 return AU3_PixelGetColor(viX, viY);
484 public static int PixelGetColor(
int viX,
int viY, IntPtr handle)
486 AU3_AutoItSetOption(
"PixelCoordMode", 2);
503 public static int[]
PixelSearch(
int left,
int top,
int right,
int bottom,
int color,
int shade,
int step)
525 AU3_ProcessClose(process);
535 return AU3_ProcessExists(process) != 0;
545 AU3_ProcessWait(process, timeout);
555 AU3_ProcessWaitClose(process, timeout);
562 public static void Run(
string process)
564 Run(process,
string.Empty);
572 public static void Run(
string process,
string dir)
574 Run(process, dir, SW_SHOWMAXIMIZED);
588 public static void Run(
string process,
string dir,
int showflag)
590 AU3_Run(process, dir, showflag);
598 public static void Send(
string text)
612 public static void Send(
string text,
int viSpeed)
614 Send(text, viSpeed, 5);
632 public static void Send(
string text,
int viSpeed,
int downLen)
634 SetOptions(
"AuXWrapper.SendKeyDelay", viSpeed);
635 SetOptions(
"AuXWrapper.SendKeyDownDelay", downLen);
647 public static void Send(
int viMode,
string vsText)
649 AU3_Send(vsText, viMode);
658 public static void Send(
string vsText,
string fpsTitle,
string vsControl)
663 ControlFocus(fpsTitle, vsControl);
667 public static void SendRand(
string vsText,
int speedMin,
int speedMax)
669 Random rand =
new Random();
670 for (
int a = 0; a < vsText.Length; a++)
672 SetOptions(
"AuXWrapper.SendKeyDownDelay", rand.Next(10, 25));
673 Console.WriteLine(Convert.ToString(vsText[a]));
674 AU3_Send(vsText[a].ToString(), 0);
684 SetOptions(
true, 250);
698 AU3_AutoItSetOption(sOption, iValue);
704 public static void SetOptions(
bool vbWindowTitleExactMatch,
int viSendKeyDelay)
715 if (vbWindowTitleExactMatch)
720 SetOptions(
"WinTitleMatchMode", 1);
727 SetOptions(
"WinTitleMatchMode", 2);
736 SetOptions(
"SendKeyDelay", viSendKeyDelay);
743 SetOptions(
"WinWaitDelay", 250);
751 SetOptions(
"WinDetectHiddenText", 1);
761 SetOptions(
"CaretCoordMode", 2);
771 SetOptions(
"PixelCoordMode", 2);
781 SetOptions(
"MouseCoordMode", 2);
788 public static void Sleep(
int iMilliseconds)
790 AU3_Sleep(iMilliseconds);
799 public static void ToolTip(
string sTip,
int viX,
int viY)
801 AU3_ToolTip(sTip, viX, viY);
813 if (!
string.IsNullOrEmpty(sMessage))
815 sMessage =
string.Format(
"\r\n {0} \r\n ", sMessage);
821 ToolTip(sMessage, 0, 0);
830 AU3_WinActivate(fpsTitle,
string.Empty);
838 public static void WinActivate(
string fpsTitle,
int waitactivetimeout)
840 AU3_WinActivate(fpsTitle,
string.Empty);
841 AU3_WinWaitActive(fpsTitle,
string.Empty, waitactivetimeout);
842 System.Threading.Thread.Sleep(1000);
852 AU3_WinActivate(fpsTitle, vsText);
865 return AU3_WinExists(fpsTitle,
string.Empty);
877 public static int WinExists(
string fpsTitle,
string vsText)
879 return AU3_WinExists(fpsTitle, vsText);
892 byte[] RetText =
new byte[50];
894 AU3_WinGetHandle(fpsTitle,
string.Empty, RetText, RetText.Length);
899 return Encoding.ASCII.GetString(RetText).TrimEnd(
'\0');
908 public static string WinGetText(
string fpsTitle,
string vsText)
913 byte[] byteRetText =
new byte[10000];
915 AU3_WinGetText(fpsTitle, vsText, byteRetText, byteRetText.Length);
920 return Encoding.ASCII.GetString(byteRetText).TrimEnd(
'\0');
930 return WinGetText(fpsTitle,
string.Empty);
939 public static void WinMove(
string fpsTitle,
int viX,
int viY)
941 int xLen = AU3_WinGetPosWidth(fpsTitle,
string.Empty);
942 int yLen = AU3_WinGetPosHeight(fpsTitle,
string.Empty);
943 WinMove(fpsTitle, viX, viY, xLen, yLen);
954 public static void WinMove(
string fpsTitle,
int viX,
int viY,
int viWidth,
int viHeight)
956 AU3_WinMove(fpsTitle,
string.Empty, viX, viY, viWidth, viHeight);
966 return AU3_WinWait(fpsTitle,
string.Empty, 3000);
979 public static int WinWaitActive(
string fpsTitle,
string vsText,
int iTimeout)
981 return AU3_WinWaitActive(fpsTitle, vsText, iTimeout);
995 return AU3_WinWaitActive(fpsTitle,
string.Empty, iTimeout);
1008 return AU3_WinWaitActive(fpsTitle,
string.Empty, 3000);
1026 WinActivate(fpsTitle);
1031 WinWaitActive(fpsTitle);
1034 public Position2D WinGetPos(
string fpsTitle,
string vsText)
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);
1045 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1046 private static extern int AU3_AutoItSetOption([MarshalAs(UnmanagedType.LPStr)]
string Option,
int Value);
1049 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1050 private static extern void AU3_BlockInput(
int Flag);
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);
1063 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1064 private static extern void AU3_ClipGet(byte[] Clip,
int BufSize);
1067 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1068 private static extern void AU3_ClipPut([MarshalAs(UnmanagedType.LPStr)]
string Clip);
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,
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,
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);
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);
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);
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,
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,
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);
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);
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);
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);
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,
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);
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,
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,
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,
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);
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);
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,
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,
1239 [MarshalAs(UnmanagedType.LPStr)]
string User,
1240 [MarshalAs(UnmanagedType.LPStr)]
string Pwd,
1245 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1246 private static extern int AU3_DriveMapDel([MarshalAs(UnmanagedType.LPStr)]
string Device);
1249 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1250 private static extern void AU3_DriveMapDel(
1251 [MarshalAs(UnmanagedType.LPStr)]
string Device,
1256 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1257 private static extern int AU3_error();
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);
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,
1278 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1279 private static extern void AU3_Init();
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);
1290 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1291 private static extern int AU3_IsAdmin();
1294 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1295 private static extern int AU3_MouseClick(
1296 [MarshalAs(UnmanagedType.LPStr)]
string Button,
1303 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1304 private static extern int AU3_MouseClickDrag(
1305 [MarshalAs(UnmanagedType.LPStr)]
string Button,
1313 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1314 private static extern void AU3_MouseDown([MarshalAs(UnmanagedType.LPStr)]
string Button);
1317 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1318 private static extern int AU3_MouseGetCursor();
1321 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1322 private static extern int AU3_MouseGetPosX();
1325 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1326 private static extern int AU3_MouseGetPosY();
1329 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1330 private static extern int AU3_MouseMove(
int X,
int Y,
int Speed);
1333 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1334 private static extern void AU3_MouseUp([MarshalAs(UnmanagedType.LPStr)]
string Button);
1337 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1338 private static extern void AU3_MouseWheel([MarshalAs(UnmanagedType.LPStr)]
string Direction,
int Clicks);
1341 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1342 private static extern int AU3_Opt([MarshalAs(UnmanagedType.LPStr)]
string Option,
int Value);
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);
1349 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1350 private static extern int AU3_PixelGetColor(
int X,
int Y);
1375 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1376 private static extern void AU3_PixelSearch(
1387 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1388 private static extern int AU3_ProcessClose([MarshalAs(UnmanagedType.LPStr)]
string Process);
1391 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1392 private static extern int AU3_ProcessExists([MarshalAs(UnmanagedType.LPStr)]
string Process);
1395 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1396 private static extern int AU3_ProcessSetPriority(
1397 [MarshalAs(UnmanagedType.LPStr)]
string Process,
1402 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1403 private static extern int AU3_ProcessWait(
1404 [MarshalAs(UnmanagedType.LPStr)]
string Process,
1408 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1409 private static extern int AU3_ProcessWaitClose(
1410 [MarshalAs(UnmanagedType.LPStr)]
string Process,
1414 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1415 private static extern int AU3_RegDeleteKey([MarshalAs(UnmanagedType.LPStr)]
string fpsKeyname);
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);
1424 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1425 private static extern void AU3_RegEnumKey(
1426 [MarshalAs(UnmanagedType.LPStr)]
string fpsKeyname,
1432 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1433 private static extern void AU3_RegEnumVal(
1434 [MarshalAs(UnmanagedType.LPStr)]
string fpsKeyname,
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,
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);
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,
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,
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,
1478 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1479 private static extern void AU3_Send([MarshalAs(UnmanagedType.LPStr)]
string SendText,
int Mode);
1482 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1483 private static extern int AU3_Shutdown(
int Flags);
1486 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1487 private static extern void AU3_Sleep(
int Milliseconds);
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,
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);
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);
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);
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);
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);
1527 [DllImport(
@"C:\Program Files(x86)\AutoIt3\AutoItX\AutoItX3.dll", SetLastError =
true, CharSet = CharSet.Auto)]
1528 private static extern int AU3_WinGetCaretPosX();
1531 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1532 private static extern int AU3_WinGetCaretPosY();
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,
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);
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);
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,
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);
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);
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);
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);
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,
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);
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,
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,
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);
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);
1637 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1638 private static extern void AU3_WinMinimizeAll();
1641 [DllImport(AUTOITX3_DLL, SetLastError =
true, CharSet = CharSet.Auto)]
1642 private static extern void AU3_WinMinimizeAllUndo();
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,
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,
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,
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);
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,
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,
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,
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,
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,
1712 #region Nested Types
1737 #endregion Nested Types
static int WinWaitActive(string fpsTitle, string vsText, int iTimeout)
Pauses execution of the script until the requested window is active.
static int WinExists(string fpsTitle, string vsText)
Checks to see if a specified window exists.
static PointXY MouseGetPos()
Retrieves the current position of the mouse cursor.
static void ProcessWait(string process, int timeout)
Pauses script execution until a given process exists.
static int ControlShow(string fpsTitle, string vsText, string vsControl)
Shows a control that was hidden.
static void Run(string process, string dir, int showflag)
Runs an external program.
static int ControlMove(string fpsTitle, string vsText, string vsControl, int vsX, int vsY, int vsHeight, int vsWidth)
Moves a control within a window.
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.
static void ProcessClose(string process)
Terminates a named process.
static string WinGetText(string fpsTitle, string vsText)
Retrieves the text from a window.
static int WinExists(string fpsTitle)
Checks to see if a specified window exists.
static void Sleep(int iMilliseconds)
Pause script execution.
static void ToolTip(string sMessage)
Creates a padded tooltip in the top-left part of the screen.
static int PixelChecksum(int left, int top, int right, int bottom, int step)
Generates a checksum for a region of pixels.
static int MouseClick(string vsButton, int viX, int viY)
Perform a mouse click operation.
static string ControlGetText(string fpsTitle, string vsText, string vsControl)
Retrieves the text from a window.
static int PixelGetColor(int viX, int viY)
Returns a pixel color according to x,y pixel coordinates.
static string WinGetText(string fpsTitle)
Retrieves the text from a window.
static void MouseUp(string vsButton)
Perform a mouse up event at the current mouse position.
static int WinWaitActive(string fpsTitle)
Pauses execution of the script until the requested window is active.
static Position2D ControlGetPos(string fpsTitle, string vsText, string vsControl)
Retrieves the position and size of a control relative to it's window.
static void Run(string process, string dir)
Runs an external program.
static void MouseDown(string vsButton)
Perform a mouse down event at the current mouse position.
static void Send(string text)
Sends simulated keystrokes to the active window.
static string ControlGetHandle(string fpsTitle, string vsText, string vsControl)
Retrieves the internal handle of a control.
static void BlockInput(int flag)
Disable/enable the mouse and keyboard.
static void Run(string process)
Runs an external program.
static int ControlMove(string fpsTitle, string vsText, string vsControl, int vsX, int vsY)
Moves a control within a window.
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)
static void MouseMove(int viX, int viY)
Moves the mouse pointer.
static int WinWaitActive(string fpsTitle, int iTimeout)
Pauses execution of the script until the requested window is active.
static int ControlHide(string fpsTitle, string vsText, string vsControl)
Hides a control.
static void WinActivate(string fpsTitle)
Activate a window.
static void MouseMove(int viX, int viY, int viSpeed)
Moves the mouse pointer.
static void Send(string text, int viSpeed)
Sends simulated keystrokes to the active window.
static int PixelChecksum(int left, int top, int right, int bottom)
Generates a checksum for a region of pixels.
static bool ProcessExists(string process)
Checks to see if a specified process exists.
static string WinGetHandle(string fpsTitle)
Retrieves the internal handle of a window.
static int ControlClick(string fpsTitle, string vsControl)
Sends a mouse click command to a given control.
static void Send(int viMode, string vsText)
Sends simulated keystrokes to the active window.
static int MouseClick(string vsButton, int viX, int viY, int viClicks, int viSpeed)
Perform a mouse click operation.
static void Send(string vsText, string fpsTitle, string vsControl)
Sends simulated keystrokes to the specified control.
static void ToolTip(string sTip, int viX, int viY)
Creates a tooltip anywhere on the screen.
static void WinActivate(string fpsTitle, int waitactivetimeout)
Activates(gives focus to) a window.(incorporates WinWaitActive)
static void WinMove(string fpsTitle, int viX, int viY)
Moves and/or resizes a window.
static int MouseClick(string vsButton)
Perform a mouse click operation.
static void WinMove(string fpsTitle, int viX, int viY, int viWidth, int viHeight)
Moves and/or resizes a window.
static void SetOptions(string sOption, int iValue)
Changes the operation of various AutoIt functions/parameters.
static void SetOptions()
Set recommended default AutoIt functions/parameters.
static int ControlEnable(string fpsTitle, string vsText, string vsControl)
Disables a "grayed-out" control.
static void SetOptions(bool vbWindowTitleExactMatch, int viSendKeyDelay)
Set recommended default AutoIt functions/parameters.
static int ControlSend(string fpsTitle, string vsText, string vsControl, string vsSendText, int vsMode)
Sends a string of characters to a control.
static int WinWait(string fpsTitle)
Pauses execution of the script until the requested window exists.
static int ControlDisable(string fpsTitle, string vsText, string vsControl)
Enables a "grayed-out" control.
static void WinWaitActiveWindow(string fpsTitle)
Pauses execution of the script until the requested window exists, activates it and then waits again u...
static int MouseClickDrag(string vsButton, int viX1, int viY1, int viX2, int viY2, int viSpeed)
Perform a mouse click and drag operation.
static void WinActivate(string fpsTitle, string vsText)
Activates(gives focus to) a window.
static int ControlFocus(string fpsTitle, string vsText, string vsControl)
Sets input focus to a given control on a window.
static void ProcessWaitClose(string process, int timeout)
Pauses script execution until a given process does not exist.
static void Send(string text, int viSpeed, int downLen)
Sends simulated keystrokes to the active window.
static int ControlFocus(string fpsTitle, string vsControl)
Sets input focus to a given control on a window.