Credit/Acknowledgements
Large portions of this code were directly extracted/modified from AutoHotkey_L distribution v1.0.92.02 (https://github.com/L...os/AutoHotkey_L) - Many thanks to Lexikos
As such, all distributions of this library include the source used to build the files (in the Source folder), and have been duly commented with any an all changes from the original source, as required under the GNU General Public License v2. Furthermore, as a derivative work, all files in this distribution are subject to the same licensing terms as AutoHotkey_L, and a copy of these licensing terms have been included in the distribution for your reference.Overview
The overall purpose of this library is to provide a modified version of AHK's ImageSearch function that allows the caller to search an image on the clipboard, rather than the screenshot taken internally using GDI/GDI+. This library distribution consists of two parts:
[*:38wrmfil]A compiled DLL, which contains the modified version of the ImageSearch implementation from the AHK_L source (i.e. ImageSearchClip). In order to support different builds of AHK_L, four precompiled versions of this DLL have been provided (32-Bit Unicode, 32-Bit ANSI, 64-Bit Unicode, and 64-Bit ANSI). Please note that scripts should't need to worry about which version to call, as this is handled by the AHK wrapper script.
[*:38wrmfil]An AHK script that wraps the call to the native function. This wrapper function (_ImageSearchClip), handles the following tasks for the caller:
[*:38wrmfil]Determining the correct DLL to load and pre-loading it (for better performance).
[*:38wrmfil]Invoking the native function via DllCall
[*:38wrmfil]Translating the output from the native function to something that is consistent to the expected behavior of it's progenitor function, ImageSearch.[/list][/list]Please refer to the Released\Lib\_ImageSearchClip.ahk file for more information about the wrapper function, including the parameter list, call syntax, and some examples.
Compatibility
The DLL's are built to support Window 2000 and higher, and do not officially support Windows 95/98/Me (if anyone is even still using those). I'm not saying with absolute certainty that it won't work on those operating systems, but if you use it and have any issues, you're on your own. I won't be able to help you.
The wrapper script should be compatible with all flavors of AHK v1.0.48.05 or AHK_L v1.0.92.02 and higher. However, I was only able to test with AHK_L v1.0.92.02 (32 ANSI version), so a lot of the support I added is based on the documentation for the two versions (i.e. it should work fine, but as with life, nothing is 100%). The same goes for
different builds of AHK_L (Unicode/ANSI, 32/64-Bit). I guess what I'm saying is, I made a best effort to support as many versions as possible, but your mileage may vary.

Also, this version does not support precompiled scripts in any way. Like the blurb I made about Win9x/Me support, if it works for you, great. Otherwise, I won't be able to help (nor would I know where to begin).
Installation
To install the library, simply extract the contents of the Distributed folder to your AutoHotkey installation folder, which is usually C:\Program Files\AutoHotkey or C:\Program Files (x86)\AutoHotkey, depending on your version of Windows and which build of AHK you have installed. Assuming the default installation location, once installed, you should have following files/folders:
[*:38wrmfil]%AHK Install Path%\Bin\ImgSearch32A.DLL
[*:38wrmfil]%AHK Install Path%\Bin\ImgSearch32W.DLL
[*:38wrmfil]%AHK Install Path%\Bin\ImgSearch64A.DLL
[*:38wrmfil]%AHK Install Path%\Bin\ImgSearch64W.DLL
[*:38wrmfil]%AHK Install Path%\Lib\_ImageSearchClip.ahk[/list]After installation, you can call _ImageSearchClip as you would any other built-in AHK or AHK_L function. Including the ImageSearchClip.ahk is not required, although you can still do so if you wish. You just have to ensure that you include it using the absolute path to the file, otherwise AHK will be unable to resolve the file location, producing an error when you load the script.
Change Log/Version History
[*:38wrmfil]Version 1.0.0.0
[*:38wrmfil]Initial public release.[/list]Download
Version 1.0.0.0 (Beta)