Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/04/2016 in all areas

  1. FredAI

    Set Acl permissions UDF

    Hi. I've been working on this for a while. I think now it's good enough to post it here. Functions to do most everything with the DACL and ownership on all types of objects: Files or folders, Registry keys, services, Kernel and WMI objects, etc. Here's a good example to test: #include 'Permissions.au3' _InitiatePermissionResources() FileWrite(@ScriptDir&'test.txt','Test') Local $TI = TimerInit() Local $ret = _DenyAllAccess(@ScriptDir&'test.txt',$SE_FILE_OBJECT,@UserName) Local $TD = TimerDiff($TI) MsgBox(0,'','Deny all access to test.txt and take ownership:'&@CRLF&@CRLF& _ '_DenyAllAccesss return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() $ret = _GrantReadAccess(@ScriptDir&'test.txt',$SE_FILE_OBJECT,'Administrators') $TD = TimerDiff($TI) MsgBox(0,'','Grant everyone read access, all access to admins and system, and set the owner: Admins group'&@CRLF&@CRLF& _ '_GrantReadAccesss return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() $ret = _GrantAllAccess(@ScriptDir&'test.txt') $TD = TimerDiff($TI) MsgBox(0,'','Grant everyone access'&@CRLF&@CRLF& _ '_GrantAllAccesss return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() $ret = _CopyFullDacl(@ScriptDir&'test.txt',$SE_FILE_OBJECT,@ScriptDir) $TD = TimerDiff($TI) MsgBox(0,'','Restore all inherited permissions'&@CRLF&@CRLF& _ '_CopyFullDacl return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Local $aPerm[2][3] = [['Restricted',1,$GENERIC_ALL],['Users',1,$GENERIC_ALL]] $ret = _EditObjectPermissions(@ScriptDir&'test.txt',$aPerm) $TD = TimerDiff($TI) MsgBox(0,'','Add two granted access aces: Restricted and Users'&@CRLF&@CRLF& _ '_EditObjectPermissions return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Dim $aPerm[2][3] = [['Restricted',1,$GENERIC_READ],['Users',1,$GENERIC_READ]] $ret = _EditObjectPermissions(@ScriptDir&'test.txt',$aPerm) $TD = TimerDiff($TI) MsgBox(0,'','Give only read access to the Restricted and Users groups'&@CRLF&@CRLF& _ '_EditObjectPermissions return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Dim $aPerm[2][3] = [['Restricted',0,$GENERIC_ALL],['Users',0,$GENERIC_ALL]] $ret = _EditObjectPermissions(@ScriptDir&'test.txt',$aPerm) $TD = TimerDiff($TI) MsgBox(0,'','Deny access to the Restricted and Users groups'&@CRLF&@CRLF& _ '_EditObjectPermissions return value: '&$ret&' Time: '&Round($TD,2)&' miliseconds.'&@CRLF& _ 'Check the file permissons before closing the message box.') $TI = TimerInit() Local $Hndl = _Permissions_OpenProcess(@AutoItPID) Local $SDBefore = _GetObjectStringSecurityDescriptor($Hndl,$SE_KERNEL_OBJECT) Local $CODRet = _ClearObjectDacl($Hndl,$SE_KERNEL_OBJECT) Local $DARet = _DenyAllAccess($Hndl,$SE_KERNEL_OBJECT) Local $SDAfter = _GetObjectStringSecurityDescriptor($Hndl,$SE_KERNEL_OBJECT) $TD = Round(TimerDiff($TI),2) MsgBox(0,'', 'Deny everyone access to the current process:'&@CRLF&@CRLF& _ '@AutoItPID original security descriptor: '&@CRLF&$SDBefore&@CRLF&@CRLF& _ '_ClearObjectDacl return value: '&$CODRet&@CRLF&@CRLF& _ '_DenyAllAccess_ return value: '&$DARet&@CRLF&@CRLF& _ 'New @AutoItPID security descriptor: '&@CRLF& _ $SDAfter&@CRLF&@CRLF& 'Time taken: '&$TD&' miliseconds.') _Permissions_CloseHandle($Hndl) FileDelete(@ScriptDir&'test.txt') _ClosePermissionResources()I'm planning to add functions to deal with the Sacl in the future, even though I don't think it's very important. Edit: Let me know if you need an example for the registry. Updated: Fixed a bug in the _ClearObjectDacl function. I thought that adding a null DACL would work fine, but it causes problems later when adding a new DACL. Those who have downloaded, please update. Shoot! Now it wasn't clearing the DACL at all. Updated again. I think it's fixed now. Updated 9/11/2011 - Added the security descriptor functions and removed unnecessary constants. Updated 10/11/2011 - There were some functions missing in the index, and some parameters in the comments. Also removed the "MustDeclareVars" option. (About 50 total downloads before) Update 12/12/2011 - Added more functions: New Update 12/12/2011 - Missing declaration keywords in 3 constants. Sorry Update 16/12/2011 - Added support for all object types, including window and process handles. Added more functions, modified most of them, and removed one. Here's the new function list: Updated 22/2/2012.. This time I'm including SecurityConstants.au3 and FileConstants.au3 to prevent constants conflicts. Added a few more functions and fixed a few bugs. Also added the ability to include the inherited aces in the _EditObjectPermissions function. Now the permissions array can have four elements (optional). It will still work with three elements arrays though. The fourth element is intended to have the inheritance flag for the corresponding ace. Here's the new list of functions: 400 previous downloads Permissions.au3
    1 point
  2. @Dudewana, welcome to AutoIt and to the forum. _ArrayDisplay was meant to help you debug your code. if you want to use it as a general-purpose listing tool, then look inside the function, see how it's built, and write a customized version for your needs. an easier approach might be to build your own GUI with a List control - look a the help for GUICtrlCreateList(). then populate the list with the files you found with _FileListToArray(), and ShellExecute a list entry upon click, or double-click.
    1 point
  3. thx this works like a charm $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler $URL="http://localhost:17556/" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ;~ GET /status HTTP/1.1 ;~ Host: localhost:17556 ;~ Cache-Control: no-cache $restCMD="/status" $oHTTP.Open("GET", $URL & $restCMD, true) ;~ $oHTTP.setRequestHeader ("Cache-Control:","no-cache") ;~ $oHTTP.SetRequestHeader("Content-Type", "xml") $oHTTP.Send("") sleep(2000) ;~just wait a little $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status ;~ $objHTTP.open ("POST", "url", False) ;~ $objHTTP.setRequestHeader ("Content-Type", "text/xml;charset=UTF-8") ;~ $objHTTP.setRequestHeader("Content-Length",StringLen($YourXMLText)) ;~ $objHTTP.setRequestHeader("Connection","If is needed") ;~ $objHTTP.setRequestHeader("User-Agent","If is needed") ;~ $objHTTP.send ($YourXMLText) ConsoleWrite($oStatusCode & @CRLF) ConsoleWrite($oReceived & @CRLF) If $oStatusCode = 200 Then ;Process the response $oReceived ;ConsoleWrite(@CRLF & "Response" & @CRLF & $oReceived & @CRLF) Else MsgBox(16, "Error " & $oStatusCode, $oReceived, 7) EndIf ; This is my custom defined error handler Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Endfunc
    1 point
  4. UEZ

    Set my icons from memory

    It's not published because there are no relevant changes added - only some cosmetic changes.
    1 point
  5. ? Local $sContent = FileRead("file.html") Local $aPics = ["HTB1EfO.KVXXXXXaaXXXq6xXFXXXX.jpg", _ "HTB1TMC5KVXXXXc3aXXXq6xXFXXXt.jpg", _ "HTB19Ve5KVXXXXcFaXXXq6xXFXXXJ.jpg", _ "HTB16qbaKVXXXXb3XVXXq6xXFXXXY.jpg", _ "HTB1N2LlKVXXXXXsXFXXq6xXFXXXs.jpg", _ "HTB1x9PnKVXXXXcgXpXXq6xXFXXXh.jpg", _ "HTB1CTDuKVXXXXaZXXXXq6xXFXXX5.jpg", _ "HTB1cxvbKVXXXXaJXVXXq6xXFXXX8.jpg", _ "HTB1eZDgKVXXXXckXFXXq6xXFXXXz.jpg", _ "HTB1RHnyKVXXXXXoXXXXq6xXFXXX4.jpg", _ "HTB14a6qKVXXXXXNXpXXq6xXFXXXN.jpg", _ "HTB1geHtKVXXXXbLXXXXq6xXFXXXL.jpg" ] For $i = UBound($aPics) - 1 To 0 Step -1 $sContent = StringRegExpReplace($sContent, '<img alt="\K[^"]+', $aPics[$i], $i + 1) Next ConsoleWrite($sContent)
    1 point
  6. This works just fine for me on a compiled script: #include <AutoItConstants.au3> ProcessSetPriority(@ScriptName, $PROCESS_LOW) While 1 Sleep(10) WEnd
    1 point
  7. UEZ

    Set my icons from memory

    I've converted the Ico file to PNG: ; Set icons from memory ; Thread by meoit - https://www.autoitscript.com/forum/topic/185319-set-my-icons-from-memory/ ; Code by UEZ ; Thanks: UEZ ;~ Opt('MustDeclareVars', 1) #include <Constants.au3> #include <GUIConstants.au3> #include <GUIImageList.au3> #include <GDIPlus.au3> #include <GuiTab.au3> #include <GuiButton.au3> _GDIPlus_Startup() ; Global $hBitmap_Icon0, $hBitmap_Icon1, $hBitmap_Icon2, $hBitmap_Icon3, $hTmp, $hTmp2 $hBitmap_Icon1 = Convert(_LoveIconpng(), 16, 16, False) $hBitmap_Icon2 = Convert(_Aboutpng(), 16, 16, False) $hBitmap_Icon3 = Convert(_Uninstallpng(), 16, 16, False) Local $hImageList = _GUIImageList_Create(16, 16, 5) _GUIImageList_Add($hImageList, $hBitmap_Icon1) _GUIImageList_Add($hImageList, $hBitmap_Icon2) _GUIImageList_Add($hImageList, $hBitmap_Icon3) ; Global $MAIN_FORM = GUICreate('Set icons form memory (TAB + Button)', 445, 165, -1, -1) Global $BT_START = GUICtrlCreateButton('Start', 355, 50, 85, 25, (@OSBuild < 6000) ? $BS_BITMAP : -1) Global $hBmp1 = _SetIcon_FormMemory_ForButton($BT_START, _Icopng()) Global $BT_ABOUT = GUICtrlCreateButton('About', 355, 110, 85, 25, (@OSBuild < 6000) ? $BS_BITMAP : -1) Global $hBmp2 = _SetIcon_FormMemory_ForButton($BT_ABOUT, _Aboutpng()) ; Global $TAB_ONE = GUICtrlCreateTab(5, 5, 345, 155) ; Global $SHEET_INFOR = GUICtrlCreateTabItem('GET INFOR TAB') _SetIcon_FormMemory_ForChildTAB($TAB_ONE, 0, 0) Global $INPUT_PATH = GUICtrlCreateInput('Please open a file...', 15, 35, 225, 22) Global $BT_OPEN = GUICtrlCreateButton('Open', 255, 34, 85, 25, (@OSBuild < 6000) ? $BS_BITMAP : -1) Global $hBmp3 = _SetIcon_FormMemory_ForButton($BT_OPEN, _Yellowpng()) Global $EDIT_RESULT = GUICtrlCreateEdit('Ready...', 15, 65, 325, 85) ; Global $SHEET_LOADER = GUICtrlCreateTabItem('LOADER TAB') _SetIcon_FormMemory_ForChildTAB($TAB_ONE, 1, 1) ; Global $SHEET_UNLOADER = GUICtrlCreateTabItem('UNLOADER TAB') _SetIcon_FormMemory_ForChildTAB($TAB_ONE, 2, 2) ; GUICtrlSetState($SHEET_INFOR, $GUI_SHOW) GUICtrlCreateTabItem('') ; GUISetState() ; While 1 Local $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBitmap_Icon1) _WinAPI_DeleteObject($hBitmap_Icon2) _WinAPI_DeleteObject($hBitmap_Icon3) If BitOR($hBmp1, $hBmp2, $hBmp3) Then _WinAPI_DeleteObject($hBmp1) _WinAPI_DeleteObject($hBmp2) _WinAPI_DeleteObject($hBmp3) EndIf _GDIPlus_Shutdown() Exit Case $BT_START Case $BT_ABOUT EndSwitch WEnd ; Func _SetIcon_FormMemory_ForButton($idButton, $IconBinary) Local $hBitmap_Icon0 = Convert($IconBinary) _SendMessage(GUICtrlGetHandle($idButton), $BM_SETIMAGE, $IMAGE_BITMAP, $hBitmap_Icon0) If (@OSBuild > 5999) Then _WinAPI_DeleteObject($hBitmap_Icon0) Return $hBitmap_Icon0 EndFunc Func _SetIcon_FormMemory_ForChildTAB($MainTab, $TabOrder, $ImageOrder) _GUICtrlTab_SetImageList($MainTab, $hImageList) _GUICtrlTab_SetItemImage($MainTab, $TabOrder, $ImageOrder) EndFunc Func Convert($binData, $iWidth = 16, $iHeight = 16, $bConvert = True) Local $hTmp = _GDIPlus_BitmapCreateFromMemory($binData) Local $hTmp2 = _GDIPlus_ImageResize($hTmp, $iWidth, $iHeight) Local $hHBitmap If (@OSBuild < 6000) And $bConvert Then $hHBitmap = _GDIPlus_Convert2HBitmap($hTmp2) Else Local $hIcon_Bitmap = _GDIPlus_HICONCreateFromBitmap($hTmp2) $hHBitmap = _WinAPI_Create32BitHBITMAP($hIcon_Bitmap, True) _WinAPI_DestroyIcon($hIcon_Bitmap) EndIf _GDIPlus_ImageDispose($hTmp) _GDIPlus_ImageDispose($hTmp2) Return $hHBitmap EndFunc Func _GDIPlus_Convert2HBitmap($hBitmap, $iColor = $COLOR_BTNFACE); removes alpha backround using system color and converts to gdi bitmap Local $iBgColor = _WinAPI_GetSysColor($iColor) $iBgColor = 0x10000 * BitAND($iBgColor, 0xFF) + BitAND($iBgColor, 0x00FF00) + BitShift($iBgColor, 16) Local $iWidth = _GDIPlus_ImageGetWidth($hBitmap), $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $hBitmap_new = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;$aResult[6] Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_new) _GDIPlus_GraphicsSetPixelOffsetMode($hCtx_new, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iBgColor) _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_new) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BitmapDispose($hBitmap_new) _GDIPlus_GraphicsDispose($hCtx_new) Return $hHBITMAP EndFunc ;==>_GDIPlus_Convert2HBitmap ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2015-09-19 Func _LoveIconpng($bSaveBinary = False, $sSavePath = @ScriptDir) Local $LoveIconpng $LoveIconpng &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAACXBIWXMAAAsSAAALEgHS3X78AAAB3ElEQVQ4y5WTTUhUURiGn3O5QRLTIijuMNZgMIsIKocIXQhTqzEraFE62KIiOJta2y53RhtpE00LCVRsRijsB10Mw6kW4aKyMipOmdPfDAnKYDYEam3Ogev1DtK7OXzv934/5z0c0T94LNLcEqs6zS2xKiCE0nIVwAFePcy92ySUlqtfPi3sKn9bnO+5MP4bK7EQSssloMHEwwJAaXkZ2AzscU2mz5x5fzlKyxymRyiUlk9cO0Bp+defXKz+yQBlxxKpRFYAjwA+TM9tP37w9h275iAQB8ohU05bQXdIsvb+9U/PBeKpRNaps+SSY1srLXuvD5/YorTsGSlmGo2mwQEYKWa6gCv7D0V/AVejO7d+tV0cgMcTM6OB7i/XCG5em1yZflHZYbj7qUQ2aQXWay52js0BIrioMA7mQy4RBUrWhzPA0zpmUae4DRhyjYn5VCLbyX9AaZkDul0/2Xcrva31cPwt4BlqAlgBOkxcefO8svdS19j8OhMAvMZI0lcMkA4M9rxYJAkU1thsce7oaGH240IT8Dlk65nvpWrTqbahgp90g6qz7flZYDfA+NT5k8JhOb1v4EE9L1ygZlxdh/YDA/c2eIma+6xY8lqPxG8EvudGqAF3pyZ/dPwDmoOg2f8a0d0AAAAASUVORK5CYII=' Local $bString = _WinAPI_Base64Decode($LoveIconpng) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\LoveIcon.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_LoveIconpng Func _Uninstallpng($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Uninstallpng $Uninstallpng &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAACXBIWXMAAAsSAAALEgHS3X78AAADKklEQVQ4y3WQb0yVZRjGf8/7vgcOR+G8CgdOjkxyxTBbpaWlINGfE2uc1SwbH0BT+lDNtj64taE515fm+rO15Re3vjVcGWhJhBtrRZPmaKwGSUL8EQPPOIDY8bznvM9z3vfpA4G55fXpvq9d93Xd9w3AeN/+VgBmX3pZswzxategrhy8NC4A3jn7dffFyWC/clLDAFS3jer0yIi+Gov5AEz3v/bhymzNB98cNAL5ZZVRVX6ysWE/sTNXcy90TOrk7t1LETs//yM3EYvprOPoR23bWMl9vXnTfcv1k0+sM1c8ARo6E7nnI5fM7oUHQUNlKMFwKjLeGY9uBKDui7Hc06cn9XS8QWdTKe2MjupEc7O/vqBAWADpxbmkMPMixzfHeaupyeDGDVzPm5nKZG7dvm9PVemPX+15d9f2dXn8H9o+fXYfQE9b/OB/eVFQWi62t372XtQmeG2RzL0RLzqRNBM/vP3cUQArFK0IhCu3HBGGS7g0n8JgkqI1ER2KbjjmJCZ9y9c+rlI8Hh5l43cD1I1cwMkLsQ2NAxhaa6RUjE2a1N0VIHjgAJFPPuKXh6t+AjC0r5FKYc1eR/7ch1lbi9vbK1ylqgAsL3szp9Ip71e7nL8TsyIbjwvftvWxy5cf4U4Yu7D3ePyZDaGAZYiWxk2l/Z2vvHknrXlbY1ni46M79p7pHjv75bcTSc+H34YXnOK1eeHNlcXBgaH5Oa31bQYCoOShamvn+x0ZwzSNqPunmDeiyMBqvSwoVEnhSh+5qkx7njfe0/LY/c61KxrAAvA1hlRKmL5v3GO7uFmXWTdfoDUl6QV2pAe5KYL0UYA0LAONAG4ZaF+jlCLn+3w/X0Hj2l6KeqaovT5B3tYtyPPnMcJhWmrmyZw7t77n7rL6psSVLgBjaQMfqRRSKlyp+P1iiG2Dvcjpv8hFIhSdOsWqEydIDw0Jz3XNmjV2x67iYnPFQGsfKSVSSi2lZKCkgnkCmPX1BKurSRw6xGJ7O/bhw1oVFuoZx2kfWFz0V54IsLriAVNYAWuJ1Ji+zxuB3FMv2vaRkCG2+pCZU6rr5PR06+mZmSnv3x/8A1zgcgBIiEErAAAAAElFTkSuQmCC' Local $bString = _WinAPI_Base64Decode($Uninstallpng) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Uninstall.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Uninstallpng Func _icopng($bSaveBinary = False, $sSavePath = @ScriptDir) Local $icopng $icopng &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAACXBIWXMAAAsSAAALEgHS3X78AAADZUlEQVQ4y2WRW0wbZBiGn78UKOOwdh0oOIEV2tVJFbItSCqOhKgk020aCA2ikhgTByMxWwjIBbiLGiLacIiHRWTczMwsXiwOw4hbwtEK6waFzVV0FihyKjAolA1ofy+I7GLv5Zvny5c8LwClpaVSFBYWyqVQP49zpa9dag7ESQBqZZv0LE7LdwcrZQjAvZzlTxX6Xaiu+LbxiooKWV9fLwHEh+fKZaI6nrm0LWa+HUHxY0o/gyO3eS/1JA/3KVCYL8ax9+sMTq19RppKhwCora2Vi2GrGD7ORKwLfHdmcV24SVtbm1CUlZXJH0pd2KNcHJnSQ+civsEFHOfhrTKLVMbHxyNzr+EJ36D5zwZS9uv45dd2PN+4ecZ0ePsFQHZ2tjTkmFDEqJgZ+JvnU56jrq5O7ABNTU3S5XIRGhpKQ0PDTq8EyM/Pl4+ORpP2Ti6bgU1Oq5FhKwpsNptQFBcXyz0th/H4p3mDl1j/aZLITw6wFrEJgGLhKT+juyd51hXFdxdbyM7NoePzy7QfGcVisUiF0IQzYriE0Wikq6uHgZu/U55RwgP7HF6vF/Hqm69Lp/sOGo0Wy/ECxsb/4kbvdVQPwyh624LSfCiL9LxMei3jSHUCqtUgm9+PYPw5BqvVKnZUD4850WYkIn0bDLcP4HA4BPBYFEBzc7McGhpiYW2JvcYE1IlagsEtfJPLrLgXiAyJwGAwUFVVtXMnABobG2VXVxf7j6URW5CKMjqctf5ZokYlQQKsp4QQbtay4fGzePU+D5yz6PV6qqurhbDZbLKz9zqc2YfWnIRyJsjaubucOV1OcmIKQsKI6y5fnW8mstLIumaL5csTxA0IDuqMiKKiIrlkguFT6/jb3Jj69mC1Wunu7qa1tZVdqgi+sH2JCAjOVp7F85pE+UIMmddiCfyxiigpKZFe9Sqdoz28n5WPLlFH32+9xGrjOHn8BKEhSpZ8S4yPjzO36OW24xZ9rkFOHD1GYNK/7SAvL08efPlFWmI62G1+Gr0pGdN0KsmqeIQM4Z9HUzh8o9z3TLFyyc1HqQX0Xr2B3W4XSoCOjg6RlJQkzRMJHApmMXxvgn7dLcaiowhuKZjxzJPgDueDwCv0uDfx8i92u/3JGf9PTU2NdDqdzM/PI6VEo9GQnp6O1Wp9gv8PtfRuam7wLmwAAAAASUVORK5CYII=' Local $bString = _WinAPI_Base64Decode($icopng) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\ico.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_icopng Func _Aboutpng($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Aboutpng $Aboutpng &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAACXBIWXMAAAsSAAALEgHS3X78AAADOElEQVQ4y03QS0xcdRQG8O+ce4dhZrCUQpumTaoNTWy1WJsSTUk1RozYQonBhbYhgRgTXRaTRl1VF3blgtRVa0wjEzFIiIvWVHn5iKCttpag0QWSoHYeDDMyMMzj/u/9fy546Lc5m3OS7/wAAHBCADrfem1mxScUEKg6rn6Ws3bNAxwA1/8qmh0jGZKkAsC1hOf0NEYAWB+bcTemdozmVnE1yW3DKaLp5EGZSpf8U3cqDiwx3Lwd7lgu7OQzKwAsnn3lza71IgDujy/MLFlakry8QOJoZwvUcQT7j+/n/PS8DGagMRendocwsejjsOvzQBh5RXRbLUDAFagKLjwYgQiQLFnsrY1EABFoTT16b3k+SWtJ3itboqf/AgDZKK+Ou6WCdY+tqOPgaGfLlQWSJLOWdl98YcbZWmg6eZAk6z5NsW4kQ1xN8vO/i6Z9NLvqAJDur5b++b1oa38NQtK6y8WNtI9gzYBndkIaWx7Qlw/Xb/8pF0hIgXcPRXBfWBCKuri5VAnw8FNP642FtcreiNJYwLPAmiGMZ/F4Q5WD+Ts/A6ffeIEMDD5Ksu9ugRhI89Wby/bt3yw3iwp6+t+5V95wJm3vj57RmnpA5H//iqrSWlu7J4Qjzz2jB5raduzesw8AcqnEn3Zu9kvMfDGu+YSxogpau+WkANBxvuul6YopB2TRM/7A3Krpncqa3qmsGZhbMUXP+OWAfHGqbNBxvks3jSEOohe/iad88ttUychAgjqUIYaznFj0OJkxxHCWOpShxJP8Ll0yCZ+svvh1HOJA8Uh71wfdJ7orJWOfHF92URNGNOqiOqLwITAEIlFFNOYCsSqcGM+7fsnYy2ef6MaR9uddVFVHYq6gYAhQIAKIAK4KdobXiVwViCVUBAGBgiFqQwKEqqOK2dGPz12b/eGhuiq91BwL7HIFnrEolC0CCwQWWC1bVDyLIF/B+8diwaG6Kj13/ZdpzI4OAiIqANA3dOnDJEkG/lii5LdNZm3DSJoNI2m2TebsWKLkk4F/JUGib6hfgP9uIQIhHVU3CI6fbQ61nnn9sWOPtjbWyC4A+KPAxVu3706aiU/e0+8Hb9P6DkUCkPgXxJq3bns9cqIAAAAASUVORK5CYII=' Local $bString = _WinAPI_Base64Decode($Aboutpng) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\About.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Aboutpng Func _Yellowpng($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Yellowpng $Yellowpng &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAFo9M/3AAAACXBIWXMAAAsSAAALEgHS3X78AAADa0lEQVQ4y2WRW0ybdRiHn6/9Ch0nLYdOxFEYtusYCEZgG1qjJjKW7CSSlTVc4M0kkBFNJCNcgIlpgmF0HGJmjBnExOlujI5N2Fxg7cR1SEnbzUm3hUOVDmk5DajbOPy9ILKL/S7fPL/3TZ4XgKqqKiGZzWYhKRd4muuObqF/OUEAEA5/LkIzk+JaX6VQAPT2dKKUvsPj1WzgtbW1orm5WQAoGxorhTZJi9E4y8pKyqeKrYmX8NwawphZxgvJq8gXf87im87t3POdJCY6HwmgsbFRyPIClcezefQERv6c49tzt+nq6pLk6upqYTZf4cJPEQTnLLiGhpgMzGP9zI9a/b6Qk5OTOVoaQlaF8f/VQXradvqu9vDlmXFyXinYOAFgMpmEyWQkKlaJZzhARkYmTU1N0ibQ3t4ufD4fKpWK1tbWzbkMUFpaKgr2wHsleYj1VeJia8TSsozNZpMU5eXlwnYqjfBSALX6Xbq756ip0RIR+e/GhnjNAvHx04z1FeP1fM2+/cWcbvmIncZFysrKhOJ5jZKcVwcxGo1cc9hx/T7I7sIPGXSFCIVCSAcOFImx0Vs8F6/hyGEz4+P3GXD082Q1gpKSY8h5eYUUFb3G/ne8JKVEsTifSOdWmf5+HVarVdpUfdfnJTtHy/LiOr2Xh3G5XBLwVBRAR0eHcLvdLC3Nojdo2faShvW1dSYDD/H755HlKAwGA3V1dZs9CaCtrU3Y7XaK9uk5fDCFuDgVNwcX8N2NBLGGTrdCQX4sgQePuHJ5ij/uzKDX66mvr5ckm80mHNd/ofJ4NHv2apmaVtJy6h9OVH1ManoaQkiM+G7z1ZkvOFGjJTbmMRcuBvF64sjI2IlksViEYccylmPjnD8/i9udgdVqxeGwc/ZsJ+rILdhOt7C6BnUnP+H1N2bYlbmFgV8zuXf/MVJFRYWIjZnH7b3Km6ZytqWmc+O3ARISkzh06AgqWcXDhTkmJiaYnQviGhrmzsgN3n7rIIHAyoaD4uJisbcwC1nxPbvzEsjaYWBmWU90VCpCkgiHJ5if8eAPjPLDjyGydn1AzyUHTqdTkgF6e3slnU4n/P5s1FH5TEyOkPLiTeLUo6yxzt9TD5j0J6KIOEpwys6Yehqn0/nsG/9PQ0OD8Hq9BINBhBBoNBpyc3OxWq3P8P8BKQtpz6xFJlEAAAAASUVORK5CYII=' Local $bString = _WinAPI_Base64Decode($Yellowpng) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Yellow.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Yellowpng Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Since WinXP is out of scope, at least for me, I will not investigate more time to get it run properly using WinXP. As you can see the buttons have icons but no text.
    1 point
  8. water

    Excel activatesheet problem

    How do you call _Excel_Open? Either use $bVisible=False or $bScreenUpdating=False to enhance processing speed. Check the Notes in the help file on how to reset this settings.
    1 point
  9. This means you are running the lite version of SciTE, so download the separate SciTE4AutoIt3 installer and install the full version to fix this. Jos
    1 point
  10. david1337, mikell had the answer - you need to be in multiline mode: $ReadFile = "fiw" & @CRLF & "eqw" & @CRLF & "sdg" & @CRLF & "xcv" $string = "iw" If StringRegExp(StringLower($ReadFile), "(?m)^" & StringLower($string) & "$") Then MsgBox(0, "", $string & " is found in the file") Else MsgBox(0, "", $string & " is not found in the file") EndIf $string = "fiw" If StringRegExp(StringLower($ReadFile), "(?m)^" & StringLower($string) & "$") Then MsgBox(0, "", $string & " is found in the file") Else MsgBox(0, "", $string & " is not found in the file") EndIf Sorry about that - I had tested for the "wrong" case, but not for "right" one. M23
    1 point
  11. Melba, Please don't forget the (?m) option
    1 point
  12. Seems you missed to read the forum rules on your way in. Game automation of any kind is not permitted here.
    1 point
  13. Oh my, that indeed can be done with AutoIt, relatively simply I would say. The key to learning is getting familiar with your help file--included with the installer and a link to an online version here. There are TONs of examples in it that you can learn from and even piece together a working script. Also included with the installer are some GUI examples (look in the AutoIt directory for Examples\GUI). I'd suggest checking out the SampleControls.au3 demo script. That will give you an idea of what kinds of "native" controls you can incorporate in your GUI; of course you can always look to do a more sophisticated GUI (search for GUI examples on the forum), but as a crash course I'd suggest trying out some stuff from the sample. The majority of the batch file looks to be something you'll want to create a GUI for, so go nuts. For the drive mapping you can either employ one of the Run() functions, or you can use the native AutoIt function DriveMapAdd(), just to give you a couple options to get started with. Let us know if you get stuck, and as a tip, you'll get better support if you show effort; you'll find the scripting process more rewarding as well. Try things out and when things don't work/break and you don't understand how or why it works, let us know.
    1 point
  14. spudw2k

    help loop parameter

    You'd have to define some sort of condition of what stuck means: been looping for so long? looped x many times? I'd say a timer is a reasonable way to go, but like I said, it's up to you to define a threshold that would mean stuck to you. ;More pseudo-code ;Create timer outside of loop Local $hTimer = TimerInit() ;Inside of Loop Do If TimerDiff($hTimer) > 30000 Then ;<- Timer measured in milliseconds - 30 seconds X 1000 milliseconds = 30,000 milliseconds $hTimer = TimerInit() ;Reset Timer ;do stuff EndIf Until 0=1 ;something
    1 point
  15. Hello there I recently wanted to know how to differentiate between a mouse click and a touch click on controls in your GUI. This can be interesting when using picture controls as buttons in combination with this UDF here. No one could help me, so I tried my best to get it to work. And it works now! Unfortunately only for Windows 8 and above, as I had to use functions which are unavailable for older OS. Additionally this was my first time writing DLLCalls myself. I hope (and think) that there are no mayor mistakes in it, So here's the sample code: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> OnAutoItExitRegister("_exit") $play = 'iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAAGz7rX1AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuR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b/pD8H8jAwHCBgYGhg4GBgYcqZmKxZD6WaNzFwMCgTa4lxIavKwMDwxWohY8YGBiiaJu/IUXSUqiFvxkYGCZiK0UptQS9fMxDKnUPMjAwmFPbEnTAxcDAwEFtS/5D629JaH1nCvUNAzHVAT7wmoGBoQZatf8jNkyJAUcZGBgKGBgYzlArM0ZCK4WphFINsWbSpVgBDADB5DrGESuD0wAAAABJRU5ErkJggg==' $play = Binary(_WinAPI_Base64Decode($play)) $Form1 = GUICreate("Form1", 444, 372, -1, -1) $pic1 = GUICtrlCreatePic("", 184, 112, 65, 57) $pic1_dummy = GUICtrlCreateDummy() _GDIPlus_Startup() Global $play1 = _GDIPlus_BitmapCreateFromMemory($play, True) _WinAPI_DeleteObject(GUICtrlSendMsg($pic1, $STM_SETIMAGE, $IMAGE_BITMAP, $play1)) DllCall("User32.dll", "bool", "RegisterTouchHitTestingWindow", "HWND", $Form1, "ULONG", 1) ; register your GUI for recieving commands relatet to WM_TOUCHHITTESTING GUIRegisterMsg(0x024D, "WM_TOUCHHITTESTING") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $pic1_dummy MsgBox(0, 0, "touch-click") Case $Pic1 MsgBox(0, 0, "Mouseclick") EndSwitch WEnd Func WM_TOUCHHITTESTING($hWnd, $iMsg, $wParam, $lParam) Local $send = 1 Local $pic1_pos = _WinAPI_GetWindowRect(GUICtrlGetHandle($pic1)) Local $struct = DllStructCreate("uint;long X;long Y") ; first Parameter gives the accuracy of which this control is meant by a touch - second and third are the x/y points of the touch (not relative to GUI) DllCall("User32.dll", "bool", "EvaluateProximityToRect", "ptr", DllStructGetPtr($pic1_pos), "ptr", $lParam, "ptr", DllStructGetPtr($struct)) If DllStructGetData($struct, 1) < 20 Then ; if the proximity of the touch is near enough to the control (I chose 20, but you can vary yourself) then do something GUICtrlSendToDummy($pic1_dummy) ; you shouldn't do very intensive stuff inside the function itself. Outsource it to your main loop. $send = 0 ; no need to pass the command on to your GUI, as you take action yourself .. EndIf If $send Then _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam) EndFunc Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc Func _exit() _WinAPI_DeleteObject($play1) _GDIPlus_Shutdown() EndFunc The magic happens in the WM_TOUCHHITTESTING function. The _WinAPI_Base64Decode is written by @UEZ (as well as the way to use PNG as button (from binary) - thanks for that!) On Windows 7 there is the WM_TOUCH function which should handle touch events, but I couldn't get it to work on controls ..?? If you will get the x/y coordinates of a touch (even when you touch on controls) you could make the "EvaluateProximityToRect" check yourself - as this function is not available in Windows 7. Shouldn't be that hard. Btw.: this here is the MSDN articel related to this topic: https://msdn.microsoft.com/en-us/library/windows/desktop/hh454931(v=vs.85).aspx So thats it. Any questions and comments welcome! greetz, Leo
    1 point
  16. If you like the solution then there is a button to tell me
    1 point
×
×
  • Create New...