Leaderboard
Popular Content
Showing content with the highest reputation on 11/19/2018 in all areas
-
Version 1.6.3.0
17,764 downloads
Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort1 point -
cURL UDF - a UDF for transferring data with URL syntax
Liuzi reacted to seangriffin for a topic
Greetings everyone, I'd like to start my own cURL UDF, with a focus on a nice and simple syntax. There are many other cURL samples in the forum, though I found them too difficult to understand and use. This UDF uses the libcurl library, as opposed to the cURL command-line tool, to provide better integration with AutoIT and better performance. REQUIREMENTS: Windows 32-bit (not tested under Windows 64-bit but may work if a 64-bit version of libcurl below is used) AutoIt3 3.2 or higher libcurl v7.21.7 or higher (libcurl.dll, libeay32.dll & libssl32.dll) - see http://curl.haxx.se or download link below LIST OF FUNCTIONS: EXAMPLES: Note - To make these examples work, you must make sure the three libcurl DLLs (libcurl.dll, libeay32.dll & libssl32.dll) are present in the same folder as the examples. Example #1 - Reading HTML from a webpage. #include <cURL.au3> ; Initialise cURL cURL_initialise() ; Return the HTML from "http://www.autoitscript.com/site" $response = cURL_easy("http://www.autoitscript.com/site/") ; Output the response to the console ConsoleWrite("HTTP Response Code = " & $response[0] & @CRLF) ConsoleWrite("HTTP Response Headers = " & $response[1] & @CRLF) ConsoleWrite("HTTP Response Data = " & $response[2] & @CRLF) ; Clean up cURL cURL_cleanup() Example #2 - Reading a binary file from a website. #include <cURL.au3> ; Initialise cURL cURL_initialise() ; Output the file from "http://web.aanet.com.au/seangriffin/content/computing/development/eBay%20Bargain%20Hunter%20setup.exe" to "tmp.exe" cURL_easy("http://web.aanet.com.au/seangriffin/content/computing/development/eBay%20Bargain%20Hunter%20setup.exe", "", 0, 1, "tmp.exe") ; Clean up cURL cURL_cleanup() Example #3 - Reading HTML from a webpage, and writing the cookie to a file. #include <cURL.au3> ; Initialise cURL cURL_initialise() ; Return the response from "http://www.about.com", and the cookie to the file "cookie.txt" $response = cURL_easy("http://www.about.com", "cookie.txt", 2) ; Output the response to the console ConsoleWrite("HTTP Response Code = " & $response[0] & @CRLF) ConsoleWrite("HTTP Response Headers = " & $response[1] & @CRLF) ConsoleWrite("HTTP Response Data = " & $response[2] & @CRLF) ; Clean up cURL cURL_cleanup() DOWNLOAD: Recent Version of libcurl.dll, libeay32.dll & libssl32.dll (required) http://fossies.org/windows/www/curl-7.24.0-ssl-sspi-zlib-static-bin-w32.zip Latest Version - v0.3 (03/04/16) cURL.au31 point -
[FUNC] Bitlocker Drive Info
ERCEduTech reacted to colombeen for a topic
Hi everyone, I created a function to gather bitlocker information. It can tell you whether or not a drive is protected, which encryption method is being used, ... I tried to cover all the details in the function description The function (and 3 "internal" functions) : ; #FUNCTION# ==================================================================================================================== ; Name...........: _BitlockerDriveInfo ; Description ...: Get Bitlocker information for one or multiple drives ; Syntax.........: _BitlockerDriveInfo([$sDrive[, $sComputer = @ComputerName[, $bDebug = False]]]) ; Parameters ....: $sDrive - Optional: The drive. Allowed values are: ; |"" - Get the info for all available drives ; |Letter: - Get the info for the specific drive ; $sComputer - Optional: The computer from which the info should be requested ; $bDebug - Optional: Shows the hex ReturnValue from the WMI methods if set to True ; Return values .: Success - Returns a 2D array with the following information ; |[string] Drive Letter ; |[string] Drive Label ; |[string] Volume Type ; |[bool] Initialized For Protection ; |[string] Protection Status ; |[string] Lock Status ; |[bool] Auto Unlock Enabled ; |[bool] Auto Unlock Key Stored ; |[string] Conversion Status ; |[string] Encryption Method ; |[int] Encryption Percentage ; |[string] Wiping Status ; |[int] Wiping Percentage ; |[array] Key Protectors (Or [string] "None" if the drive isn't protected) ; Failure - 0, sets @error to: ; |1 - There was an issue retrieving the COM object. @extended returns error code from ObjGet ; |2 - The specified drive in $Drive doesn't exist ; |3 - There was an issue running the WMI query ; Author ........: colombeen ; Modified.......: ; Remarks .......: Requires to be run with admin elevation. Windows Vista or newer! ; A BIG THANKS to everyone from the community who contributed! ; Related .......: ; Link ..........: ; Example .......: #include <Array.au3> ; $Header = "Drive Letter|Drive Label|Volume Type|Initialized For Protection|Protection Status|" & _ ; "Lock Status|Auto Unlock Enabled|Auto Unlock Key Stored|Conversion Status|Encryption " & _ ; "Method|Encryption Percentage|Wiping Status|Wiping Percentage|Key Protectors" ; _ArrayDisplay(_BitlockerDriveInfo(), "Bitlocker Drive Info", "", 64, Default, $Header) ; =============================================================================================================================== Func _BitlockerDriveInfo($sDrive = "", $sComputer = @ComputerName, $bDebug = False) Local $aConversionStatusMsg[7] = ["Unknown", "Fully Decrypted", "Fully Encrypted", "Encryption In Progress", "Decryption In Progress", "Encryption Paused", "Decryption Paused"] Local $aEncryptionMethodMsg[9] = ["Unknown", "None", "AES_128_WITH_DIFFUSER", "AES_256_WITH_DIFFUSER", "AES_128", "AES_256", "HARDWARE_ENCRYPTION", "XTS_AES_128", "XTS_AES_256"] Local $aKeyProtectorTypeMsg[11] = ["Unknown or other protector type", "Trusted Platform Module (TPM)", "External key", "Numerical password", "TPM And PIN", "TPM And Startup Key", "TPM And PIN And Startup Key", "Public Key", "Passphrase", "TPM Certificate", "CryptoAPI Next Generation (CNG) Protector"] Local $aLockStatusMsg[3] = ["Unknown", "Unlocked", "Locked"] Local $aProtectionStatusMsg[3] = ["Unprotected", "Protected", "Unknown"] Local $aVolumeTypeMsg[3] = ["Operating System Volume", "Fixed Data Volume", "Portable Data Volume"] Local $aWipingStatusMsg[5] = ["Unknown", "Free Space Not Wiped", "Free Space Wiped", "Free Space Wiping In Progress", "Free Space Wiping Paused"] Local $iRow = 0 Local $sRunMethod, $objWMIService, $objWMIQuery, $sDriveFilter, $iProtectionStatus, $iLockStatus, $bIsAutoUnlockEnabled, $bIsAutoUnlockKeyStored, $iConversionStatus, $iEncryptionPercentage, $iEncryptionFlags, $iWipingStatus, $iWipingPercentage, $iEncryptionMethod, $aVolumeKeyProtectorID, $aVolumeKeyProtectors, $iKeyProtectorType $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & $sComputer & "\root\CIMV2\Security\MicrosoftVolumeEncryption") If @error Then Return SetError(1, @error, 0) If $sDrive <> "" Then Local $iDriveType = _WMIPropertyValue("DriveType", "Win32_LogicalDisk", "WHERE DeviceID='" & $sDrive & "'", Default, $sComputer) If @error Or ($iDriveType <> 2 And $iDriveType <> 3) Then Return SetError(2, 0, 0) $sDriveFilter = " WHERE DriveLetter='" & $sDrive & "'" EndIf $objWMIQuery = $objWMIService.ExecQuery("SELECT * FROM Win32_EncryptableVolume" & $sDriveFilter, "WQL", 0) If Not IsObj($objWMIQuery) Then Return SetError(3, 0, 0) Local $aResult[$objWMIQuery.count][14] For $objDrive In $objWMIQuery If $bDebug Then ConsoleWrite(@CRLF & "+> " & $objDrive.DriveLetter & @CRLF) If _WMIMethodExists($objDrive, "GetConversionStatus") Then $sRunMethod = $objDrive.GetConversionStatus($iConversionStatus, $iEncryptionPercentage, $iEncryptionFlags, $iWipingStatus, $iWipingPercentage) If $bDebug Then ConsoleWrite("!> GetConversionStatus 0x" & Hex($sRunMethod) & @CRLF) Else $iConversionStatus = -1 $iWipingStatus = -1 $iEncryptionPercentage = 0 $iWipingPercentage = 0 EndIf If _WMIMethodExists($objDrive, "GetEncryptionMethod") Then $sRunMethod = $objDrive.GetEncryptionMethod($iEncryptionMethod) If $bDebug Then ConsoleWrite("!> GetEncryptionMethod 0x" & Hex($sRunMethod) & @CRLF) Else $iEncryptionMethod = 0 EndIf If _WMIMethodExists($objDrive, "GetKeyProtectors") Then $sRunMethod = $objDrive.GetKeyProtectors("0", $aVolumeKeyProtectorID) If $bDebug Then ConsoleWrite("!> GetKeyProtectors 0x" & Hex($sRunMethod) & @CRLF) Else $aVolumeKeyProtectorID = 0 EndIf If _WMIMethodExists($objDrive, "GetLockStatus") Then $sRunMethod = $objDrive.GetLockStatus($iLockStatus) If $bDebug Then ConsoleWrite("!> GetLockStatus 0x" & Hex($sRunMethod) & @CRLF) Else $iLockStatus = -1 EndIf If _WMIMethodExists($objDrive, "GetProtectionStatus") Then $sRunMethod = $objDrive.GetProtectionStatus($iProtectionStatus) If $bDebug Then ConsoleWrite("!> GetProtectionStatus 0x" & Hex($sRunMethod) & @CRLF) Else $iProtectionStatus = 2 EndIf If _WMIMethodExists($objDrive, "IsAutoUnlockEnabled") Then $sRunMethod = $objDrive.IsAutoUnlockEnabled($bIsAutoUnlockEnabled) If $bDebug Then ConsoleWrite("!> IsAutoUnlockEnabled 0x" & Hex($sRunMethod) & @CRLF) Else $bIsAutoUnlockEnabled = "Unknown" EndIf If _WMIMethodExists($objDrive, "IsAutoUnlockKeyStored") Then $sRunMethod = $objDrive.IsAutoUnlockKeyStored($bIsAutoUnlockKeyStored) If $bDebug Then ConsoleWrite("!> IsAutoUnlockKeyStored 0x" & Hex($sRunMethod) & @CRLF) Else $bIsAutoUnlockKeyStored = "Unknown" EndIf If IsArray($aVolumeKeyProtectorID) And UBound($aVolumeKeyProtectorID) > 0 Then Dim $aVolumeKeyProtectors[UBound($aVolumeKeyProtectorID)][2] For $i = 0 To UBound($aVolumeKeyProtectorID) - 1 $aVolumeKeyProtectors[$i][0] = $aVolumeKeyProtectorID[$i] If _WMIMethodExists($objDrive, "GetKeyProtectorType") Then If $objDrive.GetKeyProtectorType($aVolumeKeyProtectorID[$i], $iKeyProtectorType) = 0 Then $aVolumeKeyProtectors[$i][1]= $aKeyProtectorTypeMsg[$iKeyProtectorType] Else $aVolumeKeyProtectors[$i][1]= "Unknown" EndIf Else $aVolumeKeyProtectors[$i][1] = "Unknown" EndIf Next Else $aVolumeKeyProtectors = "None" EndIf ; DriveLetter $aResult[$iRow][0] = $objDrive.DriveLetter ; DriveLabel $aResult[$iRow][1] = _WMIPropertyValue("VolumeName", "Win32_LogicalDisk", "WHERE DeviceID='" & $objDrive.DriveLetter & "'", Default, $sComputer) ; VolumeType If _WMIPropertyExists($objDrive, "VolumeType") Then $aResult[$iRow][2] = $aVolumeTypeMsg[$objDrive.VolumeType] Else If $objDrive.DriveLetter = _WMIPropertyValue("SystemDrive", "Win32_OperatingSystem", "", Default, $sComputer) Then $aResult[$iRow][2]= $aVolumeTypeMsg[0] ElseIf _WMIPropertyValue("DriveType", "Win32_LogicalDisk", "WHERE DeviceID='" & $objDrive.DriveLetter & "'", Default, $sComputer) = 3 Then $aResult[$iRow][2]= $aVolumeTypeMsg[1] ElseIf _WMIPropertyValue("DriveType", "Win32_LogicalDisk", "WHERE DeviceID='" & $objDrive.DriveLetter & "'", Default, $sComputer) = 2 Then $aResult[$iRow][2]= $aVolumeTypeMsg[2] Else $aResult[$iRow][2]= "Unknown" EndIf EndIf ; IsVolumeInitializedForProtection If _WMIPropertyExists($objDrive, "IsVolumeInitializedForProtection") Then $aResult[$iRow][3] = $objDrive.IsVolumeInitializedForProtection Else $aResult[$iRow][3] = "Unkown" EndIf ; ProtectionStatus $aResult[$iRow][4] = $aProtectionStatusMsg[$iProtectionStatus] ; LockStatus $aResult[$iRow][5] = $aLockStatusMsg[$iLockStatus + 1] ; IsAutoUnlockEnabled $aResult[$iRow][6] = $bIsAutoUnlockEnabled ; IsAutoUnlockEnabled $aResult[$iRow][7] = $bIsAutoUnlockKeyStored ; ConversionStatus $aResult[$iRow][8] = $aConversionStatusMsg[$iConversionStatus + 1] ; EncryptionMethod $aResult[$iRow][9] = $aEncryptionMethodMsg[$iEncryptionMethod + 1] ; EncryptionPercentage $aResult[$iRow][10] = $iEncryptionPercentage ; WipingStatus $aResult[$iRow][11] = $aWipingStatusMsg[$iWipingStatus + 1] ; WipingPercentage $aResult[$iRow][12] = $iWipingPercentage ; KeyProtectors $aResult[$iRow][13] = $aVolumeKeyProtectors $iRow += 1 Next _ArraySort($aResult) Return $aResult EndFunc ;==>_BitlockerDriveInfo Func _WMIPropertyExists($Object, $Property) If Not IsObj($Object) Then Return False For $sProperty In $Object.Properties_ If $sProperty.Name = $Property Then Return True Next Return False EndFunc ;==>_WMIPropertyExists Func _WMIMethodExists($Object, $Method) If Not IsObj($Object) Then Return False For $sMethod In $Object.Methods_ If $sMethod.Name = $Method Then Return True Next Return False EndFunc ;==>_WMIMethodExists Func _WMIPropertyValue($sProperty = "", $sClass = "", $sFilter = "", $sNamespace = Default, $sComputer = @ComputerName) Local $objWMIService, $objWMIQuery If $sClass = "" Or $sProperty = "" Then Return SetError(1, 0, 0) If $sFilter <> "" Then $sFilter = " " & $sFilter If $sNamespace = Default Then $sNamespace = "\root\CIMV2" $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate,authenticationLevel=pktPrivacy}!\\" & $sComputer & $sNamespace) If @error Then Return SetError(2, @error, 0) $objWMIQuery = $objWMIService.ExecQuery("SELECT * FROM " & $sClass & $sFilter, "WQL", 0x30) If Not IsObj($objWMIQuery) Then Return SetError(3, 0, 0) For $objItem In $objWMIQuery For $Property In $objItem.Properties_ If $Property.Name = $sProperty Then Return $Property.Value EndIf Next Next Return SetError(4, 0, 0) EndFunc ;==>_WMIPropertyValue Example 1: #RequireAdmin #include <array.au3> ; Get information on all available drives Global $test = _BitlockerDriveInfo() If @error Then ConsoleWrite("!> _BitlockerDriveInfo() error: " & @error & ". extended: " & @extended & @CRLF) ElseIf IsArray($test) Then _ArrayDisplay($test, "Bitlocker Drive Info", "", 64, Default, "Drive Letter|Drive Label|Volume Type|Initialized For Protection|Protection Status|Lock Status|Auto Unlock Enabled|Auto Unlock Key Stored|Conversion Status|Encryption Method|Encryption Percentage|Wiping Status|Wiping Percentage|Key Protectors") ; Display the Key Protectors for the first record If IsArray($test[0][13]) Then _ArrayDisplay($test[0][13]) EndIf Example 2: #RequireAdmin #include <array.au3> ; Get information on the C-drive of the current computer + show extra information in the console Global $test = _BitlockerDriveInfo("C:", @ComputerName, True) If @error Then ConsoleWrite("!> _BitlockerDriveInfo() error: " & @error & ". extended: " & @extended & @CRLF) ElseIf IsArray($test) Then ConsoleWrite("Bitlocker information on the " & $test[0][0] & " drive" & @CRLF) ConsoleWrite("Protection Status: " & $test[0][4] & @CRLF) EndIf Screenshot for the first example: Suggestions? Bugs? Just let me know TODO: ??? Version 1.0: Initial release Version 1.1: Fixed: Drive Label will not work when you request the information from a remote system (currently using DriveGetLabel) Fixed: The current fix for the missing VolumeType property in some Windows versions will only work locally Added: New internal function (_WMIPropertyValue()) Version 1.2: Fixed: The drive exists & drive type check only worked locally when a drive was specified in $sDrive1 point -
Enumerate Network Resources
Earthshine reacted to c.haslam for a topic
Earthshine: Thanks for more testing1 point -
Unfortunately, I don't understand what you're asking. You mean like this? $HowMany = 15 For $i = 1 To $HowMany ConsoleWrite(StringFormat("%02i.txt", $i) & @CRLF) Next1 point
-
Creating contextual drop downs
Moist reacted to JLogan3o13 for a topic
@Moist we normally operate on a "teach a man to fish" motto but I just happened to be working on something similar for my high-schooler. There are, of course, a dozen ways to skin the proverbial cat in AutoIt, but this should give you an idea. Please ask if you have any questions: #include <GUIConstantsEx.au3> Local $hGUI = GuiCreate("Test", 300, 200) $cmb1 = GUICtrlCreateCombo("Select a day", 10, 10, 100, 60) GUICtrlSetData($cmb1, "Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday", "Select a day") $cmb2 = GUICtrlCreateCombo("Select a class", 120, 10, 100, 60) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $cmb1 Switch GUICtrlRead($cmb1) Case "Tuesday" GUICtrlSetData($cmb2, "") GUICtrlSetData($cmb2, "Select a class|Math|Psych|Robotics", "Select a class") Case "Thursday" GUICtrlSetData($cmb2, "") GUICtrlSetData($cmb2, "Select a class|Trig|PE|Choir", "Select a class") EndSwitch EndSwitch WEnd1 point -
... ? $iFrom = 23000 $iTo = 32000 ; User input, can be anything from 0 to 9999999, but only as INT For $i = $iFrom To $iTo Step 500 $Percent = Int(($i-$iFrom) / ($iTo-$iFrom) * 100) Consolewrite( $Percent & @crlf) ; Do some thing next1 point
-
consecutive number completion in a single loop 01 02
youtuber reacted to JLogan3o13 for a topic
Something like this (removed the msgboxes)? $HowMany = 15 For $i = 1 To $HowMany Step 1 If $i = 10 Then For $m = 10 To $HowMany Step 1 ConsoleWrite($m & @CRLF) Next ExitLoop EndIf Next1 point -
That's also a problem i ll try more later Remarks: You MUST be in "MouseCoordMode" 0 to use this without bugs.1 point
-
That's because the function uses title of the window as the first parameter, you're sending it a handle of a control.1 point
-
I have a sendmessage left mouseclick but i cant figure out how to manage the coord. i ll try more later i like that UDF 10 000% i have a lot of installation with mouseclick i was not able to controlclick. this is awesome... @BrewManNH If you have somthing better I TAKE1 point
-
You just need to capture a couple of registry keys: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings ProxyEnable ProxyServer HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections DefaultConnectionSettings1 point
-
Maybe you need to look again? https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-sendmessage Jos1 point
-
well. I checked the list of the functions in user32.dll and SendMessage doesn't exist.1 point
-
What doesn't work, you didn't post your code?1 point
-
@youtuber, you seemed to be confused. You HAVE TO SPLIT that problem into 2 DIFFERENT SCRIPTS. Script 1 only looks for directory changes and stucks as long as there is no change and reports if there is a change. Script 2 is holding the responsive gui and waiting for a message that there is a change in the directory. If there is a change it has to inspect the directory and write the changes into the gui. The messages between both scripts are delivered by registry entries for lack of a better idea. At the end if you want to exit script 2 (and script 1 should exit too) you have to set the kill switch and then create a temp file in the directory with script 2 so that script 1 is able to react. Here is some pseudo code: #Region - Script 1 - Read Directory Changes #include <APIFilesConstants.au3> #include <FileConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPIDiag.au3> #include <WinAPIFiles.au3> #include <WinAPISys.au3> Global $g_sPathRegistry = ; same as in Script 2 Global $g_sPath = ; same as in Script 2 Local $hDirectory = _WinAPI_CreateFileEx($g_sPath, $OPEN_EXISTING, $FILE_LIST_DIRECTORY, BitOR($FILE_SHARE_READ, $FILE_SHARE_WRITE), $FILE_FLAG_BACKUP_SEMANTICS) If @error Then _WinAPI_ShowLastError('', 1) EndIf Local $pBuffer = _WinAPI_CreateBuffer(8388608) Local $aData While 1 ; !! Look exactly below if these are the parameters you want $aData = _WinAPI_ReadDirectoryChanges($hDirectory, BitOR($FILE_NOTIFY_CHANGE_FILE_NAME, $FILE_NOTIFY_CHANGE_DIR_NAME), $pBuffer, 8388608, 1) ; it will "loop" inside this function as long as there is no change!!! ; That part below will only be executed if there is any change in the directory regarding the parameters you defined above If Not @error Then _LookForKillSwitch() _SayScript2_ThatThereIsAChange() Else _WinAPI_ShowLastError('', 1) EndIf WEnd Func _SayScript2_ThatThereIsAChange() ; for lack of a better solution: RegWrite($g_sPathRegistry, "DirectoryChange", "REG_DWORD", 1) EndFunc Func _LookForKillSwitch() Local $bKillSwitch = RegRead($g_sPathRegistry, "KillSwitch") If $bKillSwitch Then Exit EndFunc #EndRegion #Region - Script 2 - React To Directory Changes Global $g_sPathRegistry = ; same as in Script 1 Global $g_sPath = ; same as in Script 1 RegWrite($g_sPathRegistry, "KillSwitch", "REG_DWORD", 0) ; reset RegWrite($g_sPathRegistry, "DirectoryChange", "REG_DWORD", 0) ; reset _ReadYourFilesHere() ; Create your GUI here _UpdateGUI() While 1 _IsThereAChangeInDirectory() Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _KillScript1() Exit EndSwitch Sleep(1000) ; to not read the registry permanently WEnd Func _ReadYourFilesHere() ; make a list of all files in the directory EndFunc Func _UpdateGUI() ; Update the list to your GUI or what ever is needed EndFunc Func _IsThereAChangeInDirectory() Local $bChange = RegRead($g_sPathRegistry, "DirectoryChange") If $bChange Then _ReadYourFilesHere() _UpdateGUI() EndIf EndFunc Func _KillScript1() RegWrite($g_sPathRegistry, "KillSwitch", "REG_DWORD", 1) ; set kill switch FileWrite($g_sPath & "/temp.txt", "Write some random stuff") ; Creates a file in $g_sPath, so that script 1 can react and can find kill switch While ProcessExists("Script1.exe") ; wait a bit WEnd FileDelete($g_sPath & "/temp.txt") EndFunc #EndRegion Regards, Simpel1 point
-
informix connection
DonChunior reacted to mLipok for a topic
I think you have problem with connection string. Did you read this examples: https://www.connectionstrings.com/informix/ ?1 point -
informix connection
DonChunior reacted to mLipok for a topic
try my ADO.au3 UDF edit: and do not forget to use COM ErrorHandler Here is example:1 point -
How to use WinIO to access memory
francischi reacted to Nine for a topic
Here the code I used and it is working... #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=y #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** Local $hDLL1 = DllOpen("WinIo64.dll") Sleep (200) ConsoleWrite ("hdll = " & $hDLL1 & @CRLF) $result = DllCall($hDLL1, "bool", "InitializeWinIo") Sleep (1000) ConsoleWrite ("Init " & $result[0] & @CRLF) Local $b = "0xD6F7" For $i = 1 to 20 $result = DllCall($hDLL1, "bool", "GetPhysLong", "int_ptr", $b, "dword*", 0) $b += 1 Sleep (1000) ConsoleWrite ("Get " & $result[0] &"/" & $result[1] &"/" & $result[2] & "/" & @CRLF) Next DllCall($hDLL1, "none", "ShutdownWinIo") DllClose($hDLL1) Results : hdll = 1 Init 1 Get 1/55031/3389158144/ Get 1/55032/3402236531/ Get 1/55033/13289986/ Get 1/55034/51914/ Get 1/55035/202/ Get 1/55036/0/ Get 1/55037/0/ Get 1/55038/0/ Get 1/55039/0/ Get 1/55040/0/ Get 1/55041/0/ Get 1/55042/0/ Get 1/55043/0/ Get 1/55044/0/ Get 1/55045/1442840576/ Get 1/55046/1498808320/ Get 1/55047/1247368704/ Get 1/55048/4872534/ Get 1/55049/19033/ Get 1/55050/74/1 point -
Update _SciLexer_v1.2.zip 2018/11/02 v1.2 >>> _SciLexer.au3 * Added: new Function: Sci_AppendText() - jmon / mLipok * Added: new Function: Sci_GetAccessibility() - mLipok * Added: new Function: Sci_SetAccessibility() - mLipok * Changed: All Function: better @error handling - mLipok * Changed: All Function: which was not returning specyfic value - now returns $Ret from SendMessage - mLipok >>> ScintillaConstants.au3 * Changed: separation: - mLipok * ScintillaConstants.au3 content based on Scintilla.h - mLipok * SciLexerConstants.au3 content based on SciLexer.h - mLipok * Changed: compared to current version of Scintilla.h - mLipok >>> _SciLexerConstants.au3 * Changed: compared to current version of SciLexer.h - mLipok1 point
-
ADO.au3 UDF - BETA - Support Topic
DonChunior reacted to mLipok for a topic
open ADO.au3 ... try to change _ArrayDisplay to _DebugArrayDisplay and add at the top. #include <Debug.au3> Is this fix your issue ?1 point -
AD - Get group members + Display Name
boomingranny reacted to Aphotic for a topic
Hey Guys, Just wanted to share a snippet I made in case anyone can use it. I needed to list of all User ID's and their respective display names for an MLIST, searched recursively. The recursive function in he UDF returns either only the FQDN or SAM-ID. It also will do a query against all the returned user IDs for if they have any members, and returns group names in the result. It returns 54 members, (4 groups to query). I modified it to return the ID in the first column and the displayname in the second, omitted returning group names, and only querying for members if the ID is a GROUP_OBJECT. (The last part cut the runtime in half, 1.5 to 0.8 seconds, which on a network laggy day could be a much bigger difference as it went from 58 queries to 4.) My use case for this is that I need the IDs to write to a Sharepoint list but need the names so users can select a person via the name in the GUI. ; #FUNCTION# ==================================================================================================================== ; Name...........: _AD_RecursiveGetGroupMembers ; Description ...: Takes a group and recursively returns a list of groups and members of the group. ; Syntax.........: _AD_RecursiveGetGroupMembers($sGroup[, $iDepth = 10[, $bListInherited = True[, $bFQDN = True]]]) ; Parameters ....: $sGroup - Group for which the members should to be returned. Can be specified as Fully Qualified Domain Name (FQDN) or sAMAccountName ; $iDepth - Optional: Maximum depth of recursion (default = 10) ; $bListInherited - Optional: Defines if the function returns the group it is a member of (default = True) ; $bFQDN - Optional: Specifies the attribute to be returned. True = distinguishedName (FQDN), False = SamAccountName (default = True) ; Return values .: Success - Returns an one-based one dimensional array of group or member names (FQDN or sAMAccountName) ; Failure - "", sets @error to: ; |1 - Specified group does not exist ; Author ........: Jonathan Clelland ; Modified.......: water ; Remarks .......: This function traverses the groups in the specified group until the maximum depth is reached. ; if $bListInherited = True the return is the FQDN or sAMAccountname of the group or member and the FQDN(s) or sAMAccountname(s) of the group it ; is a member of, seperated by '|'(s) if flag $bListInherited is set to True. ;+ ; If flag $bListInherited is set to False then the group/member names are sorted and only unique entries are returned. ; Related .......: _AD_GetGroupMembers ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _AD_RecursiveGetGroupMembers($sGroup, $iDepth = 10, $bListInherited = True, $bFQDN = True) If _AD_ObjectExists($sGroup) = 0 Then Return SetError(1, 0, "") If StringMid($sGroup, 3, 1) <> "=" Then $sGroup = _AD_SamAccountNameToFQDN($sGroup) Local $iCount1, $iCount2 Local $sField = "distinguishedName" If Not $bFQDN Then $sField = "samaccountname" $__oAD_Command.CommandText = "<LDAP://" & $sAD_HostServer & "/" & $sAD_DNSDomain & ">;(memberof=" & $sGroup & ");" & $sField & ";subtree" Local $oRecordSet = $__oAD_Command.Execute Local $aMembers[$oRecordSet.RecordCount + 1] = [0] If $oRecordSet.RecordCount = 0 Then Return $aMembers $oRecordSet.MoveFirst $iCount1 = 1 Local $aTempMembers[1] Do $aMembers[$iCount1] = $oRecordSet.Fields(0).Value If $iDepth > 0 Then $aTempMembers = _AD_RecursiveGetGroupMembers($aMembers[$iCount1], $iDepth - 1, $bListInherited, $bFQDN) If $bListInherited Then For $iCount2 = 1 To $aTempMembers[0] $aTempMembers[$iCount2] &= "|" & $aMembers[$iCount1] Next EndIf _ArrayDelete($aTempMembers, 0) _ArrayConcatenate($aMembers, $aTempMembers) EndIf $iCount1 += 1 $oRecordSet.MoveNext Until $oRecordSet.EOF $oRecordSet.Close If $bListInherited = False Then _ArraySort($aMembers, 0, 1) $aMembers = _ArrayUnique($aMembers, 0, 1) EndIf $aMembers[0] = UBound($aMembers) - 1 Return $aMembers EndFunc ;==>_AD_RecursiveGetGroupMembers ;MODIFIED FUNCTION ABOVE TO INCLUDE DISPLAY NAME IN A SECOND COLUMN Func _AD_RecursiveGetGroupMembersDN($sGroup, $iDepth = 10) If _AD_ObjectExists($sGroup) = 0 Then Return SetError(1, 0, "") If StringMid($sGroup, 3, 1) <> "=" Then $sGroup = _AD_SamAccountNameToFQDN($sGroup) Local $iCount1, $iCount2 Local $sField = "samaccountname,displayname,sAMAccountType" $__oAD_Command.CommandText = "<LDAP://" & $sAD_HostServer & "/" & $sAD_DNSDomain & ">;(memberof=" & $sGroup & ");" & $sField & ";subtree" Local $oRecordSet = $__oAD_Command.Execute Local $aMembers[$oRecordSet.RecordCount + 1][2] $aMembers[0][0] = 0 If $oRecordSet.RecordCount = 0 Then Return $aMembers $oRecordSet.MoveFirst $iCount1 = 1 Local $aTempMembers[1] Do $aMembers[$iCount1][0] = $oRecordSet.Fields(0).Value $aMembers[$iCount1][1] = $oRecordSet.Fields(1).Value If $oRecordSet.Fields(2).Value = 268435456 Then If $iDepth > 0 Then $aTempMembers = _AD_RecursiveGetGroupMembersDN($aMembers[$iCount1][0], $iDepth - 1) _ArrayDelete($aTempMembers, 0) _ArrayDelete($aMembers, $iCount1) _ArrayConcatenate($aMembers, $aTempMembers) EndIf Else $iCount1 += 1 EndIf $oRecordSet.MoveNext Until $oRecordSet.EOF $oRecordSet.Close _ArraySort($aMembers, 0, 1) $aMembers[0][0] = UBound($aMembers) - 1 Return $aMembers EndFunc ;==>_AD_RecursiveGetGroupMembersDN1 point -
I wondered how to make a string grid and played around with some ideas. Since I don't actually need one it's ground to a halt Maybe some of the ideas will be useful to someone. I got most things I was thinking of at least to the stage where I think I could make them work, but there are lots of things missing or incomplete. I know that you can use the Excel UDF's or OpenOffice Calc UDFs but that wasn't the point and an AUtoIt string grid seemed like a good idea to me for a while . source = stringGrid01.zip Edit made a couple of changes based on Yashied's post #4 mgrefStringGrid1 point
-
;=============================================================================== ; ; Function Name: _MouseClickPlus() ; Version added: 0.1 ; Description: Sends a click to window, not entirely accurate, but works ; minimized. ; Parameter(s): $Window = Title of the window to send click to ; $Button = "left" or "right" mouse button ; $X = X coordinate ; $Y = Y coordinate ; $Clicks = Number of clicks to send ; Remarks: You MUST be in "MouseCoordMode" 0 to use this without bugs. ; Author(s): Insolence <insolence_9@yahoo.com> ; ;=============================================================================== Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1) Local $MK_LBUTTON = 0x0001 Local $WM_LBUTTONDOWN = 0x0201 Local $WM_LBUTTONUP = 0x0202 Local $MK_RBUTTON = 0x0002 Local $WM_RBUTTONDOWN = 0x0204 Local $WM_RBUTTONUP = 0x0205 Local $WM_MOUSEMOVE = 0x0200 Local $i = 0 Select Case $Button = "left" $Button = $MK_LBUTTON $ButtonDown = $WM_LBUTTONDOWN $ButtonUp = $WM_LBUTTONUP Case $Button = "right" $Button = $MK_RBUTTON $ButtonDown = $WM_RBUTTONDOWN $ButtonUp = $WM_RBUTTONUP EndSelect If $X = "" OR $Y = "" Then $MouseCoord = MouseGetPos() $X = $MouseCoord[0] $Y = $MouseCoord[1] EndIf For $i = 1 to $Clicks DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $WM_MOUSEMOVE, _ "int", 0, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonDown, _ "int", $Button, _ "long", _MakeLong($X, $Y)) DllCall("user32.dll", "int", "SendMessage", _ "hwnd", WinGetHandle( $Window ), _ "int", $ButtonUp, _ "int", $Button, _ "long", _MakeLong($X, $Y)) Next EndFunc Func _MakeLong($LoWord,$HiWord) Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF)) EndFunc I think Larry made the _MakeLong function, so credit goes to him on that. I got a lot of help on the entire thing, I just threw it into a function. I'll have to figure out how to get the actual area size of the window excluding the title bar for some games, atleast in Diablo II. EDIT: To get D2 offsets use this code: $winsize = WinGetPos("Diablo II") $borderwidth = ($winsize[2] - 800) / 2 $titleheight = $winsize[3] - 600 - (2 * $borderwidth) msgbox("", "", $borderwidth & " " & $titleheight) And use it like so: _MouseClickPlus( "Diablo II", "left", 525 - $borderwidth, 585 - $TitleHeight )1 point
-
Minimized clicking -- Great for game-bots
ibrahem reacted to pcdestroyer for a topic
oooooooo thnx ) Edit: hmm i tried it with $borderwidht and $titleheight ... but it clicks on a completely different place ... dont know why ;(1 point -
Yeah I knew that was the problem -.- I mentioned it in the first post. $winsize = WinGetPos("Diablo II") $borderwidth = ($winsize[2] - 800) / 2 $titleheight = $winsize[3] - 600 - (2 * $borderwidth) msgbox("", "", $borderwidth & " " & $titleheight) But you need to automize that, does the above code not find those values? If not maybe this will work: $winsize = WinGetPos("Diablo II") $borderwidth = $winsize[2] - 800 $titleheight = $winsize[3] - 600 msgbox("", "", $borderwidth & " " & $titleheight)1 point