I think that the idea I suggested might be implemented very easily. All the commands or functions that take a image file name can simply work with HBITMAP handle number without much work. I looked the source code of AHK_L in Github. It seems that "LoadPicture()" function in util.cpp loads all the images from file.
So, in "LoadPicture" function, add check for the file name like "ahk_handle 123456" form, which is not valid file name obviously. Then just parse the "123456" part (may be hexa decimal, too) into integer and cast it as HBITMAP handle and return it as return value of LoadPicture function. It won't take much source code change. The "ahk_handle" may be omitted, too. Just simply, if the file name is pure interger string(decimal or hexa) without no dot(period character) in it, it is very safe to assume that it is HBITMAP handle number and not valid file name. Just add following code in LoadPicture function.
unsined h = strtol( Filename, NULL, 0);
if ( h != 0 )
return ((HBITMAP) h);
Then, all the function and commands that takes image file name argument will work magically with HBITMAP handle, too, specified in forms like SearchImage, ,,,,, %hbmp% . It will open endless new utilization idea and possibility for such functions and comamnds.
And add new function that takes a (picture) file name or a variable with memory buffer (with VarSetCapacity) with picture image data in it as its argument and return a HBITMAP handle from it. Then it will open many new programming possibility for handling image files.
How about that?