Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/27/2014 in all areas

  1. As I was too limited by what was feasible with PixelSearch in Autoit, I wrote an optimized DLL in C++ for searching pixels on the screen. The most basic function allows you to find the pixel in a given color - as PixelSearch - but instead of returning the first found, it returns the closest to a given point. It can go much further: - Search for 'spot' the closest (NxN square containing P pixels that meet the criteria of color mentioned) - Maintains a list containing up to 1024 colors (search pixels with one color in this list) - Manages up to 1024 exclusion rectangles. We can define precisely the search pattern that you want (with a rectangle from which you "substract" several "exclusion rectangles"). You can have up to 1024 exclusion rectangles. - You can also set a 'shade variation' (same idea as with PixelSearch). - Can work on several 'snapshots' (screen captures) in memory. It is possible to retain up to 1024 snapshots simultaneously (of course, each capture consumes memory, so only use the "slots" you really need). - Works on full screen or specific window (HWND optionnal parameter) or part of it. - Also includes functions to identify the changes between two SnapShots (minimum rectangle containing all changes + number of pixels that have changed). Useful to detect movement on the screen, object state changes... - Fairly sophisticated tools provided for debugging are also included in the UDF. You can choose the type of logs you want, including the ability to view on screen the detected areas (most useful during development phasis) and record the transaction details in a log file. - For even more performance, you can capture the content of a screen memory (SnapShot, takes about the same time as or PixelSearch PixelGetColor) then do all the research you want in this snapshots (very fast functions : nearly 1000 times as fast as the native PixelGetColor). - [v1.4] : find the "best spot" - meaning the spot that has the best number of "right" colors. - [v1.4] : now provided with a tool, FFShowPixels.exe, to find colors, manage color lists, show all occurences of them on the Captured Window, and... automatically generates AutoIt or C++ code. - [v1.6] : Saves SnapShots on BitMaps (BMP and JPG supported) - [v1.6] : Modifies SnapShots with "filters" (Keep only some colors or only pixels that have changes. All other pixels can be turned to black). - [v1.7] : Can change pixels colors on SnapShots (SetPixel) - [v1.7] : Can access the Raw pixel data of SnapShots (GetRawData) - [v1.7] : Can draw back SnapShots on Screen. - [v1.8] : Bug fixes. Deleted - [v1.8.1] : Bug fixes (FastFind.au3). - [v1.8.2] : Bug fixes (FastFind.au3). - [v1.8.3] : Bug fixes (FastFind.au3). Deleted - [v1.8.4] : Should now run on early XP and Windows 2000 OS. - [v2.0] : Documentation file in english (FastFind.chm), several new functions and new feature on some old functions. - [v2.1] : Bug fixes (removed those nasty errors in message boxes) - [v2.2] : Bug fix Included in the archive: both the 32 bits and 64 bits dll (written in Visual C++ 2010), the AutoIt Wrapper, a demonstration script and a tiny Benchmark script. Here it is, your comments and suggestions are welcome. [updates/Changelog] Last Version : 2.2 FastFind 2_2.zip Version 2.2 Bug fixes FastFind 2_2.zip Version 2.1 Bug fixes FastFind 2_1.zip Version 2.0 A new documentation file, in chm format (thanks to CeramicWeasel) New functions : DrawSnapShotXY (same as DrawSnapShot, with specific top-left position for drawing). ComputeMeanValues (Gives mean Red, Green and Blue values of a SnapShot) ApplyFilterOnSnapShot (apply a AND filter on each pixels in the SnapShot) FFGetRawData (provide access to all pixel data) ShadeVariation parameter added in the following functions : KeepChanges LocalizeChanges HasChanged FastFind 2_0.zip jan 5 2012: ShowPixel Link should work now ?do=embed' frameborder='0' data-embedContent> Version 1.8 -> bug fixes Updates : FastFind 1_8_4.zip Version 1.7 -> bug fix with client coordinates -> Can change pixels colors on SnapShots (SetPixel) -> Can access the Raw pixel data of SnapShots (GetRawData). Not that this feature is not allready wrapped into autoit: you have to do it with dllcall. -> Can draw back SnapShots on Screen (DrawSnapShot). -> New function to duplicate a SnapShot (DuplicateSnapShot) FastFind 1_7.zip FFShowPixels + FastFind complete 1.7 package : ?do=embed' frameborder='0' data-embedContent> Version 1.6 -> bug fix (restriction rectangles + FFColorCount) -> New functions to export captures into BMP or JPEG Files -> New functions to create SnapShots with changes or selected colors from a previous SnapShot(FFKeepChanges & FFKeepColors). FFShowPixels1_6 wo FFShowPixels.zip Version 1.5 -> FFGetPixel bug fix. FastFind1_5.zip (Update) Version 1.4 -> A new optional parameter in SetHWnd : You can now choose to take either the full Window or only the Client area of the window. -> Several bug fixes (more reliable and consistent) -> A new search fonction : FFBestSpot. It will find the spot that contains the most "good" pixels. -> A new tool - ShowPixels.exe - will allow you to easily manage list of colors (find them on the screen, make stats...) and automatically generate AutoIt or C++ code from them. Unfortunately, the zip is too big to include ShowPixel.exe in it. So if you want this tool, just ask with pm or mail. (Update) Version 1.3 -> comments in demo scripts now in english -> Some minor bug fixed -> now both 32 bits and 64 bits dll are provided -> Several function calls are now more simple to use : the x1,y1,x2,y2 limits of the area for search functions are now optional. Default values means full window (or screen)) ** Warning ** I've changed the order of the parameters in some fonctions, to make them easier to use. So if you use any of the 3 following function, you will need to reorder the parameters if you want to update to the version 1.3 of FastFind. Func FFNearestPixel($PosX, $PosY, $Color, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1) Func FFNearestSpot($SizeSearch, $NbPixel, $PosX, $PosY, $Color, $ShadeVariation=0, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1) Func FFColorCount($ColorToCount, $ShadeVariation=0, $Left=0, $Top=0, $Right=0, $Bottom=0, $ForceNewSnap=true, $NoSnapShot=$FFLastSnap, $WindowHandle=-1) (Update) Version 1.2 I hope these library will prove useful. Please tell me how you use it and how you like it. FF
    1 point
  2. While developing a data visualisation tool I stumbled across >this awesome script by timmy2 and GDI grandwizard UEZ, and although I'm totally crap at graphics (craphics?), I had a stab at adapting it for more general use, incorporating some additional enhancements developed by more able graphics coders such as Beege, MrCreatoR and Malkey (acknowledgements and references to their relevant forum contributions are detailed in the script). Many thanks to you all! The result looks something like this: So just to be absolutely clear: this is not my work, and I do not claim it to be my work. I've only repackaged it so you can easily create and maintain colourful displays like this with a few simple wrapper calls (see the example in the zip). Basically you create it once like a regular control (parse GUI handle, coordinates, size, and number of digits); that call then returns a display ID (1, 2, 3...). At this point the graphic is not yet visible. Internally, I've created specs storage for up to 100 displays; if you need more, just enlarge the array $DigiDispSpecs in the globals region. Subsequently, once the GUI is itself visible, you can repeatedly update the displayed value (just make sure the value fits within the maximum number of digits specified when you created it; if parsing a value with fewer digits, these will be zero-padded). You can also change foreground colour, background colour, glow colour, and the intensity of that glow (range: 1-10; default 0 = off). You parse colour parameters either with colour strings ("red", "blue", "cyan", etc., easily expanded) or with their 6-digit hex RGB value (0xff0000 for red, for example). Remove individual readouts again by calling _DigitalDisplay_Remove($displayID). When you have removed the last digital display, you should call _DigitalDisplay_CleanUp() to avoid memory leaks. That's all, folks! DigitalDisplay.7z beta version 0.9. If it works, thank UEZ, timmy2, Beege, MrCreatoR and Malkey; if if breaks, blame me. Hope you enjoy using it as much as I did cobbling it together! RT
    1 point
  3. Same idea too, but without _ArrayUnique (processing the unique sort in the loop with Assign and IsDeclared). Should be faster #include <Array.au3> #include <StringConstants.au3> $sLines = "41" & @CRLF & _ "C:\drivers\CardReader\jmcr_jm.inf" & @CRLF & _ "C:\drivers\Intel Grafik SP52568\2342hp64.inf" & @CRLF & _ "C:\drivers\Intel IIPS SP52568\Impcd.inf" & @CRLF & _ "C:\drivers\VFS_451 SP52162\vfs451.inf" & @CRLF & _ "C:\drivers\VFS_471 SP52162\vfs471.inf" & @CRLF & _ "C:\drivers\Image\HP HD Webcam [Fixed]\snp2uvc.inf" & @CRLF & _ "C:\drivers\MEDIA\AMD High Definition Audio Device\AtihdLH3.inf" & @CRLF & _ "C:\drivers\MEDIA\Intel(R) Display Audio\IntcDAud.inf" & @CRLF & _ "C:\drivers\Modem\LSI HDA Modem\lsimdv64.inf" & @CRLF & _ "C:\drivers\Net\3Com Dual Port 1000-SX PCI-X Server NIC\b57nd60a.inf" & @CRLF & _ "C:\drivers\Net\3Com Dual Port 1000-SX PCI-X Server NIC\k57nd60a.inf" & @CRLF & _ "C:\drivers\Net\HP Ethernet 10Gb 2-port 560FLB Adapter\ixn62x64.inf" & @CRLF & _ "C:\drivers\Net\HP NC365T PCIe Quad Port Gigabit Server Adapter\E1R62x64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) 82567LM-2 Gigabit Network Connection\E1Y62x64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) 82575EB Multi-Function Network Device\E1Q62x64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) 82579LM Gigabit Network Connection\e1c62x64.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) 82579LM Gigabit Network Connection\e1d62x64.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) 82579LM Gigabit Network Connection\e1k62x64.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) Advanced Network Services Virtual Adapter\ansmw60e.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) Centrino(R) Wireless-N 100\NETwNs64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) Ethernet Connection I217-LM\E1D62x64.INF" & @CRLF & _ "C:\drivers\Net\Realtek PCIe FE Family Controller\netrtx64.inf" & @CRLF & _ "C:\drivers\Net\VMware Accelerated AMD PCNet Adapter\vmware-nic.inf" & @CRLF & _ "C:\drivers\NetTrans\Intel(R) Advanced Network Services Protocol\anspw60e.inf" & @CRLF & _ "C:\drivers\Ports\Intel(R) Active Management Technology - SOL\mesrl.inf" & @CRLF & _ "C:\drivers\Ports\Intel(R) Active Management Technology - SOL\mesrle.inf" & @CRLF & _ "C:\drivers\System\HP Mobile Data Protection Sensor\accelerometer.inf" & @CRLF & _ "C:\drivers\System\Intel(R) Management Engine Interface\HECI.inf" & @CRLF & _ "C:\drivers\System\Intel(R) Management Engine Interface_1\HECI.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gbu11x.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gmdm2.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gsdm2.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gsen.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36wscard.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\WwanUsbMp.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\wwanuss.inf" & @CRLF & _ "C:\drivers\USB3\x64\nusb3hub.inf" & @CRLF & _ "C:\drivers\USB3\x64\nusb3xhc.inf" & @CRLF & _ "C:\drivers\USB3\x86\nusb3hub.inf" & @CRLF & _ "C:\drivers\USB3\x86\nusb3xhc.inf" & @CRLF & _ "C:\drivers\Mouse\Synaptics PS\2 Port Compatible TouchPad\synpd.inf" $aLines = StringSplit($sLines, @CRLF, $STR_ENTIRESPLIT + $STR_NOCOUNT) _ArrayDisplay($aLines, "Full path", Default, 8) $n = 1 For $i = 1 To $aLines[0] $sDir = StringRegExpReplace($aLines[$i], "\\[^\\]+$", "") If NOT IsDeclared( "DIR_" & StringToBinary($sDir) ) Then Assign("DIR_" & StringToBinary($sDir), 1) $aLines[$n] = $sDir $n += 1 EndIf Next Redim $aLines[$n] $aLines[0] = UBound($aLines) - 1 _ArrayDisplay($aLines)
    1 point
  4. doestergaard, Here is my take using the files you listed: #include <Array.au3> #include <StringConstants.au3> $sLines = "41" & @CRLF & _ "C:\drivers\CardReader\jmcr_jm.inf" & @CRLF & _ "C:\drivers\Intel Grafik SP52568\2342hp64.inf" & @CRLF & _ "C:\drivers\Intel IIPS SP52568\Impcd.inf" & @CRLF & _ "C:\drivers\VFS_451 SP52162\vfs451.inf" & @CRLF & _ "C:\drivers\VFS_471 SP52162\vfs471.inf" & @CRLF & _ "C:\drivers\Image\HP HD Webcam [Fixed]\snp2uvc.inf" & @CRLF & _ "C:\drivers\MEDIA\AMD High Definition Audio Device\AtihdLH3.inf" & @CRLF & _ "C:\drivers\MEDIA\Intel(R) Display Audio\IntcDAud.inf" & @CRLF & _ "C:\drivers\Modem\LSI HDA Modem\lsimdv64.inf" & @CRLF & _ "C:\drivers\Net\3Com Dual Port 1000-SX PCI-X Server NIC\b57nd60a.inf" & @CRLF & _ "C:\drivers\Net\3Com Dual Port 1000-SX PCI-X Server NIC\k57nd60a.inf" & @CRLF & _ "C:\drivers\Net\HP Ethernet 10Gb 2-port 560FLB Adapter\ixn62x64.inf" & @CRLF & _ "C:\drivers\Net\HP NC365T PCIe Quad Port Gigabit Server Adapter\E1R62x64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) 82567LM-2 Gigabit Network Connection\E1Y62x64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) 82575EB Multi-Function Network Device\E1Q62x64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) 82579LM Gigabit Network Connection\e1c62x64.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) 82579LM Gigabit Network Connection\e1d62x64.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) 82579LM Gigabit Network Connection\e1k62x64.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) Advanced Network Services Virtual Adapter\ansmw60e.inf" & @CRLF & _ "C:\drivers\Net\Intel(R) Centrino(R) Wireless-N 100\NETwNs64.INF" & @CRLF & _ "C:\drivers\Net\Intel(R) Ethernet Connection I217-LM\E1D62x64.INF" & @CRLF & _ "C:\drivers\Net\Realtek PCIe FE Family Controller\netrtx64.inf" & @CRLF & _ "C:\drivers\Net\VMware Accelerated AMD PCNet Adapter\vmware-nic.inf" & @CRLF & _ "C:\drivers\NetTrans\Intel(R) Advanced Network Services Protocol\anspw60e.inf" & @CRLF & _ "C:\drivers\Ports\Intel(R) Active Management Technology - SOL\mesrl.inf" & @CRLF & _ "C:\drivers\Ports\Intel(R) Active Management Technology - SOL\mesrle.inf" & @CRLF & _ "C:\drivers\System\HP Mobile Data Protection Sensor\accelerometer.inf" & @CRLF & _ "C:\drivers\System\Intel(R) Management Engine Interface\HECI.inf" & @CRLF & _ "C:\drivers\System\Intel(R) Management Engine Interface_1\HECI.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gbu11x.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gmdm2.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gsdm2.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36gsen.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\h36wscard.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\WwanUsbMp.inf" & @CRLF & _ "C:\drivers\USB\HP hs2320 Mobile Broadband Module USB Device\wwanuss.inf" & @CRLF & _ "C:\drivers\USB3\x64\nusb3hub.inf" & @CRLF & _ "C:\drivers\USB3\x64\nusb3xhc.inf" & @CRLF & _ "C:\drivers\USB3\x86\nusb3hub.inf" & @CRLF & _ "C:\drivers\USB3\x86\nusb3xhc.inf" & @CRLF & _ "C:\drivers\Mouse\Synaptics PS\2 Port Compatible TouchPad\synpd.inf" $aLines = StringSplit($sLines, @CRLF, $STR_ENTIRESPLIT + $STR_NOCOUNT) _ArrayDisplay($aLines, "Full path", Default, 8) For $i = 1 To $aLines[0] $aLines[$i] = StringRegExpReplace($aLines[$i], "(^.*\\)(.*)", "\1") Next _ArrayDisplay($aLines, "Folder path", Default, 8) $aUnique = _ArrayUnique($aLines, 0, 1) _ArrayDisplay($aUnique, "Unique folders", Default, 8) M23 Edit: I see mikell had the same idea.
    1 point
  5. ? #include <Array.au3> #include <File.au3> $folderarray = _FileListToArrayRec("C:\Windows\", "*.inf", 1, 1, 0, 2) _ArrayDisplay($folderarray) Dim $paths[$folderarray[0]] For $i = 1 to $folderarray[0] $paths[$i-1] = StringRegExpReplace($folderarray[$i], '(.+)\\[^\\]+', "$1") Next _ArrayDisplay($paths) $res = _ArrayUnique($paths) _ArrayDisplay($res)
    1 point
  6. possy_99, No problem - can happen to us all. M23
    1 point
  7. How about posting your code, along with the problems you're having, rather than asking us to guess
    1 point
  8. KaFu

    WM_MENUCOMMAND doesn't work?

    The documented flags are wrong. You need to apply MNS_NOTIFYBYPOS to the header (main) menu ("MNS_NOTIFYBYPOS is a menu header style and has no effect when applied to individual sub menus."). Also note: "The WM_MENUCOMMAND message gives you a handle to the menu—so you can access the menu data in the MENUINFO structure—and also gives you the index of the selected item, which is typically what applications need. In contrast, the WM_COMMAND message gives you the menu item identifier." #include <GuiMenu.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $iMemo Global Enum $idNew = 1000, $idOpen, $idSave, $idExit, $idCut, $idCopy, $idPaste, $idAbout Example() Func Example() Local $hGUI, $hFile, $hEdit, $hHelp, $hMain ; Create GUI $hGUI = GUICreate("Menu", 400, 300) ; Create File menu $hFile = _GUICtrlMenu_CreateMenu(8 + 32) ConsoleWrite(@error & @CRLF) _GUICtrlMenu_InsertMenuItem($hFile, 0, "&New", $idNew) _GUICtrlMenu_InsertMenuItem($hFile, 1, "&Open", $idOpen) _GUICtrlMenu_InsertMenuItem($hFile, 2, "&Save", $idSave) _GUICtrlMenu_InsertMenuItem($hFile, 3, "", 0) _GUICtrlMenu_InsertMenuItem($hFile, 4, "E&xit", $idExit) ; Create Edit menu $hEdit = _GUICtrlMenu_CreateMenu(8 + 32) _GUICtrlMenu_InsertMenuItem($hEdit, 0, "&Cut", $idCut) _GUICtrlMenu_InsertMenuItem($hEdit, 1, "C&opy", $idCopy) _GUICtrlMenu_InsertMenuItem($hEdit, 2, "&Paste", $idPaste) ; Create Help menu $hHelp = _GUICtrlMenu_CreateMenu(8 + 32) _GUICtrlMenu_InsertMenuItem($hHelp, 0, "&About", $idAbout) ; Create Main menu $hMain = _GUICtrlMenu_CreateMenu($MNS_NOTIFYBYPOS) _GUICtrlMenu_InsertMenuItem($hMain, 0, "&File", 0, $hFile) _GUICtrlMenu_InsertMenuItem($hMain, 1, "&Edit", 0, $hEdit) _GUICtrlMenu_InsertMenuItem($hMain, 2, "&Help", 0, $hHelp) ; Set window menu _GUICtrlMenu_SetMenu($hGUI, $hMain) ; Create memo control $iMemo = GUICtrlCreateEdit("", 2, 2, 396, 276, 0) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") GUISetState(@SW_SHOW) ; Loop until the user exits. GUIRegisterMsg($WM_MENUCOMMAND, "WM_MENUCOMMAND") ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE EndFunc ;==>Example ; Handle menu commands Func WM_MENUCOMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $ilParam ConsoleWrite($hWnd & @TAB & $iMsg & @TAB & $iwParam & @TAB & $ilParam & @CRLF) ConsoleWrite(_GUICtrlMenu_GetItemText($ilParam, $iwParam) & @CRLF) Switch _WinAPI_LoWord($iwParam) Case $idNew MemoWrite("New") Case $idOpen MemoWrite("Open") Case $idSave MemoWrite("Save") Case $idExit Exit Case $idCut MemoWrite("Cut") Case $idCopy MemoWrite("Copy") Case $idPaste MemoWrite("Paste") Case $idAbout MemoWrite("About") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_MENUCOMMAND ; Write message to memo Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite
    1 point
  9. gspot, Welcome to the AutoIt forums. While...WEnd is the way to go - Sleep(10) will be sufficient to keep the CPU cool. M23
    1 point
  10. I shall call it "The JohnOne Loop".
    1 point
  11. I mistyped once and stuck with it It's a trade mark now.
    1 point
  12. JohnOne

    Need help on JavaScripting

    Perhaps you missed the sign on the way in that says "AutoIt".
    1 point
  13. @RTFC: I'm only an hobbyist coder with interests in graphical stuff and have no pro background. Everything I learned in GDI+ is owed to this forum and its pioneers of GDI+ (monoceres, Malkey, Smashly, Authenticity, etc.). Prerequisites are some basic understandings in maths (vectors, trigonometry, etc.). MSDN is hard to understand at the beginning. Br, UEZ
    1 point
×
×
  • Create New...