Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2018 in all areas

  1. To see this, there is a mystic and ancent thing called "Debugging" or "Error handling" _SQLite_FetchData($hQuery, $aRow) If @error Then ConsoleWrite("There is an errore here! Error: " & @error & @CRLF) Else ; Continue with the script... EndIf So, you can see what is going on when you call the function
    2 points
  2. water

    OutlookEX

    Version 1.7.0.1

    10,054 downloads

    Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None
    1 point
  3. Description: UDF to simply create modern looking GUIs Features: Create light modern aesthetic borderless GUI Interactive menu panel (with mouse-over detection) A bunch of skins (color sets) are available with possibility to create your owns Files: UDF (MTSkin_UDF.au3) + Example Scripts (Example.au3 & Example2.au3) Screenshots: I would be glad to know what you've done with this, so do not hesitate to send me messages. Of course the code can be improved, but I hope you'll find it useful (This is the first time I share my work on this forum, please be indulgent...) Download: MTSkin-UDF.zip Edit: - Scripts modified according to ChuckS' comment - Fixed link broken by reuploading files
    1 point
  4. _AD_GetObjectsInOU is the function you are looking for. Specify the LDAP query to search for usres where mail=xxx and return mailnickname. The examples that come with the UDF should explain how to do. If not, please post here again
    1 point
  5. @supperfake You'd rather use higher level SQlite functions, like _SQLite_GetTable2D and friends.
    1 point
  6. It depends on the data, the needed use in the script, and so on The regex way is probably much faster than using the _Array* funcs. On the example above I didn't try the latter but it should give a little more than 40s I guess
    1 point
  7. HAHA, you should feel lucky, I don't often do this. this works with your test doc and is taken from example in help and for loop from your code above #include <MsgBoxConstants.au3> #include <Word.au3> Global $arrHeader = ["AAA", "BBB", "CCC"] ; Create application object Local $oWord = _Word_Create() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error creating a new Word application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Open test document read-only Local $oDoc = _Word_DocOpen($oWord, @ScriptDir & "\Test.docx", Default, Default, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error opening 'Test.docx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; Underline All groups of text in the array. Local $oRangeFound, $oSearchRange $oSearchRange = _Word_DocRangeSet($oDoc, 1) For $i = 0 To UBound($arrHeader) - 1 $oRangeFound = _Word_DocFind($oDoc, $arrHeader[$i], $oSearchRange) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Word UDF: _Word_DocFind Example", _ "Error locating the specified text in the document." & @CRLF & "@error = " & @error & ", @extended = " & @extended) $oRangeFound.Underline = True While 1 $oRangeFound = _Word_DocFind($oDoc, $arrHeader[$i], $oSearchRange, $oRangeFound) If @error Then ExitLoop $oRangeFound.Underline = True WEnd Next I included a .docx and a .doc (just change the code above to reference the older type .doc if that is what you need, both work. Test.docx
    1 point
  8. Everytime the color is changed, update your variable with the new color. Anything else is way too complicated to compensate for poor programming.
    1 point
  9. Instead of trying to automate the command line, why not use AutoIT to create the account directly? Lots of good examples for re-use exist. You can make a script and use the RunAs function to launch it... (https://www.autoitscript.com/autoit3/docs/functions/RunAs.htm)
    1 point
  10. legend, If you have just set the colour for a control, you must know what value you used - so why do you need to determine it by other means? If you need to track the colour throughout the script for use in comparisons, then I suggest a 2D array with ControlID and current colour. M23
    1 point
  11. Did you add the function GUICtlrGetBkColor to the script? BTW, it's MUCH easier to get the color if you keep track of it with a variable when you set the color. $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Button1 = GUICtrlCreateButton("Button1", 104, 112, 75, 25) $iBkColor = 0x00FF00 GUICtrlSetBkColor($Button1, $iBkColor) GUISetState(@SW_SHOW) sleep(1000) ;~ $iColor = GUICtrlGetBkColor($Button1) ; Pass the controldid to the function. MsgBox("", '', 'Background Color: ' & _ConvertToHexFormat($iBkColor))
    1 point
  12. This will do it, adding a leading zero to the number in the input control. While 1 Switch GUIGetMsg() Case $GUI_Event_Close, $cancel Exit Case $Ok Local $read1 = GUICtrlRead($Inp1) If $read1 >= 1 Then $read1 = ($read1 * 60) * 60 Local $read2 = GUICtrlRead($Inp2) If $read2 >= 1 Then $read2 = $read2 * 60 Local $read3 = GUICtrlRead($Inp3) GUIDelete($wGoto) Return $read1 + $read2 + $read3 Exit Case $Inp1 ; <<<<<<<<<<<<<<<<<<<<<< $Temp = GUICtrlRead($Inp1) ; <<<<<<<<<<<<<<<<<<<<<< GUICtrlSetData($Inp1, StringFormat("%02i", $Temp)) ; <<<<<<<<<<<<<<<<<<<<<< EndSwitch WEnd The last three lines will modify the number in $Inp1 when you change it, and it's 9 or under.
    1 point
  13. For the fun $s = FileRead("IDArray.csv") For $i = 0 to 8 $k = StringRegExpReplace($s, '(?imx)^(\d+|key) , (?:\w*,){' & $i & '} , .*$\R?', "") $k = StringRegExpReplace($k, '(?imx)^(\d+|key) , (?:\w*,){' & $i & '} (\w+) .*$', "$1,$2") ; Msgbox(0,"", $k) FileWrite("IDArray_ID" & $i+1 & ".csv", $k) Next Will this work on a 200k rows text ? I don't know ...
    1 point
  14. Add this to top of _WM_NOTIFY function and it should work: Local Const $tagNMLVKEYDOWN = $tagNMHDR & ";word VKey;uint Flags"
    1 point
  15. RTFC

    _ArraySort problem

    It's the other way around; if you suffer from memory loss you may forget to close the handle.
    1 point
  16. a other way is to do this with _ArraySearch in a 2D-array: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Array.au3> GUICreate("Hexinfo", 300, 50) Local $idComboBox = GUICtrlCreateCombo("", 10, 10, 185, 20) GUICtrlSetData($idComboBox, "White|Red|Green|Black") GUISetState(@SW_SHOW) Local $sComboRead = "" Local $arr[4][2] $arr[0][0] = 0xFFFFFF $arr[1][0] = 0xFF0000 $arr[2][0] = 0x008000 $arr[3][0] = 0x000000 $arr[0][1] = "White" $arr[1][1] = "Red" $arr[2][1] = "Green" $arr[3][1] = "Black" While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) $iFound = _ArraySearch($arr, $sComboRead, 0, 0, 0, 0, 1, 1) MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead & @CRLF & "Hex: " & Hex($arr[$iFound][0]), 0) EndSwitch WEnd
    1 point
  17. kakarotsaiyan, You need to find the index of the selected item within the combo - which means using one of the more advanced UDF functions like this: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiComboBox.au3> HotKeySet("{numpaddot}", "MyExit") ; Easier way to assign array elements Local $arr[4] = ["0xFFFFFF", "0xFF0000", "0x008000", "0x000000"] GUICreate("Hexinfo", 300, 50) Local $idComboBox = GUICtrlCreateCombo("", 10, 10, 185, 20) GUICtrlSetData($idComboBox, "White|Red|Green|Black") GUISetState(@SW_SHOW) Local $sComboRead = "" While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ; You can close the GUI using the [X] like this Exit Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) $iComboSel = _GUICtrlComboBox_GetCurSel($idComboBox) ; Get the index of the selected item - use it to index the array MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead & " [" & $arr[$iComboSel] & "]", 0) EndSwitch WEnd Func MyExit() Exit EndFunc ;==>MyExit Please ask if you have any questions. M23
    1 point
  18. @DonChunior If you change the line FileWriteLine($hTestfile, "Line 3") to FileWriteLine($hTestfile, "Line 3" & @CRLF) the blank line at the end of the file won't be added, since FileWriteLine(), as it is stated in the Help file: And, about the "magic" disappearing of the last line in the file, I think that's the effect of the _FileWriteToLine(), which is written like so: ; #FUNCTION# ==================================================================================================================== ; Author ........: cdkid ; Modified.......: partypooper, MrCreatoR ; =============================================================================================================================== Func _FileWriteToLine($sFilePath, $iLine, $sText, $bOverWrite = False) If $iLine <= 0 Then Return SetError(4, 0, 0) If Not IsString($sText) Then $sText = String($sText) If $sText = "" Then Return SetError(6, 0, 0) EndIf If $bOverWrite = Default Then $bOverWrite = False If Not (IsBool($bOverWrite) Or $bOverWrite = 0 Or $bOverWrite = 1) Then Return SetError(5, 0, 0) ; For old versions. If Not FileExists($sFilePath) Then Return SetError(2, 0, 0) Local $aArray = FileReadToArray($sFilePath) Local $iUBound = UBound($aArray) - 1 If ($iUBound + 1) < $iLine Then Return SetError(1, 0, 0) Local $hFileOpen = FileOpen($sFilePath, FileGetEncoding($sFilePath) + $FO_OVERWRITE) If $hFileOpen = -1 Then Return SetError(3, 0, 0) Local $sData = "" $iLine -= 1 ; Now the array is 0-based, so reduce the line number by 1. For $i = 0 To $iUBound If $i = $iLine Then If $bOverWrite Then If $sText Then $sData &= $sText & @CRLF Else $sData &= $sText & @CRLF & $aArray[$i] & @CRLF EndIf ElseIf $i < $iUBound Then $sData &= $aArray[$i] & @CRLF ElseIf $i = $iUBound Then $sData &= $aArray[$i] EndIf Next FileWrite($hFileOpen, $sData) FileClose($hFileOpen) Return 1 EndFunc ;==>_FileWriteToLine
    1 point
  19. Jos

    Send email with files

    The warnings are from the Goggle Side, not the Clients side, so that is controlled in Google. When you have two factor authentication enabled, you need to generate a separate password for this batch process, which can be done in your gmail config. Jos
    1 point
  20. Jos

    Send email with files

    .. or use the __InetSmtpMailCom() UDF available in Examples when you want to use Gmail without having outlook. Jos
    1 point
  21. Hi @luis713 Did you already take a look at Outlook UDF or at this post?
    1 point
  22. check this thread and this solution. you could have a compiled exe as a scheduled task to do this. very fast
    1 point
  23. @mattsk42 In the While 1 loop, you should not do the declaration of the Function, but only the call... So, you can do the declaration below the While 1 loop, and then, when the user presses the $Submit button, you call the funcion "_Sendmail()". Happy to have helped
    1 point
  24. Project is still alive and thus I want to announce version v1.80 Build 2018-07-20 after a long period of absence. If you are interested have to look to post #1.
    1 point
  25. Cotino

    WSA error to text

    Hi, I was playing with TCP functions and noticed that if it failed it only gave the WSA error number without any additional info. So I made this function that returns extended info about a WSA error number in an array. Just input the WSA error code and get an array such as : [0] error number [1] error name [2] error title [3] error description If the input isn't a number, return 0 and set error to 1 If the input couldn't be found, return 0 and set error to 2 Here's the function : Func WSAerrorToText($error) If NOT IsNumber($error) Then Return SetError(2, 0, 0) Local $return[4] = [$error, "Unknown", "Unknown", "Unknown"] Switch $error Case 6 $return[1] = "WSA_INVALID_HANDLE" $return[2] = "Specified event object handle is invalid" $return[3] = "An application attempts to use an event object, but the specified handle is not valid. Note that this error is returned by the operating system, so the error number may change in future releases of Windows." Case 8 $return[1] = "WSA_NOT_ENOUGH_MEMORY" $return[2] = "Insufficient memory available" $return[3] = "An application used a Windows Sockets function that directly maps to a Windows function. The Windows function is indicating a lack of required memory resources. Note that this error is returned by the operating system, so the error number may change in future releases of Windows." Case 87 $return[1] = "WSA_INVALID_PARAMETER" $return[2] = "One or more parameters are invalid" $return[3] = "An application used a Windows Sockets function which directly maps to a Windows function. The Windows function is indicating a problem with one or more parameters. Note that this error is returned by the operating system, so the error number may change in future releases of Windows." Case 995 $return[1] = "WSA_OPERATION_ABORTED" $return[2] = "Overlapped operation aborted" $return[3] = "An overlapped operation was canceled due to the closure of the socket, or the execution of the SIO_FLUSH command in [WSAIoctl](/windows/desktop/api/Winsock2/nf-winsock2-wsaioctl). Note that this error is returned by the operating system, so the error number may change in future releases of Windows." Case 996 $return[1] = "WSA_IO_INCOMPLETE" $return[2] = "Overlapped I/O event object not in signaled state" $return[3] = "The application has tried to determine the status of an overlapped operation which is not yet completed. Applications that use [WSAGetOverlappedResult](/windows/desktop/api/Winsock2/nf-winsock2-wsagetoverlappedresult) (with the fWait flag set to FALSE) in a polling mode to determine when an overlapped operation has completed, get this error code until the operation is complete. Note that this error is returned by the operating system, so the error number may change in future releases of Windows." Case 997 $return[1] = "WSA_IO_PENDING" $return[2] = "Overlapped operations will complete later" $return[3] = "The application has initiated an overlapped operation that cannot be completed immediately. A completion indication will be given later when the operation has been completed. Note that this error is returned by the operating system, so the error number may change in future releases of Windows." Case 10004 $return[1] = "WSAEINTR" $return[2] = "Interrupted function call" $return[3] = "A blocking operation was interrupted by a call to [WSACancelBlockingCall](/windows/desktop/api/winsock2/nf-winsock2-wsacancelblockingcall)." Case 10009 $return[1] = "WSAEBADF" $return[2] = "File handle is not valid" $return[3] = "The file handle supplied is not valid." Case 10013 $return[1] = "WSAEACCES" $return[2] = "Permission denied" $return[3] = "An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for [sendto](/windows/desktop/api/winsock/nf-winsock-sendto) without broadcast permission being set using [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt)(SO_BROADCAST). Another possible reason for the WSAEACCES error is that when the [bind](/windows/desktop/api/winsock/nf-winsock-bind) function is called (on Windows NT 4.0 with SP4 and later), another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4.0 with SP4 and later, and is implemented by using the [SO_EXCLUSIVEADDRUSE](so-exclusiveaddruse.md) option." Case 10014 $return[1] = "WSAEFAULT" $return[2] = "Bad address" $return[3] = "The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a [sockaddr](sockaddr-2.md) structure, is smaller than the sizeof(sockaddr)." Case 10022 $return[1] = "WSAEINVAL" $return[2] = "Invalid argument" $return[3] = "Some invalid argument was supplied (for example, specifying an invalid level to the [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt) function). In some instances, it also refers to the current state of the socket—for instance, calling [accept](/windows/desktop/api/Winsock2/nf-winsock2-accept) on a socket that is not listening." Case 10024 $return[1] = "WSAEMFILE" $return[2] = "Too many open files" $return[3] = "Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process, or per thread." Case 10035 $return[1] = "WSAEWOULDBLOCK" $return[2] = "Resource temporarily unavailable" $return[3] = "This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example [recv](/windows/desktop/api/winsock/nf-winsock-recv) when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling [connect](/windows/desktop/api/Winsock2/nf-winsock2-connect) on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established." Case 10036 $return[1] = "WSAEINPROGRESS" $return[2] = "Operation now in progress" $return[3] = "A blocking operation is currently executing. Windows Sockets only allows a single blocking operation—per- task or thread—to be outstanding, and if any other function call is made (whether or not it references that or any other socket) the function fails with the WSAEINPROGRESS error." Case 10037 $return[1] = "WSAEALREADY" $return[2] = "Operation already in progress" $return[3] = "An operation was attempted on a nonblocking socket with an operation already in progress—that is, calling [connect](/windows/desktop/api/Winsock2/nf-winsock2-connect) a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed." Case 10038 $return[1] = "WSAENOTSOCK" $return[2] = "Socket operation on nonsocket" $return[3] = "An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for [select](/windows/desktop/api/Winsock2/nf-winsock2-select), a member of an fd_set was not valid." Case 10039 $return[1] = "WSAEDESTADDRREQ" $return[2] = "Destination address required" $return[3] = "A required address was omitted from an operation on a socket. For example, this error is returned if [sendto](/windows/desktop/api/winsock/nf-winsock-sendto) is called with the remote address of ADDR_ANY." Case 10040 $return[1] = "WSAEMSGSIZE" $return[2] = "Message too long" $return[3] = "A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself." Case 10041 $return[1] = "WSAEPROTOTYPE" $return[2] = "Protocol wrong type for socket" $return[3] = "A protocol was specified in the [socket](/windows/desktop/api/Winsock2/nf-winsock2-socket) function call that does not support the semantics of the socket type requested. For example, the ARPA Internet UDP protocol cannot be specified with a socket type of SOCK_STREAM." Case 10042 $return[1] = "WSAENOPROTOOPT" $return[2] = "Bad protocol option" $return[3] = "An unknown, invalid or unsupported option or level was specified in a [getsockopt](/windows/desktop/api/winsock/nf-winsock-getsockopt) or [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt) call." Case 10043 $return[1] = "WSAEPROTONOSUPPORT" $return[2] = "Protocol not supported" $return[3] = "The requested protocol has not been configured into the system, or no implementation for it exists. For example, a [socket](/windows/desktop/api/Winsock2/nf-winsock2-socket) call requests a SOCK_DGRAM socket, but specifies a stream protocol." Case 10044 $return[1] = "WSAESOCKTNOSUPPORT" $return[2] = "Socket type not supported" $return[3] = "The support for the specified socket type does not exist in this address family. For example, the optional type SOCK_RAW might be selected in a [socket](/windows/desktop/api/Winsock2/nf-winsock2-socket) call, and the implementation does not support SOCK_RAW sockets at all." Case 10045 $return[1] = "WSAEOPNOTSUPP" $return[2] = "Operation not supported" $return[3] = "The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket." Case 10046 $return[1] = "WSAEPFNOSUPPORT" $return[2] = "Protocol family not supported" $return[3] = "The protocol family has not been configured into the system or no implementation for it exists. This message has a slightly different meaning from WSAEAFNOSUPPORT. However, it is interchangeable in most cases, and all Windows Sockets functions that return one of these messages also specify WSAEAFNOSUPPORT." Case 10047 $return[1] = "WSAEAFNOSUPPORT" $return[2] = "Address family not supported by protocol family" $return[3] = "An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for Internet Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is returned if an incorrect protocol is explicitly requested in the [socket](/windows/desktop/api/Winsock2/nf-winsock2-socket) call, or if an address of the wrong family is used for a socket, for example, in [sendto](/windows/desktop/api/winsock/nf-winsock-sendto)." Case 10048 $return[1] = "WSAEADDRINUSE" $return[2] = "Address already in use" $return[3] = "Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to [bind](/windows/desktop/api/winsock/nf-winsock-bind) a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt) (SO_REUSEADDR). Client applications usually need not call bind at all—[connect](/windows/desktop/api/Winsock2/nf-winsock2-connect) chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, [listen](/windows/desktop/api/Winsock2/nf-winsock2-listen), [WSAConnect](/windows/desktop/api/Winsock2/nf-winsock2-wsaconnect), or [WSAJoinLeaf](/windows/desktop/api/Winsock2/nf-winsock2-wsajoinleaf)." Case 10049 $return[1] = "WSAEADDRNOTAVAIL" $return[2] = "Cannot assign requested address" $return[3] = "The requested address is not valid in its context. This normally results from an attempt to [bind](/windows/desktop/api/winsock/nf-winsock-bind) to an address that is not valid for the local computer. This can also result from [connect](/windows/desktop/api/Winsock2/nf-winsock2-connect), [sendto](/windows/desktop/api/winsock/nf-winsock-sendto), [WSAConnect](/windows/desktop/api/Winsock2/nf-winsock2-wsaconnect), [WSAJoinLeaf](/windows/desktop/api/Winsock2/nf-winsock2-wsajoinleaf), or [WSASendTo](/windows/desktop/api/Winsock2/nf-winsock2-wsasendto) when the remote address or port is not valid for a remote computer (for example, address or port 0)." Case 10050 $return[1] = "WSAENETDOWN" $return[2] = "Network is down" $return[3] = "A socket operation encountered a dead network. This could indicate a serious failure of the network system (that is, the protocol stack that the Windows Sockets DLL runs over), the network interface, or the local network itself." Case 10051 $return[1] = "WSAENETUNREACH" $return[2] = "Network is unreachable" $return[3] = "A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host." Case 10052 $return[1] = "WSAENETRESET" $return[2] = "Network dropped connection on reset" $return[3] = "The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. It can also be returned by [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt) if an attempt is made to set [SO_KEEPALIVE](so-keepalive.md) on a connection that has already failed." Case 10053 $return[1] = "WSAECONNABORTED" $return[2] = "Software caused connection abort" $return[3] = "An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error." Case 10054 $return[1] = "WSAECONNRESET" $return[2] = "Connection reset by peer" $return[3] = "An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt) for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET." Case 10055 $return[1] = "WSAENOBUFS" $return[2] = "No buffer space available" $return[3] = "An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full." Case 10056 $return[1] = "WSAEISCONN" $return[2] = "Socket is already connected" $return[3] = "A connect request was made on an already-connected socket. Some implementations also return this error if [sendto](/windows/desktop/api/winsock/nf-winsock-sendto) is called on a connected SOCK_DGRAM socket (for SOCK_STREAM sockets, the to parameter in sendto is ignored) although other implementations treat this as a legal occurrence." Case 10057 $return[1] = "WSAENOTCONN" $return[2] = "Socket is not connected" $return[3] = "A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using [sendto](/windows/desktop/api/winsock/nf-winsock-sendto)) no address was supplied. Any other type of operation might also return this error—for example, [setsockopt](/windows/desktop/api/winsock/nf-winsock-setsockopt) setting [SO_KEEPALIVE](so-keepalive.md) if the connection has been reset." Case 10058 $return[1] = "WSAESHUTDOWN" $return[2] = "Cannot send after socket shutdown" $return[3] = "A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous [shutdown](/windows/desktop/api/winsock/nf-winsock-shutdown) call. By calling shutdown a partial close of a socket is requested, which is a signal that sending or receiving, or both have been discontinued." Case 10059 $return[1] = "WSAETOOMANYREFS" $return[2] = "Too many references" $return[3] = "Too many references to some kernel object." Case 10060 $return[1] = "WSAETIMEDOUT" $return[2] = "Connection timed out" $return[3] = "A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond." Case 10061 $return[1] = "WSAECONNREFUSED" $return[2] = "Connection refused" $return[3] = "No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running." Case 10062 $return[1] = "WSAELOOP" $return[2] = "Cannot translate name" $return[3] = "Cannot translate a name." Case 10063 $return[1] = "WSAENAMETOOLONG" $return[2] = "Name too long" $return[3] = "A name component or a name was too long." Case 10064 $return[1] = "WSAEHOSTDOWN" $return[2] = "Host is down" $return[3] = "A socket operation failed because the destination host is down. A socket operation encountered a dead host. Networking activity on the local host has not been initiated. These conditions are more likely to be indicated by the error WSAETIMEDOUT." Case 10065 $return[1] = "WSAEHOSTUNREACH" $return[2] = "No route to host" $return[3] = "A socket operation was attempted to an unreachable host. See WSAENETUNREACH." Case 10066 $return[1] = "WSAENOTEMPTY" $return[2] = "Directory not empty" $return[3] = "Cannot remove a directory that is not empty." Case 10067 $return[1] = "WSAEPROCLIM" $return[2] = "Too many processes" $return[3] = "A Windows Sockets implementation may have a limit on the number of applications that can use it simultaneously. [WSAStartup](/windows/desktop/api/winsock/nf-winsock-wsastartup) may fail with this error if the limit has been reached." Case 10068 $return[1] = "WSAEUSERS" $return[2] = "User quota exceeded" $return[3] = "Ran out of user quota." Case 10069 $return[1] = "WSAEDQUOT" $return[2] = "Disk quota exceeded" $return[3] = "Ran out of disk quota." Case 10070 $return[1] = "WSAESTALE" $return[2] = "Stale file handle reference" $return[3] = "The file handle reference is no longer available." Case 10071 $return[1] = "WSAEREMOTE" $return[2] = "Item is remote" $return[3] = "The item is not available locally." Case 10091 $return[1] = "WSASYSNOTREADY" $return[2] = "Network subsystem is unavailable" $return[3] = "This error is returned by [WSAStartup](/windows/desktop/api/winsock/nf-winsock-wsastartup) if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check: " & @CRLF & "•That the appropriate Windows Sockets DLL file is in the current path." & @CRLF & "•That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded." & @CRLF & "•The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly." Case 10092 $return[1] = "WSAVERNOTSUPPORTED" $return[2] = "Winsock" $return[3] = "dll version out of range.The current Windows Sockets implementation does not support the Windows Sockets specification version requested by the application. Check that no old Windows Sockets DLL files are being accessed." Case 10093 $return[1] = "WSANOTINITIALISED" $return[2] = "Successful WSAStartup not yet performed" $return[3] = "Either the application has not called [WSAStartup](/windows/desktop/api/winsock/nf-winsock-wsastartup) or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or [WSACleanup](/windows/desktop/api/winsock/nf-winsock-wsacleanup) has been called too many times." Case 10101 $return[1] = "WSAEDISCON" $return[2] = "Graceful shutdown in progress" $return[3] = "Returned by [WSARecv](/windows/desktop/api/Winsock2/nf-winsock2-wsarecv) and [WSARecvFrom](/windows/desktop/api/Winsock2/nf-winsock2-wsarecvfrom) to indicate that the remote party has initiated a graceful shutdown sequence." Case 10102 $return[1] = "WSAENOMORE" $return[2] = "No more results" $return[3] = "No more results can be returned by the [WSALookupServiceNext](/windows/desktop/api/Winsock2/nf-winsock2-wsalookupservicenexta) function." Case 10103 $return[1] = "WSAECANCELLED" $return[2] = "Call has been canceled" $return[3] = "A call to the [WSALookupServiceEnd](/windows/desktop/api/Winsock2/nf-winsock2-wsalookupserviceend) function was made while this call was still processing. The call has been canceled." Case 10104 $return[1] = "WSAEINVALIDPROCTABLE" $return[2] = "Procedure call table is invalid" $return[3] = "The service provider procedure call table is invalid. A service provider returned a bogus procedure table to Ws2_32.dll. This is usually caused by one or more of the function pointers being NULL." Case 10105 $return[1] = "WSAEINVALIDPROVIDER" $return[2] = "Service provider is invalid" $return[3] = "The requested service provider is invalid. This error is returned by the [WSCGetProviderInfo](/windows/desktop/api/Ws2spi/nf-ws2spi-wscgetproviderinfo) and [WSCGetProviderInfo32](/windows/desktop/api/Ws2spi/nf-ws2spi-wscgetproviderinfo32) functions if the protocol entry specified could not be found. This error is also returned if the service provider returned a version number other than 2.0." Case 10106 $return[1] = "WSAEPROVIDERFAILEDINIT" $return[2] = "Service provider failed to initialize" $return[3] = "The requested service provider could not be loaded or initialized. This error is returned if either a service provider's DLL could not be loaded ([LoadLibrary](https://msdn.microsoft.com/en-us/library/ms684175(v=VS.85).aspx) failed) or the provider's [WSPStartup](/windows/desktop/api/Ws2spi/nf-ws2spi-wspstartup) or [NSPStartup](/windows/desktop/api/Ws2spi/nf-ws2spi-nspstartup) function failed." Case 10107 $return[1] = "WSASYSCALLFAILURE" $return[2] = "System call failure" $return[3] = "A system call that should never fail has failed. This is a generic error code, returned under various conditions. Returned when a system call that should never fail does fail. For example, if a call to [WaitForMultipleEvents](/windows/desktop/api/Winsock2/nf-winsock2-wsawaitformultipleevents) fails or one of the registry functions fails trying to manipulate the protocol/namespace catalogs. Returned when a provider does not return SUCCESS and does not provide an extended error code. Can indicate a service provider implementation error." Case 10108 $return[1] = "WSASERVICE_NOT_FOUND" $return[2] = "Service not found" $return[3] = "No such service is known. The service cannot be found in the specified name space." Case 10109 $return[1] = "WSATYPE_NOT_FOUND" $return[2] = "Class type not found" $return[3] = "The specified class was not found." Case 10110 $return[1] = "WSA_E_NO_MORE" $return[2] = "No more results" $return[3] = "No more results can be returned by the [WSALookupServiceNext](/windows/desktop/api/Winsock2/nf-winsock2-wsalookupservicenexta) function." Case 10111 $return[1] = "WSA_E_CANCELLED" $return[2] = "Call was canceled" $return[3] = "A call to the [WSALookupServiceEnd](/windows/desktop/api/Winsock2/nf-winsock2-wsalookupserviceend) function was made while this call was still processing. The call has been canceled." Case 10112 $return[1] = "WSAEREFUSED" $return[2] = "Database query was refused" $return[3] = "A database query failed because it was actively refused." Case 11001 $return[1] = "WSAHOST_NOT_FOUND" $return[2] = "Host not found" $return[3] = "No such host is known. The name is not an official host name or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means that the specified name could not be found in the relevant database." Case 11002 $return[1] = "WSATRY_AGAIN" $return[2] = "Nonauthoritative host not found" $return[3] = "This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful." Case 11003 $return[1] = "WSANO_RECOVERY" $return[2] = "This is a nonrecoverable error" $return[3] = "This indicates that some sort of nonrecoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found, or a DNS request was returned by the server with a severe error." Case 11004 $return[1] = "WSANO_DATA" $return[2] = "Valid name, no data record of requested type" $return[3] = "The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using [gethostbyname](/windows/desktop/api) or [WSAAsyncGetHostByName](/windows/desktop/api)) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable." Case 11005 $return[1] = "WSA_QOS_RECEIVERS" $return[2] = "QoS receivers" $return[3] = "At least one QoS reserve has arrived." Case 11006 $return[1] = "WSA_QOS_SENDERS" $return[2] = "QoS senders" $return[3] = "At least one QoS send path has arrived." Case 11007 $return[1] = "WSA_QOS_NO_SENDERS" $return[2] = "No QoS senders" $return[3] = "There are no QoS senders." Case 11008 $return[1] = "WSA_QOS_NO_RECEIVERS" $return[2] = "QoS no receivers" $return[3] = "There are no QoS receivers." Case 11009 $return[1] = "WSA_QOS_REQUEST_CONFIRMED" $return[2] = "QoS request confirmed" $return[3] = "The QoS reserve request has been confirmed." Case 11010 $return[1] = "WSA_QOS_ADMISSION_FAILURE" $return[2] = "QoS admission error" $return[3] = "A QoS error occurred due to lack of resources." Case 11011 $return[1] = "WSA_QOS_POLICY_FAILURE" $return[2] = "QoS policy failure" $return[3] = "The QoS request was rejected because the policy system couldn't allocate the requested resource within the existing policy." Case 11012 $return[1] = "WSA_QOS_BAD_STYLE" $return[2] = "QoS bad style" $return[3] = "An unknown or conflicting QoS style was encountered." Case 11013 $return[1] = "WSA_QOS_BAD_OBJECT" $return[2] = "QoS bad object" $return[3] = "A problem was encountered with some part of the filterspec or the provider-specific buffer in general." Case 11014 $return[1] = "WSA_QOS_TRAFFIC_CTRL_ERROR" $return[2] = "QoS traffic control error" $return[3] = "An error with the underlying traffic control (TC) API as the generic QoS request was converted for local enforcement by the TC API. This could be due to an out of memory error or to an internal QoS provider error." Case 11015 $return[1] = "WSA_QOS_GENERIC_ERROR" $return[2] = "QoS generic error" $return[3] = "A general QoS error." Case 11016 $return[1] = "WSA_QOS_ESERVICETYPE" $return[2] = "QoS service type error" $return[3] = "An invalid or unrecognized service type was found in the QoS flowspec." Case 11017 $return[1] = "WSA_QOS_EFLOWSPEC" $return[2] = "QoS flowspec error" $return[3] = "An invalid or inconsistent flowspec was found in the [QOS](https://msdn.microsoft.com/en-US/library/Aa374024(v=VS.80).aspx) structure." Case 11018 $return[1] = "WSA_QOS_EPROVSPECBUF" $return[2] = "Invalid QoS provider buffer" $return[3] = "An invalid QoS provider-specific buffer." Case 11019 $return[1] = "WSA_QOS_EFILTERSTYLE" $return[2] = "Invalid QoS filter style" $return[3] = "An invalid QoS filter style was used." Case 11020 $return[1] = "WSA_QOS_EFILTERTYPE" $return[2] = "Invalid QoS filter type" $return[3] = "An invalid QoS filter type was used." Case 11021 $return[1] = "WSA_QOS_EFILTERCOUNT" $return[2] = "Incorrect QoS filter count" $return[3] = "An incorrect number of QoS FILTERSPECs were specified in the FLOWDESCRIPTOR." Case 11022 $return[1] = "WSA_QOS_EOBJLENGTH" $return[2] = "Invalid QoS object length" $return[3] = "An object with an invalid ObjectLength field was specified in the QoS provider-specific buffer." Case 11023 $return[1] = "WSA_QOS_EFLOWCOUNT" $return[2] = "Incorrect QoS flow count" $return[3] = "An incorrect number of flow descriptors was specified in the QoS structure." Case 11024 $return[1] = "WSA_QOS_EUNKOWNPSOBJ" $return[2] = "Unrecognized QoS object" $return[3] = "An unrecognized object was found in the QoS provider-specific buffer." Case 11025 $return[1] = "WSA_QOS_EPOLICYOBJ" $return[2] = "Invalid QoS policy object" $return[3] = "An invalid policy object was found in the QoS provider-specific buffer." Case 11026 $return[1] = "WSA_QOS_EFLOWDESC" $return[2] = "Invalid QoS flow descriptor" $return[3] = "An invalid QoS flow descriptor was found in the flow descriptor list." Case 11027 $return[1] = "WSA_QOS_EPSFLOWSPEC" $return[2] = "Invalid QoS provider-specific flowspec" $return[3] = "An invalid or inconsistent flowspec was found in the QoS provider-specific buffer." Case 11028 $return[1] = "WSA_QOS_EPSFILTERSPEC" $return[2] = "Invalid QoS provider-specific filterspec" $return[3] = "An invalid FILTERSPEC was found in the QoS provider-specific buffer." Case 11029 $return[1] = "WSA_QOS_ESDMODEOBJ" $return[2] = "Invalid QoS shape discard mode object" $return[3] = "An invalid shape discard mode object was found in the QoS provider-specific buffer." Case 11030 $return[1] = "WSA_QOS_ESHAPERATEOBJ" $return[2] = "Invalid QoS shaping rate object" $return[3] = "An invalid shaping rate object was found in the QoS provider-specific buffer." Case 11031 $return[1] = "WSA_QOS_RESERVED_PETYPE" $return[2] = "Reserved policy QoS element type" $return[3] = "A reserved policy element was found in the QoS provider-specific buffer." Case Else SetError(1) EndSwitch Return $return EndFunc Example : #include "WSAerrorToText.au3" TCPStartup() TCPConnect("127.0.0.1", 1) If @error Then Local $WSAerror = WSAerrorToText(@error) MsgBox(0, $WSAerror[0] & " | " & $WSAerror[1], $WSAerror[2] & @CRLF & $WSAerror[3]) Else MsgBox(0, "", "No error") EndIf TCPShutdown()
    1 point
  26. Hello i have searched a lot about how to run external programs with the administrator privileges without the script running with administrator privileges using autoit But all my attempts failed Finally, today I found the VBS function doing this task I immediately transferred it to our beloved language (autoit) and i decided to share it with you i hope you like it This is a simple example about how to use the function runAsAdmin("cmd.exe", "/c @echo off & cls & echo test & pause", "c:\", @sw_show) this is the function func runAsAdmin($program, $parameters = "", $workingDir = @workingDir, $show = "") local $oShell = OBJCreate("Shell.Application") if isOBJ($oShell) then local $result = $oShell.ShellExecute($program, $parameters, $workingDir, "runas", $show) else $result = false endIf return $result endFunc
    1 point
  27. ShellExecute("notepad.exe", "", "", "runas")
    1 point
  28. Uploaded another update (4th upload), but please note that not everything new is working yet ... or only partially. The middle portion of the GUI features the new Series fields, and an incomplete blank section. First field (List) displays the authors belonging to the selected series. The second List, the Series names, which when one is selected also shows the ebooks belonging to that series On program start, all series in the selected library, are shown in the Series list. Select an Author though, and only the Series for that Author are shown.
    1 point
  29. Added a few more examples.
    1 point
  30. MacG

    Joystick UDF

    I use this UDF improved by Adam1213 for my program and it works fine. But for Windows 10 I need the Joystick DeviceID. It changes at every system start I have found this another Joystick topic and used only the part for the ID. But it doesn't work. #include <GUIConstants.au3> #include <MsgBoxConstants.au3> Local $JoyID $JoyID = JoyGetID($JoyID) MsgBox(262208, "TS", "The Joystick DeviceID is: " & $JoyID) Exit ;************************************************************** ; Joystick Support by Norberto Gabriel Alvarez Raynald ; Made with AUTOIT V3.1.111 (I love it!) ; Contact: elgabionline-inbox@yahoo.com.ar ;************************************************************** Func JoyMaxNumber() ;Maximum number of joysticks supported by system $Str_Dll_Winmm = DllStructCreate("int") $Dll_Winmm = DllOpen(@SystemDir & "\winmm.dll") $Joystick = DllCall($Dll_Winmm, "int", "joyGetNumDevs", "int", 0) Select Case @error $Str_Dll_Winmm = 0 Return 0 Case Else DllStructSetData($Str_Dll_Winmm, 1, $Joystick[0]) $MaxNumber = DllStructGetData($Str_Dll_Winmm, 1) DllClose($Dll_Winmm) $Str_Dll_Winmm = 0 Return $MaxNumber EndSelect EndFunc ;==>JoyMaxNumber ;************************************************************** ; JoyGetID ($Joy_number) ; $Joy_number: how You want get ID. Put a number, 1 or 2... to JoyMaxNumber () ;~ Return -2 if Joystick not found or -3 if input param is wrong ; ********************************************************** Func JoyGetID($Joy_number) ;Get ID from Joystick driver (values between -1 and 15) $Max = (JoyMaxNumber() + 1) ;MacG added 1 because of: "how You want get ID. Put a number, 1 or 2... to JoyMaxNumber ()" If $Max < $Joy_number Or Not StringIsDigit($Joy_number) Then Return -3 If $Joy_number < 1 Then Return -3 $Str_Dll_Winmm = DllStructCreate("int") $Dll_Winmm = DllOpen(@SystemDir & "\winmm.dll") $ID = DllCall($Dll_Winmm, "int", "joyGetPos", "int", $Joy_number - 1) Select Case @error $Str_Dll_Winmm = 0 DllClose($Dll_Winmm) Return -2 Case Else DllStructSetData($Str_Dll_Winmm, 1, $ID[0]) $NumID = DllStructGetData($Str_Dll_Winmm, 1) DllClose($Dll_Winmm) $Str_Dll_Winmm = 0 Return $NumID EndSelect EndFunc ;==>JoyGetID
    1 point
  31. autoitter

    sound level sampling

    Maybe you can use the Bass UDF to get the samples?
    1 point
  32. @Cormin when replying please just hit the Reply button rather than quoting what everyone says. We know what we said (we were there when we said it), and it pads the thread needlessly.
    0 points
×
×
  • Create New...