-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- AutoIt Plugin Created With Memory Plugin By AMSWaves -- This Source Realy want latest Memory Plugin (>= 2.0.0.0) -- Download it from : http://www.indigorose.com/forums/threads/27527-Free-Plugin-Memory-Plugin/ -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- AutoIt = {} function Ansi2Uni(ansi) if Memory then local size = Memory.CallFunction(AutoIt.MultiByteToWideChar, 0, 0, ansi, -1, 0, 0) local uni = Memory.CreateArray(ARRAY_SHORT, size) Memory.CallFunction(AutoIt.MultiByteToWideChar, 0, 0, ansi, String.Length(ansi), uni, size) return uni end end function Memory.GetString2() if Memory then local ret = "" for i = 1, AutoIt.BufferSize do if Memory.GetStructureData(AutoIt.Buffer, 1, i) ~= 0 then ret = ret .. String.Char(Memory.GetStructureData(AutoIt.Buffer, 1, i)) else break end end -- Fill zero the buffer for better memory using Memory.Zero(AutoIt.Buffer) return ret end end function AutoIt.Init() if Memory then if Memory.OpenLibrary(999, "AutoItX3.dll") > 0 then AutoIt.AU3_INTDEFAULT = -2147483647 -- Buffer for get and send strings AutoIt.BufferSize = 10485760 AutoIt.Buffer = Memory.CreateStructure("short[".. AutoIt.BufferSize .."]") -- Open kernel32.dll for use MultiByteToWideChar for convert ansi strings to unicode Memory.OpenLibrary(1000, "kernel32.dll") AutoIt.MultiByteToWideChar = Memory.OpenFunction(1000, "MultiByteToWideChar", DLL_CALL_STDCALL, DLL_RETURN_INT) -- Open AutoIt Functions AutoIt.AU3_Init_ = Memory.OpenFunction(999, "AU3_Init", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_error_ = Memory.OpenFunction(999, "AU3_error", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_AutoItSetOption_ = Memory.OpenFunction(999, "AU3_AutoItSetOption", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_BlockInput_ = Memory.OpenFunction(999, "AU3_BlockInput", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_CDTray_ = Memory.OpenFunction(999, "AU3_CDTray", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ClipGet_ = Memory.OpenFunction(999, "AU3_ClipGet", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ClipPut_ = Memory.OpenFunction(999, "AU3_ClipPut", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ControlClick_ = Memory.OpenFunction(999, "AU3_ControlClick", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlCommand_ = Memory.OpenFunction(999, "AU3_ControlCommand", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ControlListView_ = Memory.OpenFunction(999, "AU3_ControlListView", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ControlDisable_ = Memory.OpenFunction(999, "AU3_ControlDisable", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlEnable_ = Memory.OpenFunction(999, "AU3_ControlEnable", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlFocus_ = Memory.OpenFunction(999, "AU3_ControlFocus", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlGetFocus_ = Memory.OpenFunction(999, "AU3_ControlGetFocus", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ControlGetHandle_ = Memory.OpenFunction(999, "AU3_ControlGetHandle", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ControlGetPosX_ = Memory.OpenFunction(999, "AU3_ControlGetPosX", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlGetPosY_ = Memory.OpenFunction(999, "AU3_ControlGetPosY", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlGetPosHeight_ = Memory.OpenFunction(999, "AU3_ControlGetPosHeight", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlGetPosWidth_ = Memory.OpenFunction(999, "AU3_ControlGetPosWidth", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlGetText_ = Memory.OpenFunction(999, "AU3_ControlGetText", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ControlHide_ = Memory.OpenFunction(999, "AU3_ControlHide", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlMove_ = Memory.OpenFunction(999, "AU3_ControlMove", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlSend_ = Memory.OpenFunction(999, "AU3_ControlSend", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlSetText_ = Memory.OpenFunction(999, "AU3_ControlSetText", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlShow_ = Memory.OpenFunction(999, "AU3_ControlShow", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ControlTreeView_ = Memory.OpenFunction(999, "AU3_ControlTreeView", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_DriveMapAdd_ = Memory.OpenFunction(999, "AU3_DriveMapAdd", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_DriveMapDel_ = Memory.OpenFunction(999, "AU3_DriveMapDel", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_DriveMapGet_ = Memory.OpenFunction(999, "AU3_DriveMapGet", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_IniDelete_ = Memory.OpenFunction(999, "AU3_IniDelete", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_IniRead_ = Memory.OpenFunction(999, "AU3_IniRead", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_IniWrite_ = Memory.OpenFunction(999, "AU3_IniWrite", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_IsAdmin_ = Memory.OpenFunction(999, "AU3_IsAdmin", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseClick_ = Memory.OpenFunction(999, "AU3_MouseClick", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseClickDrag_ = Memory.OpenFunction(999, "AU3_MouseClickDrag", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseDown_ = Memory.OpenFunction(999, "AU3_MouseDown", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_MouseGetCursor_ = Memory.OpenFunction(999, "AU3_MouseGetCursor", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseGetPosX_ = Memory.OpenFunction(999, "AU3_MouseGetPosX", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseGetPosY_ = Memory.OpenFunction(999, "AU3_MouseGetPosY", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseMove_ = Memory.OpenFunction(999, "AU3_MouseMove", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_MouseUp_ = Memory.OpenFunction(999, "AU3_MouseUp", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_MouseWheel_ = Memory.OpenFunction(999, "AU3_MouseWheel", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_Opt_ = Memory.OpenFunction(999, "AU3_Opt", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_PixelChecksum_ = Memory.OpenFunction(999, "AU3_PixelChecksum", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_PixelGetColor_ = Memory.OpenFunction(999, "AU3_PixelGetColor", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_PixelSearch_ = Memory.OpenFunction(999, "AU3_PixelSearch", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ProcessClose_ = Memory.OpenFunction(999, "AU3_ProcessClose", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ProcessExists_ = Memory.OpenFunction(999, "AU3_ProcessExists", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ProcessSetPriority_ = Memory.OpenFunction(999, "AU3_ProcessSetPriority", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ProcessWait_ = Memory.OpenFunction(999, "AU3_ProcessWait", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_ProcessWaitClose_ = Memory.OpenFunction(999, "AU3_ProcessWaitClose", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_RegDeleteKey_ = Memory.OpenFunction(999, "AU3_RegDeleteKey", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_RegDeleteVal_ = Memory.OpenFunction(999, "AU3_RegDeleteVal", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_RegEnumKey_ = Memory.OpenFunction(999, "AU3_RegEnumKey", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_RegEnumVal_ = Memory.OpenFunction(999, "AU3_RegEnumVal", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_RegRead_ = Memory.OpenFunction(999, "AU3_RegRead", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_RegWrite_ = Memory.OpenFunction(999, "AU3_RegWrite", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_Run_ = Memory.OpenFunction(999, "AU3_Run", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_RunAsSet_ = Memory.OpenFunction(999, "AU3_RunAsSet", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_RunWait_ = Memory.OpenFunction(999, "AU3_RunWait", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_Send_ = Memory.OpenFunction(999, "AU3_Send", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_Shutdown_ = Memory.OpenFunction(999, "AU3_Shutdown", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_Sleep_ = Memory.OpenFunction(999, "AU3_Sleep", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_StatusbarGetText_ = Memory.OpenFunction(999, "AU3_StatusbarGetText", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_ToolTip_ = Memory.OpenFunction(999, "AU3_ToolTip", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinActivate_ = Memory.OpenFunction(999, "AU3_WinActivate", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinActive_ = Memory.OpenFunction(999, "AU3_WinActive", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinClose_ = Memory.OpenFunction(999, "AU3_WinClose", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinExists_ = Memory.OpenFunction(999, "AU3_WinExists", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetCaretPosX_ = Memory.OpenFunction(999, "AU3_WinGetCaretPosX", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetCaretPosY_ = Memory.OpenFunction(999, "AU3_WinGetCaretPosY", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetClassList_ = Memory.OpenFunction(999, "AU3_WinGetClassList", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinGetClientSizeHeight_ = Memory.OpenFunction(999, "AU3_WinGetClientSizeHeight", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetClientSizeWidth_ = Memory.OpenFunction(999, "AU3_WinGetClientSizeWidth", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetHandle_ = Memory.OpenFunction(999, "AU3_WinGetHandle", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinGetPosX_ = Memory.OpenFunction(999, "AU3_WinGetPosX", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetPosY_ = Memory.OpenFunction(999, "AU3_WinGetPosY", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetPosHeight_ = Memory.OpenFunction(999, "AU3_WinGetPosHeight", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetPosWidth_ = Memory.OpenFunction(999, "AU3_WinGetPosWidth", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetProcess_ = Memory.OpenFunction(999, "AU3_WinGetProcess", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinGetState_ = Memory.OpenFunction(999, "AU3_WinGetState", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinGetText_ = Memory.OpenFunction(999, "AU3_WinGetText", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinGetTitle_ = Memory.OpenFunction(999, "AU3_WinGetTitle", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinKill_ = Memory.OpenFunction(999, "AU3_WinKill", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinMenuSelectItem_ = Memory.OpenFunction(999, "AU3_WinMenuSelectItem", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinMinimizeAll_ = Memory.OpenFunction(999, "AU3_WinMinimizeAll", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinMinimizeAllUndo_ = Memory.OpenFunction(999, "AU3_WinMinimizeAllUndo", DLL_CALL_STDCALL, DLL_RETURN_VOID) AutoIt.AU3_WinMove_ = Memory.OpenFunction(999, "AU3_WinMove", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinSetOnTop_ = Memory.OpenFunction(999, "AU3_WinSetOnTop", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinSetState_ = Memory.OpenFunction(999, "AU3_WinSetState", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinSetTitle_ = Memory.OpenFunction(999, "AU3_WinSetTitle", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinSetTrans_ = Memory.OpenFunction(999, "AU3_WinSetTrans", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinWait_ = Memory.OpenFunction(999, "AU3_WinWait", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinWaitActive_ = Memory.OpenFunction(999, "AU3_WinWaitActive", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinWaitClose_ = Memory.OpenFunction(999, "AU3_WinWaitClose", DLL_CALL_STDCALL, DLL_RETURN_INT) AutoIt.AU3_WinWaitNotActive_ = Memory.OpenFunction(999, "AU3_WinWaitNotActive", DLL_CALL_STDCALL, DLL_RETURN_INT) -- CAll AutoIt Init Memory.CallFunction(AutoIt.AU3_Init_) end end end function AutoIt.End() Memory.CloseLibrary(999) Memory.CloseLibrary(1000) Memory.FreeStructure(AutoIt.Buffer) for i = 1, Table.Count(AutoIt) do Table.Remove(AutoIt, i) end end function AutoIt.Error() return Memory.CallFunction(AutoIt.AU3_error_) end function AutoIt.SetOption(szOption, nValue) if Memory then local uni_szOption = Ansi2Uni(szOption) local ret = Memory.CallFunction(AutoIt.AU3_AutoItSetOption_, uni_szOption, nValue) Memory.FreeArray(uni_szOption) return ret end end function AutoIt.BlockInput(nFlag) if Memory then Memory.CallFunction(AutoIt.AU3_BlockInput_, nFlag) end end function AutoIt.CDTray(szDrive, szAction) if Memory then local uni_szDrive = Ansi2Uni(szDrive) local uni_szAction = Ansi2Uni(szAction) local ret = Memory.CallFunction(AutoIt.AU3_CDTray_, uni_szDrive, uni_szAction) Memory.FreeArray(uni_szDrive) Memory.FreeArray(uni_szAction) return ret end end function AutoIt.ClipGet() if Memory then Memory.CallFunction(AutoIt.AU3_ClipGet_, AutoIt.Buffer, AutoIt.BufferSize) return Memory.GetString2() end end function AutoIt.ClipPut(szClip) if Memory then local uni_szClip = Ansi2Uni(szClip) Memory.CallFunction(AutoIt.AU3_ClipPut_, uni_szClip) Memory.FreeArray(uni_szClip) end end function AutoIt.ControlClick(szTitle, szText, szControl, szButton, nNumClicks, x, y) if Memory then if szButton == nil then szButton = "left" end if nNumClicks == nil then nNumClicks = 1 end if x == nil then x = AutoIt.AU3_INTDEFAULT end if y == nil then y = AutoIt.AU3_INTDEFAULT end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local uni_szButton = Ansi2Uni(szButton) local ret = Memory.CallFunction(AutoIt.AU3_ControlClick_, uni_szTitle, uni_szText, uni_szControl, uni_szButton, nNumClicks, x, y) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) Memory.FreeArray(uni_szButton) return ret end end function AutoIt.ControlCommand(szTitle, szText, szControl, szCommand, szExtra) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local uni_szCommand = Ansi2Uni(szCommand) local uni_szExtra = Ansi2Uni(szExtra) Memory.CallFunction(AutoIt.AU3_ControlCommand_, uni_szTitle, uni_szText, uni_szControl, uni_szCommand, uni_szExtra, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) Memory.FreeArray(uni_szCommand) Memory.FreeArray(uni_szExtra) return Memory.GetString2() end end function AutoIt.ControlListView(szTitle, szText, szControl, szCommand, szExtra1, szExtra2) if Memory then if szExtra1 == nil then szExtra1 = "" end if szExtra2 == nil then szExtra2 = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local uni_szCommand = Ansi2Uni(szCommand) local uni_szExtra1 = Ansi2Uni(szExtra1) local uni_szExtra2 = Ansi2Uni(szExtra2) Memory.CallFunction(AutoIt.AU3_ControlListView_, uni_szTitle, uni_szText, uni_szControl, uni_szCommand, uni_szExtra1, szExtra2, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) Memory.FreeArray(uni_szCommand) Memory.FreeArray(uni_szExtra1) Memory.FreeArray(uni_szExtra2) return Memory.GetString2() end end function AutoIt.ControlDisable(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlDisable_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlEnable(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlEnable_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlEnable(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlEnable_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlFocus(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlFocus_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlGetFocus(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_ControlGetFocus_, uni_szTitle, uni_szText, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.ControlGetHandle(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) Memory.CallFunction(AutoIt.AU3_ControlGetHandle_, uni_szTitle, uni_szText, uni_szControl, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return Memory.GetString2() end end function AutoIt.ControlGetPosX(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlGetPosX_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlGetPosY(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlGetPosY_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlGetPosY(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlGetPosY_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlGetPosHeight(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlGetPosHeight_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlGetPosWidth(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlGetPosWidth_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlGetText(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) Memory.CallFunction(AutoIt.AU3_ControlGetText_, uni_szTitle, uni_szText, uni_szControl, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return Memory.GetString2() end end function AutoIt.ControlHide(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlHide_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlMove(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlMove_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlSend(szTitle, szText, szControl, szSendText, nMode) if Memory then if nMode == nil then nMode = 0 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local uni_szSendText = Ansi2Uni(szSendText) local ret = Memory.CallFunction(AutoIt.AU3_ControlSend_, uni_szTitle, uni_szText, uni_szControl, uni_szSendText, nMode) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) Memory.FreeArray(uni_szSendText) return ret end end function AutoIt.ControlSetText(szTitle, szText, szControl, szControlText) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local uni_szControlText = Ansi2Uni(szControlText) local ret = Memory.CallFunction(AutoIt.AU3_ControlSetText_, uni_szTitle, uni_szText, uni_szControl, uni_szControlText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) Memory.FreeArray(uni_szControlText) return ret end end function AutoIt.ControlShow(szTitle, szText, szControl) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local ret = Memory.CallFunction(AutoIt.AU3_ControlShow_, uni_szTitle, uni_szText, uni_szControl) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) return ret end end function AutoIt.ControlTreeView(szTitle, szText, szControl, szCommand, szExtra1, szExtra2) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szControl = Ansi2Uni(szControl) local uni_szCommand = Ansi2Uni(szCommand) local uni_szExtra1 = Ansi2Uni(szExtra1) local uni_szExtra2 = Ansi2Uni(szExtra2) Memory.CallFunction(AutoIt.AU3_ControlTreeView_, uni_szTitle, uni_szText, uni_szControl, uni_szCommand, uni_szExtra1, uni_szExtra2, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szControl) Memory.FreeArray(uni_szCommand) Memory.FreeArray(uni_szExtra1) Memory.FreeArray(uni_szExtra2) return Memory.GetString2() end end function AutoIt.DriveMapAdd(szDevice, szShare, nFlags, szUser, szPwd) if Memory then if nFlags == nil then nFlags = 0 end if szUser == nil then szUser = "" end if szPwd == nil then szPwd = "" end local uni_szDevice = Ansi2Uni(szDevice) local uni_szShare = Ansi2Uni(szShare) local uni_szUser = Ansi2Uni(szUser) local uni_szPwd = Ansi2Uni(szPwd) Memory.CallFunction(AutoIt.AU3_DriveMapAdd_, uni_szDevice, uni_szShare, nFlags, uni_szUser, uni_szPwd, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szDevice) Memory.FreeArray(uni_szShare) Memory.FreeArray(uni_szUser) Memory.FreeArray(uni_szPwd) return Memory.GetString2() end end function AutoIt.DriveMapDel(szDevice) if Memory then local uni_szDevice = Ansi2Uni(szDevice) local ret = Memory.CallFunction(AutoIt.AU3_DriveMapDel_, uni_szDevice) Memory.FreeArray(uni_szDevice) return ret end end function AutoIt.DriveMapGet(szDevice) if Memory then local uni_szDevice = Ansi2Uni(szDevice) Memory.CallFunction(AutoIt.AU3_DriveMapGet_, uni_szDevice, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szDevice) return Memory.GetString2() end end function AutoIt.IniDelete(szFilename, szSection, szKey) if Memory then if szKey == nil then szKey = "" end local uni_szFilename = Ansi2Uni(szFilename) local uni_szSection = Ansi2Uni(szSection) local uni_szKey = Ansi2Uni(szKey) local ret = Memory.CallFunction(AutoIt.AU3_IniDelete_, uni_szFilename, uni_szSection, uni_szKey) Memory.FreeArray(uni_szFilename) Memory.FreeArray(uni_szSection) Memory.FreeArray(uni_szKey) return ret end end function AutoIt.IniRead(szFilename, szSection, szKey, szDefault) if Memory then if szKey == nil then szKey = "" end local uni_szFilename = Ansi2Uni(szFilename) local uni_szSection = Ansi2Uni(szSection) local uni_szKey = Ansi2Uni(szKey) local uni_szDefault = Ansi2Uni(szDefault) Memory.CallFunction(AutoIt.AU3_IniRead_, uni_szFilename, uni_szSection, uni_szKey, uni_szDefault, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szFilename) Memory.FreeArray(uni_szSection) Memory.FreeArray(uni_szKey) Memory.FreeArray(uni_szDefault) return Memory.GetString2() end end function AutoIt.IniWrite(szFilename, szSection, szKey, szValue) if Memory then local uni_szFilename = Ansi2Uni(szFilename) local uni_szSection = Ansi2Uni(szSection) local uni_szKey = Ansi2Uni(szKey) local uni_szValue = Ansi2Uni(szValue) local ret = Memory.CallFunction(AutoIt.AU3_IniWrite_, uni_szFilename, uni_szSection, uni_szKey, uni_szValue) Memory.FreeArray(uni_szFilename) Memory.FreeArray(uni_szSection) Memory.FreeArray(uni_szKey) Memory.FreeArray(uni_szValue) return ret end end function AutoIt.IsAdmin() if Memory then return Memory.CallFunction(AutoIt.AU3_IsAdmin_) end end function AutoIt.MouseClick(szButton, nX, nY, nClicks, nSpeed) if Memory then if nX == nil then nX = AutoIt.AU3_INTDEFAULT end if nY == nil then nY = AutoIt.AU3_INTDEFAULT end if nClicks == nil then nClicks = 1 end if nSpeed == nil then nSpeed = -1 end local uni_szButton = Ansi2Uni(szButton) local ret = Memory.CallFunction(AutoIt.AU3_MouseClick_, uni_szButton, nX, nY, nClicks, nSpeed) Memory.FreeArray(uni_szButton) return ret end end function AutoIt.MouseClickDrag(szButton, nX1, nY1, nX2, nY2, nSpeed) if Memory then if nSpeed == nil then nSpeed = -1 end local uni_szButton = Ansi2Uni(szButton) local ret = Memory.CallFunction(AutoIt.AU3_MouseClickDrag_, uni_szButton, nX1, nY1, nX2, nY2, nSpeed) Memory.FreeArray(uni_szButton) return ret end end function AutoIt.MouseGetCursor() if Memory then return Memory.CallFunction(AutoIt.AU3_MouseGetCursor_) end end function AutoIt.MouseGetPosX() if Memory then return Memory.CallFunction(AutoIt.AU3_MouseGetPosX_) end end function AutoIt.MouseGetPosY() if Memory then return Memory.CallFunction(AutoIt.AU3_MouseGetPosY_) end end function AutoIt.MouseMove(nX, nY, nSpeed) if Memory then if nSpeed == nil then nSpeed = -1 end return Memory.CallFunction(AutoIt.AU3_MouseMove_, nX, nY, nSpeed) end end function AutoIt.MouseUp(szButton) if Memory then if szButton == nil then szButton = "LEFT" end local uni_szButton = Ansi2Uni(szButton) Memory.CallFunction(AutoIt.AU3_MouseUp_, uni_szButton) Memory.FreeArray(uni_szButton) end end function AutoIt.MouseWheel(szDirection, nClicks) if Memory then if nClicks == nil then nClicks = 1 end local uni_szDirection = Ansi2Uni(szDirection) Memory.CallFunction(AutoIt.AU3_MouseWheel_, szDirection, nClicks) Memory.FreeArray(uni_szDirection) end end function AutoIt.Opt(szOption, nValue) if Memory then local uni_szOption = Ansi2Uni(szOption) local ret = Memory.CallFunction(AutoIt.AU3_Opt_, uni_szOption, nValue) Memory.FreeArray(uni_szOption) return ret end end function AutoIt.PixelChecksum(nLeft, nTop, nRight, nBottom, nStep) if Memory then return Memory.CallFunction(AutoIt.AU3_PixelChecksum_, nLeft, nTop, nRight, nBottom, nStep) end end function AutoIt.PixelGetColor(nX, nY) if Memory then return Memory.CallFunction(AutoIt.AU3_PixelGetColor_, nX, nY) end end function AutoIt.PixelSearch(nLeft, nTop, nRight, nBottom, nCol, nVar, nStep) if Memory then local tbl = {} local point = Memory.CreateStructure("int, int") if nVar == nil then nVar = 0 end if nStep == nil then nStep = 1 end Memory.CallFunction(AutoIt.AU3_PixelSearch_, nLeft, nTop, nRight, nBottom, nCol, nVar, nStep, point) tbl.X = Memory.GetStructureData(point, 1, 0) tbl.Y = Memory.GetStructureData(point, 2, 0) Memory.FreeStructure(point) return tbl end end function AutoIt.ProcessClose(szProcess) if Memory then local uni_szProcess = Ansi2Uni(szProcess) local ret = Memory.CallFunction(AutoIt.AU3_ProcessClose_, uni_szProcess) Memory.FreeArray(uni_szProcess) return ret end end function AutoIt.ProcessExists(szProcess) if Memory then local uni_szProcess = Ansi2Uni(szProcess) local ret = Memory.CallFunction(AutoIt.AU3_ProcessExists_, uni_szProcess) Memory.FreeArray(uni_szProcess) return ret end end function AutoIt.ProcessSetPriority(szProcess, nPriority) if Memory then local uni_szProcess = Ansi2Uni(szProcess) local ret = Memory.CallFunction(AutoIt.AU3_ProcessSetPriority_, uni_szProcess, nPriority) Memory.FreeArray(uni_szProcess) return ret end end function AutoIt.ProcessWait(szProcess, nTimeout) if Memory then if nTimeout == nil then nTimeout = 0 end local uni_szProcess = Ansi2Uni(szProcess) local ret = Memory.CallFunction(AutoIt.AU3_ProcessWait_, uni_szProcess, nTimeout) Memory.FreeArray(uni_szProcess) return ret end end function AutoIt.ProcessWaitClose(szProcess, nTimeout) if Memory then if nTimeout == nil then nTimeout = 0 end local uni_szProcess = Ansi2Uni(szProcess) local ret = Memory.CallFunction(AutoIt.AU3_ProcessWaitClose_, uni_szProcess, nTimeout) Memory.FreeArray(uni_szProcess) return ret end end function AutoIt.ProcessWaitClose(szProcess, nTimeout) if Memory then if nTimeout == nil then nTimeout = 0 end local uni_szProcess = Ansi2Uni(szProcess) local ret = Memory.CallFunction(AutoIt.AU3_ProcessWaitClose_, uni_szProcess, nTimeout) Memory.FreeArray(uni_szProcess) return ret end end function AutoIt.RegDeleteKey(szKeyname) if Memory then local uni_szKeyname = Ansi2Uni(szKeyname) local ret = Memory.CallFunction(AutoIt.AU3_RegDeleteKey_, uni_szKeyname) Memory.FreeArray(uni_szKeyname) return ret end end function AutoIt.RegDeleteVal(szKeyname, szValuename) if Memory then local uni_szKeyname = Ansi2Uni(szKeyname) local uni_szValuename = Ansi2Uni(szValuename) local ret = Memory.CallFunction(AutoIt.AU3_RegDeleteVal_, uni_szKeyname, uni_szValuename) Memory.FreeArray(uni_szKeyname) Memory.FreeArray(szValuename) return ret end end function AutoIt.RegEnumKey(szKeyname, nInstance) if Memory then local uni_szKeyname = Ansi2Uni(szKeyname) Memory.CallFunction(AutoIt.AU3_RegEnumKey_, uni_szKeyname, nInstance, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szKeyname) return Memory.GetString2() end end function AutoIt.RegEnumVal(szKeyname, nInstance) if Memory then local uni_szKeyname = Ansi2Uni(szKeyname) Memory.CallFunction(AutoIt.AU3_RegEnumVal_, uni_szKeyname, nInstance, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szKeyname) return Memory.GetString2() end end function AutoIt.RegRead(szKeyname, szValuename) if Memory then local uni_szKeyname = Ansi2Uni(szKeyname) local uni_szValuename = Ansi2Uni(szValuename) Memory.CallFunction(AutoIt.AU3_RegRead_, uni_szKeyname, uni_szValuename, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szKeyname) Memory.FreeArray(uni_szValuename) return Memory.GetString2() end end function AutoIt.RegWrite(szKeyname, szValuename, szType, szValue) if Memory then if szValuename == nil then szValuename = "" end if szType == nil then szType = "" end if szValue == nil then szValue = "" end local uni_szKeyname = Ansi2Uni(szKeyname) local uni_szValuename = Ansi2Uni(szValuename) local uni_szType = Ansi2Uni(szType) local uni_szValue = Ansi2Uni(szValue) local ret = Memory.CallFunction(AutoIt.AU3_RegWrite_, uni_szKeyname, uni_szValuename, uni_szType, uni_szValue) Memory.FreeArray(uni_szKeyname) Memory.FreeArray(uni_szValuename) Memory.FreeArray(uni_szType) Memory.FreeArray(uni_szValue) return ret end end function AutoIt.Run(szRun, szDir, nShowFlags) if Memory then if szDir == nil then szDir = "" end if nShowFlags == nil then nShowFlags = 1 end local uni_szRun = Ansi2Uni(szRun) local uni_szDir = Ansi2Uni(szDir) local ret = Memory.CallFunction(AutoIt.AU3_Run_, uni_szRun, uni_szDir, nShowFlags) Memory.FreeArray(uni_szRun) Memory.FreeArray(uni_szDir) return ret end end function AutoIt.RunAsSet(szUser, szDomain, szPassword, nOptions) if Memory then if szUser == nil then szUser = "" end if szDomain == nil then szDomain = "" end if szPassword == nil then szPassword = "" end if nOptions == nil then nOptions = 1 end local uni_szUser = Ansi2Uni(szUser) local uni_szDomain = Ansi2Uni(szDomain) local uni_szPassword = Ansi2Uni(szPassword) local ret = Memory.CallFunction(AutoIt.AU3_RunAsSet_, uni_szUser, uni_szDomain, uni_szPassword) Memory.FreeArray(uni_szUser) Memory.FreeArray(uni_szDomain) Memory.FreeArray(uni_szPassword) return ret end end function AutoIt.RunWait(szRun, szDir, nShowFlags) if Memory then if szDir == nil then szDir = "" end if nShowFlags == nil then nShowFlags = 1 end local uni_szRun = Ansi2Uni(szRun) local uni_szDir = Ansi2Uni(szDir) local ret = Memory.CallFunction(AutoIt.AU3_RunWait_, uni_szRun, uni_szDir, nShowFlags) Memory.FreeArray(uni_szRun) Memory.FreeArray(uni_szDir) return ret end end function AutoIt.Send(szSendText, nMode) if Memory then if nMode == nil then nMode = 1 end local uni_szSendText = Ansi2Uni(szSendText) Memory.CallFunction(AutoIt.AU3_Send_, uni_szSendText, nMode) Memory.FreeArray(uni_szSendText) end end function AutoIt.Shutdown(nFlags) if Memory then return Memory.CallFunction(AutoIt.AU3_Shutdown_, nFlags) end end function AutoIt.Sleep(nMilliseconds) if Memory then Memory.CallFunction(AutoIt.AU3_Sleep_, nMilliseconds) end end function AutoIt.StatusbarGetText(szTitle, szText, nPart) if Memory then if szText == nil then szText = "" end if nPart == nil then nPart = 1 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_StatusbarGetText_, uni_szTitle, uni_szText, nPart, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szSendText) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.ToolTip(szTip, nX, nY) if Memory then if nX == nil then nX = AutoIt.AU3_INTDEFAULT end if nY == nil then nY = AutoIt.AU3_INTDEFAULT end local uni_szTip = Ansi2Uni(szTip) Memory.CallFunction(AutoIt.AU3_ToolTip_, uni_szTip, nX, nY) Memory.FreeArray(uni_szTip) end end function AutoIt.WinActivate(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_WinActivate_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) end end function AutoIt.WinActive(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinActive_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinClose(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinClose_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinExists(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinExists_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetCaretPosX() if Memory then return Memory.CallFunction(AutoIt.AU3_WinGetCaretPosX_) end end function AutoIt.WinGetCaretPoY() if Memory then return Memory.CallFunction(AutoIt.AU3_WinGetCaretPosY_) end end function AutoIt.WinGetClassList(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_WinGetClassList_, uni_szTitle, uni_szText, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.WinGetClientSizeHeight(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetClientSizeHeight_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetClientSizeWidth(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetClientSizeWidth_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetHandle(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_WinGetHandle_, uni_szTitle, uni_szText, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.WinGetPosX(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetPosX_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetPosY(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetPosY_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetPosHeight(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetPosHeight_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetPosWidth(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetPosWidth_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetProcess(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_WinGetProcess_, uni_szTitle, uni_szText, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.WinGetState(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinGetState_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinGetText(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_WinGetText_, uni_szTitle, uni_szText, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.WinGetTitle(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) Memory.CallFunction(AutoIt.AU3_WinGetTitle_, uni_szTitle, uni_szText, AutoIt.Buffer, AutoIt.BufferSize) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return Memory.GetString2() end end function AutoIt.WinKill(szTitle, szText) if Memory then if szText == nil then szText = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinKill_, uni_szTitle, uni_szText) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinMenuSelectItem(szTitle, szText, szItem1, szItem2, szItem3, szItem4, szItem5, szItem6, szItem7, szItem8) if Memory then if szItem1 == nil then szItem1 = "" end if szItem2 == nil then szItem2 = "" end if szItem3 == nil then szItem3 = "" end if szItem4 == nil then szItem4 = "" end if szItem5 == nil then szItem5 = "" end if szItem6 == nil then szItem6 = "" end if szItem7 == nil then szItem7 = "" end if szItem8 == nil then szItem8 = "" end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szItem1 = Ansi2Uni(szItem1) local uni_szItem2 = Ansi2Uni(szItem2) local uni_szItem3 = Ansi2Uni(szItem3) local uni_szItem4 = Ansi2Uni(szItem4) local uni_szItem5 = Ansi2Uni(szItem5) local uni_szItem6 = Ansi2Uni(szItem6) local uni_szItem7 = Ansi2Uni(szItem7) local uni_szItem8 = Ansi2Uni(szItem8) local ret = Memory.CallFunction(AutoIt.AU3_WinMenuSelectItem_, uni_szTitle, uni_szText, uni_szItem1, uni_szItem2, uni_szItem3, uni_szItem4, uni_szItem5, uni_szItem6, uni_szItem7, uni_szItem8) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szItem1) Memory.FreeArray(uni_szItem2) Memory.FreeArray(uni_szItem3) Memory.FreeArray(uni_szItem4) Memory.FreeArray(uni_szItem5) Memory.FreeArray(uni_szItem6) Memory.FreeArray(uni_szItem7) Memory.FreeArray(uni_szItem8) return ret end end function AutoIt.WinMinimizeAll() if Memory then Memory.CallFunction(AutoIt.AU3_WinMinimizeAll_) end end function AutoIt.WinMinimizeAllUndo() if Memory then Memory.CallFunction(AutoIt.AU3_WinMinimizeAllUndo_) end end function AutoIt.WinMove(szTitle, szText, nX, nY, nWidth, nHeight) if Memory then if nWidth == nil then nWidth = -1 end if nHeight == nil then nHeight = -1 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinMove_, uni_szTitle, uni_szText, nX, nY, nWidth, nHeight) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinSetOnTop(szTitle, szText, nFlag) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinSetOnTop_, uni_szTitle, uni_szText, nFlag) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinSetState(szTitle, szText, nFlag) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinSetState_, uni_szTitle, uni_szText, nFlag) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinSetTitle(szTitle, szText, szNewTitle) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local uni_szNewTitle = Ansi2Uni(szNewTitle) local ret = Memory.CallFunction(AutoIt.AU3_WinSetState_, uni_szTitle, uni_szText, uni_szNewTitle) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) Memory.FreeArray(uni_szNewTitle) return ret end end function AutoIt.WinSetTrans(szTitle, szText, nTrans) if Memory then local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinSetTrans_, uni_szTitle, uni_szText, nTrans) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinWait(szTitle, szText, nTimeout) if Memory then if szText == nil then szText = "" end if nTimeout == nil then nTimeout = 0 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinWait_, uni_szTitle, uni_szText, nTimeout) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinWaitActive(szTitle, szText, nTimeout) if Memory then if szText == nil then szText = "" end if nTimeout == nil then nTimeout = 0 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinWaitActive_, uni_szTitle, uni_szText, nTimeout) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinWaitClose(szTitle, szText, nTimeout) if Memory then if szText == nil then szText = "" end if nTimeout == nil then nTimeout = 0 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinWaitClose_, uni_szTitle, uni_szText, nTimeout) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end function AutoIt.WinWaitNotActive(szTitle, szText, nTimeout) if Memory then if szText == nil then szText = "" end if nTimeout == nil then nTimeout = 0 end local uni_szTitle = Ansi2Uni(szTitle) local uni_szText = Ansi2Uni(szText) local ret = Memory.CallFunction(AutoIt.AU3_WinWaitNotActive_, uni_szTitle, uni_szText, nTimeout) Memory.FreeArray(uni_szTitle) Memory.FreeArray(uni_szText) return ret end end