Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/15/2020 in all areas

  1. LAST VERSION - 1.1 18-May-12 Control Viewer (CV) is a replacement of AutoIt Window Info with a number of advantages. I tried to stick to the interface of the last, so you almost do not have to be retrained. During testing, I never managed to find any controls that could not be identified by CV (on the contrary, shows a lot of hidden controls, especially for the system windows). The all program settings are stored in the following registry key: HKEY_CURRENT_USERSoftwareY'sControl Viewer The main differences CV from AWI Shows the complete list of all existing controls for the window that are interested (visible, hidden and deleted controls are displayed with different colors that can be changed to any other).Dynamically changing information during search for the windows and their controls.Ability to quickly switch between controls in the list.Ability to show/hide any controls from the list (useful for the overlaping controls).Information for the Style and ExStyle parameters shown in the form of hexadecimal values​​, and as its flags.Added the PID and Path parameters in the Window tab and ability to quickly open a folder that containing the process file.Added the coordinate system relative to the selected control.Shows a color of the selected pixel in RGB and BGR formats.Shows an example fill of the selected color.Ability to select the text encoding (affects the Text parameter in the Control tab).The complete change the appearance of pop-up frame for the selected controls.Simple and convenient tool to get a screenshot of the part screen of interest for publication on the forum (Capture tab).Create a report in the clipboard or a text file for subsequent publication on the forum.Search all running AutoIt scripts and their windows in the system (AutoIt tab).User-friendly interface. Used shortcuts Ctrl+Alt+T - Enable/Disable "Always On Top" mode (also available from the menu). Ctrl+Alt+H - Enable/Disable highlight selected controls (also available from the menu). Ctrl+A - Select all text (works in any input field). Ctrl - Hold down when moving the mouse to scroll the screenshot (Capture tab). Shift - Hold down when stretching/compression of the contour frame for an equilateral resizing screenshots (Capture tab). DoubleClick (on the screenshot) - Save the image to a file (Capture tab). DoubleClick (on any list item) - Open a folder with the file of the process or AutoIt script (AutoIt tab). Del (on any list item) - Close process (AutoIt tab). F5 - Updating the list (AutoIt tab). If anyone have any questions or comments about CV, please post it in this thread. I will be glad to any feedback and suggestions. Files to download Binary (x86 and x64) Redirection to CV_bin.zip, 1.14 MB CV_bin.html Source Redirection to CV_source.zip, 691 KB CV_source.html
    1 point
  2. Trong

    Image Search UDF

    Version 2021.8.30.2

    10,475 downloads

    Use MouseClick() need: #RequireAdmin Dll is already integrated in UDF ! ; #INDEX# =============================================================== ; Title .........: ImageSearch ; AutoIt Version : 3.x ; Language ......: English ; Description ...: Check image Appears or Not and Return the position of an image on the desktop ; Author(s) .....: Dao Van Trong - TRONG.LIVE ; ======================================================================= ; #CURRENT# ============================================================= ; _ImageSearch ; _ImageSearch_Area ; _ImageSearch_Wait ; _ImageSearch_WaitArea ; ======================================================================== ;========================================================================= ; ; Author:...........: AutoIT VietNam : Dao Van Trong - TRONG.LIVE ; Description:......: Check image Appears or Not ; Find and return the position of an image on the desktop ; Syntax:........... _ImageSearch_Area, _ImageSearch ; Parameter(s):..... $_ImagePath: The image to locate on the desktop ; May be a list of image by delimited by "|" ; i.e: $_ImagePath = "image1.bmp|image2.bmp|image3.bmp" ; $P_x1 $P_y1: Position of 1st point ; $P_x2 $P_y2: Position of 2nd point - Default is last botton right of desktop ; $_Tolerance: 0 for no tolerance (0-255). Needed when colors of image differ from desktop. e.g GIF ; $_CenterPos: boolen. True will return $array[1] x $array[2] is center of image found. ; False will return top-left position ; Return Value(s):.. Return an array has 3 item ; On Success: $array[0] 1 ; On Failure: $array[0] 0 ; DLL not found or other error: $array[0] -1 ; $array[1] x $array[2]: position of image what found on desktop ; ; Note:............. Use _ImageSearch to search the entire desktop ; _ImageSearch_Area to specify a desktop region to search ; $_ImagePath with more item need more time appear on screen before function can detect. ; Decrease sleep time in the loop to detect faster. But less performance. I.e CPULoad increased ; ;======================================================================== EG 1: ;~ Opt("MustDeclareVars", 1) ;~ #AutoIt3Wrapper_UseX64=y ;~ #AutoIt3Wrapper_Change2CUI=y #RequireAdmin #include "_ImageSearch_UDF.au3" HotKeySet("{Esc}", "_Exit") ; Press ESC for exit Func _Exit() Exit 0 EndFunc ;==>_Exit Global Const $Ask_On_Found = 0 Global Const $Mouse_Move_On_Found = 1 Global Const $Mouse_Click_On_Found = 0 Global Const $iSleep_Time=500 Global $sCount = 0, $_Image_1 = @ScriptDir & "\example.bmp" ; First, use this function to create a file bmp, maybe a desktop icon for example') MsgBox(64 + 262144, 'ImageSearch', 'At first, create a file bmp,' & @CRLF & 'photos that will search on the screen!') _ImageSearch_Create_BMP($_Image_1) ConsoleWrite("! Search for images: " & $_Image_1 & @CRLF & '! Searching on the screen ...' & @CRLF) While 1 ToolTip('(Press ESC for EXIT) Searching ...', 1, 1) Sleep($iSleep_Time) $sCount += 1 Local $return = _ImageSearch($_Image_1) If $return[0] = 1 Then ConsoleWrite('- [' & $sCount & '] Image found:' & " X=" & $return[1] & " Y=" & $return[2] & @CRLF) If $Mouse_Move_On_Found Then MouseMove($return[1], $return[2]) Sleep($iSleep_Time) EndIf If $Mouse_Click_On_Found Then MouseClick("left", $return[1], $return[2]) ToolTip('(Press ESC for EXIT) - [' & $sCount & "] Image found:" & " X=" & $return[1] & " Y=" & $return[2], 1, 1) If $Ask_On_Found Then Local $ask = MsgBox(6 + 262144, 'Success [' & $sCount & ']', 'Image found:' & " X=" & $return[1] & " Y=" & $return[2]) If $ask = 2 Or $ask = 3 Or $ask = 5 Or $ask = 7 Then Exit ;No, Abort, Cancel, and Ignore If $ask = 10 Then _ImageSearch_Create_BMP($_Image_1) ; Continue ;Try Again EndIf EndIf Sleep(200) WEnd Video demo: [+] When any problem or error occurs, please make sure that:- Downloaded and used the latest version.- Set screen Screen Scale and layout = 100%- Installed display driver.- Tried turning off the antivirus- Full installation: Microsoft Visual C++ Redistributable 2005->2022 [+] You can download the AIO version of the Visual C++ Redistributable here: -> https://www.mediafire.com/file/0ak8dcj9mdn7nyq/VisualCppRedist_AIO_2005-2022_x86_x64_%5Btrong.live%5D.zip/file -> FOR Windows XP: https://www.mediafire.com/file/5m5lnr1kfg73tc9/VisualCppRedist_AIO_2005-2019_x86_XP_%5Btrong.live%5D.zip/file <!> Password for Extract: trong.live [+] The last full version of SCITE4AutoIT supports windows XP: https://www.autoitscript.com/autoit3/scite/download/archive/v19.1127.1402.0-SciTE4AutoIt3.exe
    1 point
  3. This is a new program of mine, and still under development, which you can read a kind of blog about at the forum here. It is currently fully working, if you use TeraCopy (at least the older free version I use - 2.27), and you may be able to get it to work with other copier programs. Please let me know if I need to add support for something specific, command-line wise. NOTE - Many aspects have only had minimal testing at this point. Latest Screenshots Here are some early details (from May 27-28), mentioned in a spoiler section here, but reproduced as an edited version. Here is the current download (including source), which you can try out. Keep Track Copier.zip (10 prior downloads) Keep Track Copier v1.1.zip
    1 point
  4. @Clayson Please post your revised code so that I can see your changes. FWIW, I'm in the process of writing the function _WD_ElementActionEx, which will allow you to do things like this more easily. Right now, I have coding for these actions: hover, dblclick, and rgtclick. I'll add more as I think of them or receive suggestions.
    1 point
  5. Did you actually try anything? like: Local $code=StringRegExpReplace($Msga ,'\D*(\d*)\D*','$1') Jos
    1 point
  6. This one is easy... just use contains -- _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@type="radio" and contains(text(), "Radio B")]') Not sure that I understand your question. Maybe you need to retrieve all Div elements with that particular title and then process them to gather the details you are after. <shrug>
    1 point
  7. VAN0, No, please stick to your own thread as this has nothing to do with my UDF. M23
    1 point
  8. If you have access to the same network shares from your PC and the system you are remoting into, then download and use the standalone AutoIt version and save it to a network share. You can then create and run scripts from the system you are remoting into. UNLESS you are actually running the Applications only via RDP and not actually logging into a desktop. Then, you are out of luck.
    1 point
  9. I am working on a tokensizer which will be the first stage in parsing, some call it the scanner phase. It is basically taking the raw text and converting it into tokens (variable, string, number, operator, keyword etc.), which are much easier to work with in code, the next step would be syntactic analysis, which is just a fancy word to describe to process of checking if the tokens are in the right order (e.x. checking if 123 = $number is in the right order... spoiler alert: it is not in the right order). As usual, not much work code wise but I have a plan in my mind now, and I spent most of my time today researching how enumerators work in C and if linked-lists are really the best way to store dynamically allocated data. Another nice thing is that I have finally created a repository with the code: https://github.com/DcodingTheWeb/EasyCodeIt The code is very basic right now, it just prints the contents of the script to the standard output, I will update it as I work on features. Don't forget to give the repository a 🌟 star if you like what I am doing
    1 point
  10. Correct... You just configured SciTE to open an instance for each file separately and stop checking whether an instance of SciTE is already running. There is one ....sort of: https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/scite The version I publish can be ran portable at which time the user config files will be located within the directory the program is stored and all SCITE related Environment variables need to be removed. Jos
    1 point
  11. I've tested the header color example as 64 bit code on both Windows 7 and Windows 10. In both cases, it fails. There are no colors in the header. Then I've made a much smaller example that only contains header colors: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <GUIConstants.au3> #include <GuiListView.au3> Global $hHeader, $aHdrTexts[8] Example() Func Example() ; Create GUI GUICreate( "ListView Header Colors - GUIRegisterMsg", 840, 420 ) ; Create ListView Local $idListView = GUICtrlCreateListView( "", 10, 10, 820, 400 ) _GUICtrlListView_SetExtendedListViewStyle ( $idListView, $LVS_EX_FULLROWSELECT ) ; Add columns to ListView For $i = 0 To 7 _GUICtrlListView_AddColumn( $idListView, "Column " & $i, 99 ) $aHdrTexts[$i] = "Column " & $i Next ; Fill ListView For $i = 0 To 99 GUICtrlCreateListViewItem( $i & "/0|" & $i & "/1|" & $i & "/2|" & $i & "/3|" & _ $i & "/4|" & $i & "/5|" & $i & "/6|" & $i & "/7|", $idListView ) Next ; Header control $hHeader = _GUICtrlListView_GetHeader( $idListView ) ; Register WM_NOTIFY message handler GUIRegisterMsg( 0x004E, "WM_NOTIFY" ) ; 0x004E = $WM_NOTIFY ; Show GUI GUISetState( @SW_SHOW ) ; Message loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup GUIDelete() EndFunc ; WM_NOTIFY message handler Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam ) Local Static $hHdrBrush = _WinAPI_CreateSolidBrush( 0xCCFFFF ) ; Yellow, BGR Local $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ), $hWndFrom = HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ), $iCode = DllStructGetData( $tNMHDR, "Code" ) Switch $hWndFrom Case $hHeader Switch $iCode Case $NM_CUSTOMDRAW Local $tNMCustomDraw = DllStructCreate( $tagNMLVCUSTOMDRAW, $lParam ) Local $dwDrawStage = DllStructGetData( $tNMCustomDraw, "dwDrawStage" ) Switch $dwDrawStage ; Holds a value that specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins ConsoleWrite( "CDDS_PREPAINT" & @CRLF ) Return $CDRF_NOTIFYITEMDRAW ; Notify parent window of any item related drawing operations Case $CDDS_ITEMPREPAINT ; Before an item is drawn: Default painting (frames and background) ConsoleWrite( "CDDS_ITEMPREPAINT" & @CRLF ) Return $CDRF_NOTIFYPOSTPAINT ; Notify parent window of any post item related drawing operations Case $CDDS_ITEMPOSTPAINT ; After an item is drawn: Custom painting (item texts) ConsoleWrite( "CDDS_ITEMPOSTPAINT" & @CRLF ) Local $iIndex = DllStructGetData( $tNMCustomDraw, "dwItemSpec" ) ; Item index Local $hDC = DllStructGetData( $tNMCustomDraw, "hdc" ) ; Device context _WinAPI_SetBkMode( $hDC, $TRANSPARENT ) ; Transparent background Local $tRECT = DllStructCreate( $tagRECT ) DllStructSetData( $tRECT, 1, DllStructGetData( $tNMCustomDraw, 6 ) + 1 ) DllStructSetData( $tRECT, 2, DllStructGetData( $tNMCustomDraw, 7 ) + 1 ) DllStructSetData( $tRECT, 3, DllStructGetData( $tNMCustomDraw, 8 ) - 2 ) DllStructSetData( $tRECT, 4, DllStructGetData( $tNMCustomDraw, 9 ) - 2 ) _WinAPI_FillRect( $hDC, $tRECT, $hHdrBrush ) ; Background color DllStructSetData( $tNMCustomDraw, "Left", DllStructGetData( $tNMCustomDraw, "Left" ) + 4 ) ; Left margin DllStructSetData( $tNMCustomDraw, "Right", DllStructGetData( $tNMCustomDraw, "Right" ) - 4 ) ; Right margin DllCall( "user32.dll", "int", "DrawTextW", "handle", $hDC, "wstr", $aHdrTexts[$iIndex], "int", StringLen( $aHdrTexts[$iIndex] ), "struct*", DllStructGetPtr( $tNMCustomDraw, "Left" ), "uint", $DT_LEFT+$DT_SINGLELINE+$DT_VCENTER ) ; _WinAPI_DrawText Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG #forceref $hWnd, $iMsg, $wParam EndFunc It fails the same way. Then I've replaced the GUIRegisterMsg technique with the Subclassing technique: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <GUIConstants.au3> #include <GuiListView.au3> Global $hHeader, $aHdrTexts[8] Example() Func Example() ; Create GUI GUICreate( "ListView Header Colors - Subclassing", 840, 420 ) ; Create ListView Local $idListView = GUICtrlCreateListView( "", 10, 10, 820, 400 ) _GUICtrlListView_SetExtendedListViewStyle ( $idListView, $LVS_EX_FULLROWSELECT ) Local $hListView = GUICtrlGetHandle( $idListView ) ; Add columns to ListView For $i = 0 To 7 _GUICtrlListView_AddColumn( $idListView, "Column " & $i, 99 ) $aHdrTexts[$i] = "Column " & $i Next ; Fill ListView For $i = 0 To 99 GUICtrlCreateListViewItem( $i & "/0|" & $i & "/1|" & $i & "/2|" & $i & "/3|" & _ $i & "/4|" & $i & "/5|" & $i & "/6|" & $i & "/7|", $idListView ) Next ; Header control $hHeader = _GUICtrlListView_GetHeader( $idListView ) ; Register ListView WM_NOTIFY message handler Local $pLV_WM_NOTIFY = DllCallbackGetPtr( DllCallbackRegister( "LV_WM_NOTIFY", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr" ) ) DllCall( "comctl32.dll", "bool", "SetWindowSubclass", "hwnd", $hListView, "ptr", $pLV_WM_NOTIFY, "uint_ptr", 0, "dword_ptr", 0 ) ; $iSubclassId = 0, $pData = 0 ;_WinAPI_SetWindowSubclass( $hListView, $pLV_WM_NOTIFY, 0, 0 ) ; $iSubclassId = 0, $pData = 0 ; Show GUI GUISetState( @SW_SHOW ) ; Message loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Cleanup DllCall( "comctl32.dll", "bool", "RemoveWindowSubclass", "hwnd", $hListView, "ptr", $pLV_WM_NOTIFY, "uint_ptr", 0 ) ; $iSubclassId = 0 ;_WinAPI_RemoveWindowSubclass( $hListView, $pLV_WM_NOTIFY, 0 ) ; $iSubclassId = 0 GUIDelete() EndFunc ; ListView WM_NOTIFY message handler Func LV_WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam, $iSubclassId, $pData ) If $iMsg <> 0x004E Then Return DllCall( "comctl32.dll", "lresult", "DefSubclassProc", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam )[0] ; 0x004E = $WM_NOTIFY Local Static $hHdrBrush = _WinAPI_CreateSolidBrush( 0xCCFFFF ) ; Yellow, BGR Local $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ), $hWndFrom = HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ), $iCode = DllStructGetData( $tNMHDR, "Code" ) Switch $hWndFrom Case $hHeader Switch $iCode Case $NM_CUSTOMDRAW Local $tNMCustomDraw = DllStructCreate( $tagNMLVCUSTOMDRAW, $lParam ) Local $dwDrawStage = DllStructGetData( $tNMCustomDraw, "dwDrawStage" ) Switch $dwDrawStage ; Holds a value that specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins ConsoleWrite( "CDDS_PREPAINT" & @CRLF ) Return $CDRF_NOTIFYITEMDRAW ; Notify parent window of any item related drawing operations Case $CDDS_ITEMPREPAINT ; Before an item is drawn: Default painting (frames and background) ConsoleWrite( "CDDS_ITEMPREPAINT" & @CRLF ) Return $CDRF_NOTIFYPOSTPAINT ; Notify parent window of any post item related drawing operations Case $CDDS_ITEMPOSTPAINT ; After an item is drawn: Custom painting (item texts) ConsoleWrite( "CDDS_ITEMPOSTPAINT" & @CRLF ) Local $iIndex = DllStructGetData( $tNMCustomDraw, "dwItemSpec" ) ; Item index Local $hDC = DllStructGetData( $tNMCustomDraw, "hdc" ) ; Device context _WinAPI_SetBkMode( $hDC, $TRANSPARENT ) ; Transparent background Local $tRECT = DllStructCreate( $tagRECT ) DllStructSetData( $tRECT, 1, DllStructGetData( $tNMCustomDraw, 6 ) + 1 ) DllStructSetData( $tRECT, 2, DllStructGetData( $tNMCustomDraw, 7 ) + 1 ) DllStructSetData( $tRECT, 3, DllStructGetData( $tNMCustomDraw, 8 ) - 2 ) DllStructSetData( $tRECT, 4, DllStructGetData( $tNMCustomDraw, 9 ) - 2 ) _WinAPI_FillRect( $hDC, $tRECT, $hHdrBrush ) ; Background color DllStructSetData( $tNMCustomDraw, "Left", DllStructGetData( $tNMCustomDraw, "Left" ) + 4 ) ; Left margin DllStructSetData( $tNMCustomDraw, "Right", DllStructGetData( $tNMCustomDraw, "Right" ) - 4 ) ; Right margin DllCall( "user32.dll", "int", "DrawTextW", "handle", $hDC, "wstr", $aHdrTexts[$iIndex], "int", StringLen( $aHdrTexts[$iIndex] ), "struct*", DllStructGetPtr( $tNMCustomDraw, "Left" ), "uint", $DT_LEFT+$DT_SINGLELINE+$DT_VCENTER ) ; _WinAPI_DrawText Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch EndSwitch EndSwitch ; Call next function in subclass chain Return DllCall( "comctl32.dll", "lresult", "DefSubclassProc", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, "lparam", $lParam )[0] #forceref $iSubclassId, $pData EndFunc Here the code works in all 4 situations: Windows 7/10, 32/64 bit. In the GUIRegisterMsg example, only CDDS_PREPAINT notifications are displayed in SciTE console. The problem seems to be that the CDRF_NOTIFYITEMDRAW return values are not received by the operating system. Therefore, the operating system does not generate CDDS_ITEMPREPAINT or CDDS_ITEMPOSTPAINT notifications and the header items are not colored. Because the Subclassing example works, it excludes errors in the $tagNMLVCUSTOMDRAW structure. It seems like there is an error in the internal AutoIt code associated with the GUIRegisterMsg function when the code is run as 64 bit code. The return values from the WM_NOTIFY message handler are not properly forwarded to the operating system. The error seems also to be related to the fact that the header control is a second level child in relation to the GUI. Colors does work for a listview control which is a first level child. Solution: Implement the WM_NOTIFY message handler in GUIListViewEx.au3 using the Subclassing technique. This is not necessarily completely trivial. In my example above, it looks easy. But this is also a very small example. Lars.
    1 point
×
×
  • Create New...