Code: Select all
CompilerIf #PB_Compiler_Unicode
CompilerElse
MessageRequester("Error", "Au3Wrap Requires Unicode Support", #MB_ICONERROR)
End
CompilerEndIf
; ----------------------------------------------------------------
;
; File: Au3Wrap.pbi
; Description: PureBasic AutoIt Wrapper
; Version: R7
; AutoIt Version: 3.3.8.1
; Author: Warmonger
; URL: http://code.google.com/p/au3wrap/
;
; ----------------------------------------------------------------
#Au3Lib = 0
#AU3_INTDEFAULT = (-2147483647)
;Macro InitAu3()
If OpenLibrary(#Au3Lib, "AutoItX3.dll")
If IsLibrary(#Au3Lib)
;AU3_error
Prototype.l PB_error() : Global AU3_error.PB_error = GetFunction(#Au3Lib, "AU3_error")
;AutoItSetOption()
Prototype.l PB_AutoItSetOption(szOption.s, szParam.l) : Global AU3_AutoItSetOption.PB_AutoItSetOption = GetFunction(#Au3Lib, "AU3_AutoItSetOption")
;BlockInput()
Prototype.l PB_BlockInput(nFlag.l) : Global AU3_BlockInput.PB_BlockInput = GetFunction(#Au3Lib, "AU3_BlockInput")
;CDTray()
Prototype.l PB_CDTray(szDrive.s, szAction.s) : Global AU3_CDTray.PB_CDTray = GetFunction(#Au3Lib, "AU3_CDTray")
;ClipGet()
Prototype.l PB_ClipGet(*szClip, nBufSize.i) : Global AU3_ClipGet.PB_ClipGet = GetFunction(#Au3Lib, "AU3_ClipGet")
;ClipPut()
Prototype.l PB_ClipPut(szClip.s) : Global AU3_ClipPut.PB_ClipPut = GetFunction(#Au3Lib, "AU3_ClipPut")
;ControlClick()
Prototype.l PB_ControlClick(szTitle.s, szText.s, szControl.s, szButton.s = "left", nNumClicks.l = 1, nX.l = #AU3_INTDEFAULT, nY.l = #AU3_INTDEFAULT) : Global AU3_ControlClick.PB_ControlClick = GetFunction(#Au3Lib, "AU3_ControlClick")
;ControlCommand()
Prototype.l PB_ControlCommand(szTitle.s, szText.s, szControl.s, szCommand.s, szExtra.s, *szResult, nBufSize.i) : Global AU3_ControlCommand.PB_ControlCommand = GetFunction(#Au3Lib, "AU3_ControlCommand")
;ControlDisable()
Prototype.l PB_ControlDisable(szTitle.s, szText.s, szControl.s) : Global AU3_ControlDisable.PB_ControlDisable = GetFunction(#Au3Lib, "AU3_ControlDisable")
;ControlEnable()
Prototype.l PB_ControlEnable(szTitle.s, szText.s, szControl.s) : Global AU3_ControlEnable.PB_ControlEnable = GetFunction(#Au3Lib, "AU3_ControlEnable")
;ControlFocus()
Prototype.l PB_ControlFocus(szTitle.s, szText.s, szControl.s) : Global AU3_ControlFocus.PB_ControlFocus = GetFunction(#Au3Lib, "AU3_ControlFocus")
;ControlGetFocus()
Prototype.l PB_ControlGetFocus(szTitle.s, szText.s, *szControlWithFocus, nBufSize.i) : Global AU3_ControlGetFocus.PB_ControlGetFocus = GetFunction(#Au3Lib, "AU3_ControlGetFocus")
;ControlGetHandle()
Prototype.l PB_ControlGetHandle(szTitle.s, szText.s, szControl.s, *szRetText, nBufSize.i) : Global AU3_ControlGetHandle.PB_ControlGetHandle = GetFunction(#Au3Lib, "AU3_ControlGetHandle")
;ControlGetPosHeight()
Prototype.l PB_ControlGetPosHeight(szTitle.s, szText.s, szControl.s) : Global AU3_ControlGetPosHeight.PB_ControlGetPosHeight = GetFunction(#Au3Lib, "AU3_ControlGetPosHeight")
;ControlGetPosWidth()
Prototype.l PB_ControlGetPosWidth(szTitle.s, szText.s, szControl.s) : Global AU3_ControlGetPosWidth.PB_ControlGetPosWidth = GetFunction(#Au3Lib, "AU3_ControlGetPosWidth")
;ControlGetPosX()
Prototype.l PB_ControlGetPosX(szTitle.s, szText.s, szControl.s) : Global AU3_ControlGetPosX.PB_ControlGetPosX = GetFunction(#Au3Lib, "AU3_ControlGetPosX")
;ControlGetPosY()
Prototype.l PB_ControlGetPosY(szTitle.s, szText.s, szControl.s) : Global AU3_ControlGetPosY.PB_ControlGetPosY = GetFunction(#Au3Lib, "AU3_ControlGetPosY")
;ControlGetText()
Prototype.l PB_ControlGetText(szTitle.s, szText.s, szControl.s, *szControlText, nBufSize.i) : Global AU3_ControlGetText.PB_ControlGetText = GetFunction(#Au3Lib, "AU3_ControlGetText")
;ControlHide()
Prototype.l PB_ControlHide(szTitle.s, szText.s, szControl.s) : Global AU3_ControlHide.PB_ControlHide = GetFunction(#Au3Lib, "AU3_ControlHide")
;ControlListView()
Prototype.l PB_ControlListView(szTitle.s, szText.s, szControl.s, szCommand.s, szExtra1.s, szExtra2.s, *szResult, nBufSize.i) : Global AU3_ControlListView.PB_ControlListView = GetFunction(#Au3Lib, "AU3_ControlListView")
;ControlMove()
Prototype.l PB_ControlMove(szTitle.s, szText.s, szControl.s, nX.l, nY.l, nWidth.l = -1, nHeight.l = -1) : Global AU3_ControlMove.PB_ControlMove = GetFunction(#Au3Lib, "AU3_ControlMove")
;ControlSend()
Prototype.l PB_ControlSend(szTitle.s, szText.s, szControl.s, szSendText.s, nMode.l = 0) : Global AU3_ControlSend.PB_ControlSend = GetFunction(#Au3Lib, "AU3_ControlSend")
;ControlSetText()
Prototype.l PB_ControlSetText(szTitle.s, szText.s, szControl.s, szControlText.s) : Global AU3_ControlSetText.PB_ControlSetText = GetFunction(#Au3Lib, "AU3_ControlSetText")
;ControlShow()
Prototype.l PB_ControlShow(szTitle.s, szText.s, szControl.s) : Global AU3_ControlShow.PB_ControlShow = GetFunction(#Au3Lib, "AU3_ControlShow")
;ControlTreeView()
Prototype.l PB_ControlTreeView(szTitle.s, szText.s, szControl.s, szCommand.s, szExtra1,s, szExtra2.s, *szResult, nBufSize.i) : Global AU3_ControlTreeView.PB_ControlTreeView = GetFunction(#Au3Lib, "AU3_ControlTreeView")
;DriveMapAdd()
Prototype.l PB_DriveMapAdd(szDevice.s, szShare.s, nFlags.l, szUser.s , szPwd.s , *szResult, nBufSize.i) : Global AU3_DriveMapAdd.PB_DriveMapAdd = GetFunction(#Au3Lib, "AU3_DriveMapAdd")
;DriveMapDel()
Prototype.l PB_DriveMapDel(szDevice.s) : Global AU3_DriveMapDel.PB_DriveMapDel = GetFunction(#Au3Lib, "AU3_DriveMapDel")
;DriveMapGet()
Prototype.l PB_DriveMapGet(szDevice.s, *szMapping, nBufSize.i) : Global AU3_DriveMapGet.PB_DriveMapGet = GetFunction(#Au3Lib, "AU3_DriveMapGet")
;IniDelete()
Prototype.l PB_IniDelete(szFilename.s, szSection.s, szKey.s) : Global AU3_IniDelete.PB_IniDelete = GetFunction(#Au3Lib, "AU3_IniDelete")
;IniRead()
Prototype.l PB_IniRead(szFilename.s, szSection.s, szKey.s, szDefault.s, *szValue, nBufSize.i) : Global AU3_IniRead.PB_IniRead = GetFunction(#Au3Lib, "AU3_IniRead")
;IniWrite()
Prototype.l PB_IniWrite(szFilename.s, szSection.s, szKey.s, szValue.s) : Global AU3_IniWrite.PB_IniWrite = GetFunction(#Au3Lib, "AU3_IniWrite")
;IsAdmin()
Prototype.l PB_IsAdmin() : Global AU3_IsAdmin.PB_IsAdmin = GetFunction(#Au3Lib, "AU3_IsAdmin")
;MouseClick()
Prototype.l PB_MouseClick(szButton.s = "LEFT", nX.l = #AU3_INTDEFAULT, nY.l = #AU3_INTDEFAULT, nClicks.l = 1, nSpeed.l = -1) : Global AU3_MouseClick.PB_MouseClick = GetFunction(#Au3Lib, "AU3_MouseClick")
;MouseClickDrag()
Prototype.l PB_MouseClickDrag(szButton.s, nX1.l, nY1.l, nX2.l, nY2.l, nSpeed.l = -1) : Global MouseClickDrag.PB_MouseClickDrag = GetFunction(#Au3Lib, "AU3_MouseClickDrag")
;MouseDown()
Prototype.l PB_MouseDown(szButton.s = "LEFT") : Global AU3_MouseDown.PB_MouseDown = GetFunction(#Au3Lib, "AU3_MouseDown")
;MouseGetCursor()
Prototype.l PB_MouseGetCursor() : Global AU3_MouseGetCursor.PB_MouseGetCursor = GetFunction(#Au3Lib, "AU3_MouseGetCursor")
;MouseGetPosX()
Prototype.l PB_MouseGetPosX() : Global AU3_MouseGetPosX.PB_MouseGetPosX = GetFunction(#Au3Lib, "AU3_MouseGetPosX")
;MouseGetPosY()
Prototype.l PB_MouseGetPosY() : Global AU3_MouseGetPosY.PB_MouseGetPosY = GetFunction(#Au3Lib, "AU3_MouseGetPosY")
;MouseMove()
Prototype.l PB_MouseMove(nX.l, nY.l, nSpeed.l = -1) : Global AU3_MouseMove.PB_MouseMove = GetFunction(#Au3Lib, "AU3_MouseMove")
;MouseUp()
Prototype.l PB_MouseUp(szButton.s = "LEFT") : Global AU3_MouseUp.PB_MouseUp = GetFunction(#Au3Lib, "AU3_MouseUp")
;MouseWheel()
Prototype.l PB_MouseWheel(szDirection.s, nClicks.l) : Global AU3_MouseWheel.PB_MouseWheel = GetFunction(#Au3Lib, "AU3_MouseWheel")
;Opt()
Prototype.l PB_Opt(szOption.s, nValue.l) : Global AU3_Opt.PB_Opt = GetFunction(#Au3Lib, "AU3_Opt")
;PixelChecksum()
Prototype.l PB_PixelChecksum(nLeft.l, nTop.l, nRight.l, nBottom.l, nStep.l = 1) : Global AU3_PixelChecksum.PB_PixelChecksum = GetFunction(#Au3Lib, "AU3_PixelChecksum")
;PixelGetColor()
Prototype.l PB_PixelGetColor(nX.l, nY.l) : Global AU3_PixelGetColor.PB_PixelGetColor = GetFunction(#Au3Lib, "AU3_PixelGetColor")
;PixelSearch()
Prototype.l PB_PixelSearch(nLeft.l, nTop.l, nRight.l, nBottom.l, nCol.l, nVar.l = 0, nStep.l = 1) : Global AU3_PixelSearch.PB_PixelSearch = GetFunction(#Au3Lib, "AU3_PixelSearch")
;ProcessClose()
Prototype.l PB_ProcessClose(szProcess.s) : Global AU3_ProcessClose.PB_ProcessClose = GetFunction(#Au3Lib, "AU3_ProcessClose")
;ProcessExists()
Prototype.l PB_ProcessExists(szProcess.s) : Global AU3_ProcessExists.PB_ProcessExists = GetFunction(#Au3Lib, "AU3_ProcessExists")
;ProcessSetPriority()
Prototype.l PB_ProcessSetPriority(szProcess.s, nPriority.l) : Global AU3_ProcessSetPriority.PB_ProcessSetPriority = GetFunction(#Au3Lib, "AU3_ProcessSetPriority")
;ProcessWait()
Prototype.l PB_ProcessWait(szProcess.s, nTimeout.l = 0) : Global AU3_ProcessWait.PB_ProcessWait = GetFunction(#Au3Lib, "AU3_ProcessWait")
;ProcessWaitClose()
Prototype.l PB_ProcessWaitClose(szProcess.s, nTimeout.l = 0) : Global AU3_ProcessWaitClose.PB_ProcessWaitClose = GetFunction(#Au3Lib, "AU3_ProcessWaitClose")
;RegDeleteKey()
Prototype.l PB_RegDeleteKey(szKeyname.s) : Global AU3_RegDeleteKey.PB_RegDeleteKey = GetFunction(#Au3Lib, "AU3_RegDeleteKey")
;RegDeleteVal()
Prototype.l PB_RegDeleteVal(szKeyname.s, szValuename.s) : Global AU3_RegDeleteVal.PB_RegDeleteVal = GetFunction(#Au3Lib, "AU3_RegDeleteVal")
;RegEnumKey()
Prototype.l PB_RegEnumKey(szKeyname.s, nInstance.l, *szResult, nBufSize.i) : Global AU3_RegEnumKey.PB_RegEnumKey = GetFunction(#Au3Lib, "AU3_RegEnumKey")
;RegEnumVal()
Prototype.l PB_RegEnumVal(szKeyname.s, nInstance.l, *szResult, nBufSize.i) : Global AU3_RegEnumVal.PB_RegEnumVal = GetFunction(#Au3Lib, "AU3_RegEnumVal")
;RegRead()
Prototype.l PB_RegRead(szKeyname.s, szValuename.s, *szRetText, nBufSize.i) : Global AU3_RegRead.PB_RegRead = GetFunction(#Au3Lib, "AU3_RegRead")
;RegWrite()
Prototype.l PB_RegWrite(szKeyname.s, szValuename.s, szType.s, szValue.s) : Global AU3_RegWrite.PB_RegWrite = GetFunction(#Au3Lib, "AU3_RegWrite")
;Run()
Prototype.l PB_Run(szRun.s, szDir.s , nShowFlags.l = 1) : Global AU3_Run.PB_Run = GetFunction(#Au3Lib, "AU3_Run")
;RunAsSet()
Prototype.l PB_RunAsSet(szUser.s, szDomain.s, szPassword.s, nOptions.i) : Global AU3_RunAsSet.PB_RunAsSet = GetFunction(#Au3Lib, "AU3_RunAsSet")
;RunWait()
Prototype.l PB_RunWait(szRun.s, szDir.s , nShowFlags.l = 1) : Global AU3_RunWait.PB_RunWait = GetFunction(#Au3Lib, "AU3_RunWait")
;Send()
Prototype.l PB_Send(szSendText.s, nMode.l = 0) : Global AU3_Send.PB_Send = GetFunction(#Au3Lib, "AU3_Send")
;Shutdown()
Prototype.l PB_Shutdown(nFlags.l) : Global AU3_Shutdown.PB_Shutdown = GetFunction(#Au3Lib, "AU3_Shutdown")
;Sleep()
Prototype.l PB_Sleep(nMilliseconds.l) : Global AU3_Sleep.PB_Sleep = GetFunction(#Au3Lib, "AU3_Sleep")
;StatusbarGetText()
Prototype.l PB_StatusbarGetText(szTitle.s, szText.s , nPart.l, *szStatusText, nBufSize.i) : Global AU3_StatusbarGetText.PB_StatusbarGetText = GetFunction(#Au3Lib, "AU3_StatusbarGetText")
;ToolTip()
Prototype.l PB_ToolTip(szTip.s, nX.l = #AU3_INTDEFAULT, nY.l = #AU3_INTDEFAULT) : Global AU3_ToolTip.PB_ToolTip = GetFunction(#Au3Lib, "AU3_ToolTip")
;WinActivate()
Prototype.l PB_WinActivate(szTitle.s, szText.s ) : Global AU3_WinActivate.PB_WinActivate = GetFunction(#Au3Lib, "AU3_WinActivate")
;WinActive()
Prototype.l PB_WinActive(szTitle.s, szText.s ) : Global AU3_WinActive.PB_WinActive = GetFunction(#Au3Lib, "AU3_WinActive")
;WinClose()
Prototype.l PB_WinClose(szTitle.s, szText.s ) : Global AU3_WinClose.PB_WinClose = GetFunction(#Au3Lib, "AU3_WinClose")
;WinExists()
Prototype.l PB_WinExists(szTitle.s, szText.s ) : Global AU3_WinExists.PB_WinExists = GetFunction(#Au3Lib, "AU3_WinExists")
;WinGetCaretPosX()
Prototype.l PB_WinGetCaretPosX() : Global AU3_WinGetCaretPosX.PB_WinGetCaretPosX = GetFunction(#Au3Lib, "AU3_WinGetCaretPosX")
;WinGetCaretPosY()
Prototype.l PB_WinGetCaretPosY() : Global AU3_WinGetCaretPosY.PB_WinGetCaretPosY = GetFunction(#Au3Lib, "AU3_WinGetCaretPosY")
;WinGetClassList()
Prototype.l PB_WinGetClassList(szTitle.s, szText.s , *szRetText, nBufSize.i) : Global AU3_WinGetClassList.PB_WinGetClassList = GetFunction(#Au3Lib, "AU3_WinGetClassList")
;WinGetClientSizeHeight()
Prototype.l PB_WinGetClientSizeHeight(szTitle.s, szText.s ) : Global AU3_WinGetClientSizeHeight.PB_WinGetClientSizeHeight = GetFunction(#Au3Lib, "AU3_WinGetClientSizeHeight")
;WinGetClientSizeWidth()
Prototype.l PB_WinGetClientSizeWidth(szTitle.s, szText.s ) : Global AU3_WinGetClientSizeWidth.PB_WinGetClientSizeWidth = GetFunction(#Au3Lib, "AU3_WinGetClientSizeWidth")
;WinGetHandle()
Prototype.l PB_WinGetHandle(szTitle.s, szText.s , *szRetText, nBufSize.i) : Global AU3_WinGetHandle.PB_WinGetHandle = GetFunction(#Au3Lib, "AU3_WinGetHandle")
;WinGetPosX()
Prototype.l PB_WinGetPosX(szTitle.s, szText.s ) : Global AU3_WinGetPosX.PB_WinGetPosX = GetFunction(#Au3Lib, "AU3_WinGetPosX")
;WinGetPosY()
Prototype.l PB_WinGetPosY(szTitle.s, szText.s ) : Global AU3_WinGetPosY.PB_WinGetPosY = GetFunction(#Au3Lib, "AU3_WinGetPosY")
;WinGetPosHeight()
Prototype.l PB_WinGetPosHeight(szTitle.s, szText.s ) : Global AU3_WinGetPosHeight.PB_WinGetPosHeight = GetFunction(#Au3Lib, "AU3_WinGetPosHeight")
;WinGetPosWidth()
Prototype.l PB_WinGetPosWidth(szTitle.s, szText.s ) : Global AU3_WinGetPosWidth.PB_WinGetPosWidth = GetFunction(#Au3Lib, "AU3_WinGetPosWidth")
;WinGetProcess()
Prototype.l PB_WinGetProcess(szTitle.s, szText.s , *szRetText, nBufSize.i) : Global AU3_WinGetProcess.PB_WinGetProcess = GetFunction(#Au3Lib, "AU3_WinGetProcess")
;WinGetState()
Prototype.l PB_WinGetState(szTitle.s, szText.s ) : Global AU3_WinGetState.PB_WinGetState = GetFunction(#Au3Lib, "AU3_WinGetState")
;WinGetText()
Prototype.l PB_WinGetText(szTitle.s, szText.s , *szRetText, nBufSize.i) : Global AU3_WinGetText.PB_WinGetText = GetFunction(#Au3Lib, "AU3_WinGetText")
;WinGetTitle()
Prototype.l PB_WinGetTitle(szTitle.s, szText.s , *szRetText, nBufSize.i) : Global AU3_WinGetTitle.PB_WinGetTitle = GetFunction(#Au3Lib, "AU3_WinGetTitle")
;WinKill()
Prototype.l PB_WinKill(szTitle.s, szText.s ) : Global AU3_WinKill.PB_WinKill = GetFunction(#Au3Lib, "AU3_WinKill")
;WinList()
Prototype.l PB_WinList(szTitle.s, szText.s ) : Global AU3_WinList.PB_WinList = GetFunction(#Au3Lib, "AU3_WinList")
;WinMenuSelectItem()
Prototype.l PB_WinMenuSelectItem(szTitle.s, szText.s, szItem.s, szItem1.s , szItem2.s , szItem3.s , szItem4.s , szItem5.s , szItem6.s ) : Global WinMenuSelectItem.PB_WinMenuSelectItem = GetFunction(#Au3Lib, "AU3_WinMenuSelectItem")
;WinMinimizeAll()
Prototype.l PB_WinMinimizeAll() : Global AU3_WinMinimizeAll.PB_WinMinimizeAll = GetFunction(#Au3Lib, "AU3_WinMinimizeAll")
;WinMinimizeAllUndo()
Prototype.l PB_WinMinimizeAllUndo() : Global AU3_WinMinimizeAllUndo.PB_WinMinimizeAllUndo = GetFunction(#Au3Lib, "AU3_WinMinimizeAllUndo")
;WinMove()
Prototype.l PB_WinMove(szTitle.s, szText.s, nX.l, nY.l, nWidth.l = -1, nHeight.l = -1) : Global AU3_WinMove.PB_WinMove = GetFunction(#Au3Lib, "AU3_WinMove")
;WinSetOnTop()
Prototype.l PB_WinSetOnTop(szTitle.s, szText.s, nFlag.l) : Global AU3_WinSetOnTop.PB_WinSetOnTop = GetFunction(#Au3Lib, "AU3_WinSetOnTop")
;WinSetState()
Prototype.l PB_WinSetState(szTitle.s, szText.s, nFlags.l) : Global AU3_WinSetState.PB_WinSetState = GetFunction(#Au3Lib, "AU3_WinSetState")
;WinSetTitle()
Prototype.l PB_WinSetTitle(szTitle.s, szText.s, szNewTitle.s) : Global AU3_WinSetTitle.PB_WinSetTitle = GetFunction(#Au3Lib, "AU3_WinSetTitle")
;WinSetTrans()
Prototype.l PB_WinSetTrans(szTitle.s, szText.s, nTrans.l) : Global AU3_WinSetTrans.PB_WinSetTrans = GetFunction(#Au3Lib, "AU3_WinSetTrans")
;WinWait()
Prototype.l PB_WinWait(szTitle.s, szText.s, nTimeout.l = 0) : Global AU3_WinWait.PB_WinWait = GetFunction(#Au3Lib, "AU3_WinWait")
;WinWaitActive()
Prototype.l PB_WinWaitActive(szTitle.s, szText.s, nTimeout.l = 0) : Global AU3_WinWaitActive.PB_WinWaitActive = GetFunction(#Au3Lib, "AU3_WinWaitActive")
;WinWaitClose()
Prototype.l PB_WinWaitClose(szTitle.s, szText.s, nTimeout.l = 0) : Global AU3_WinWaitClose.PB_WinWaitClose = GetFunction(#Au3Lib, "AU3_WinWaitClose")
;WinWaitNotActive()
Prototype.l PB_WinWaitNotActive(szTitle.s, szText.s, nTimeout.l = 0) : Global AU3_WinWaitNotActive.PB_WinWaitNotActive = GetFunction(#Au3Lib, "AU3_WinWaitNotActive")
Else
MessageRequester("Error", "AutoItX3 Is Not A Valid Library", #MB_ICONERROR)
EndIf
Else
MessageRequester("Error", "AutoItX3 Library Not Found", #MB_ICONERROR)
EndIf
;EndMacro
;IncludeFile "Au3Wrap.pbi"
;/InitAu3()
AU3_Run("notepad.exe", "")
Delay(2000)
AU3_Send("Au3Wrap")