stealFunc is a function-oriented script (tool) to extract only the required functions from an ahk library .
It recursively processes the library file to only extract functions that are minimally needed.
From v0.1 , it has feature to scan a autohotkey script snippet and extract the foreign functions that are used in that script from another given script.
EXAMPLE USE -
The following function is based on the gdip library
Code: Select all
SetImagetoClipboard( pImage ){
;Sets some Image file to Clipboard
PToken := Gdip_Startup()
pBitmap := Gdip_CreateBitmapFromFile(pImage)
Gdip_SetBitmaptoClipboard(pBitmap)
Gdip_DisposeImage( pBitmap )
Gdip_Shutdown( PToken)
}
These functions in the lib may be dependent on other functions in the lib which in turn may be dependent on more functions and so on...Gdip_Startup
Gdip_CreateBitmapFromFile
Gdip_DisposeImage
Gdip_shutdown
gdip_setbitmaptoclipboard
Extracting only the needed functions manually can get tedious.
So to shorten the process, I made this script which is presented as function .
Code: Select all
return_script := stealFunc(function_list, function_file)
;EXAMPLE
Clipboard := stealFunc("Gdip_Startup`nGdip_SetBitmaptoClipboard`nGdip_CreateBitmapFromFile`nGdip_DisposeImage`nGdip_Shutdown", "<path_to_gdip_lib>")
Below are screenshots of the GUI in action.
Spoiler
Tip - To check if the extracted file is OK and doesn't contain bugs, run it as a separate script. If everything is OK , you will not see an error.DOCUMENTATION