AutoIT Geek Posted December 7, 2005 Posted December 7, 2005 (edited) NO ONE COULD DO A SIMPLE DLL ?? EAT YOUR SHOOSE I NOW HAVE THE SECRET TO IMMORTALITY, IE, FUNCTION POINTERS IN AUTOIT it works in the release and all the ltest betas. i can do CALLBACKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Edited December 7, 2005 by AutoIT Geek
Helge Posted December 7, 2005 Posted December 7, 2005 *Kapow kapow*... Eeey, this ain't about Kung Fu !!
Walkabout Posted December 9, 2005 Posted December 9, 2005 I NOW HAVE THE SECRET TO IMMORTALITY, IE, FUNCTION POINTERS IN AUTOIT it works in the release and all the ltest betas.i can do CALLBACKS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!You gonna share or just gloat?Walkabout My Stuff:AutoIt for the MassesWait until Oracle Apps is readySend email natively from Autoit3
AutoIT Geek Posted December 14, 2005 Author Posted December 14, 2005 well ppl, after several requests to share my secret to ... ( you know ) ... im willing to do that ... BUT ... for a price ... my request is very simple ... GIVE ME THE WORLD no ? ok, i'll sattle for a cent by paypal account. no too ? fine. as some of us know, in autoit there is no direct method to get address of variables or functions what a shame, VERY VERY LIMITING. there are several ways to bypass this limit, i worked it out. heres one, it involves writing the CALLBACK in a different DLL and then using autoits DLLCALL to do ... another ... DLL CALL ( LoadLibrary() ) then, using DLLCALL and GetProcAddress() to get the function address y, i know, VERY ... but it works for my own testing i chose Win API - EnumChildWindows() the dll i wrote is atteched so download and place it in the SAME dir where you save the script otherwise, point $CallbackDLL to the right folder enjoy expandcollapse popupOpt( "TrayIconDebug", 1 ) #include <array.au3> Global $WinHandle, $CallbackDLL, $FuncName, $ControlID Global $DLL[ 2 ], $FuncAddr[ 3 ], $WinHandle[ 3 ], $Result[ 4 ] $WinTitle = 'Calculator'; $CallbackDLL = 'Callback.dll'; this DLL has the CALLBACK function for THIS script $FuncName = 'EnumProc' $ControlID = 'Sta'; $ControlID is the control text ( for this progy ), Calculator MUST be in scientific mode $WinHandle = DllCall( 'user32.dll', 'hwnd', 'FindWindow', 'int', 0, 'str', $WinTitle ); Get Window Handle _ArrayDisplay( $WinHandle, '1' ) If $WinHandle[ 0 ] == '0x00000000' Then; DLLCALL Failed for whatever reason, no valid handle MsgBox( 0, 'Error', 'DLLCALL Failed' ) Else $DLL = DllCall( 'kernel32.dll', 'hwnd', 'LoadLibrary', 'str', $CallbackDLL ); Load DLL _ArrayDisplay( $DLL, '2' ) If $DLL[ 0 ] == '0x00000000' Then; DLLCALL Failed for whatever reason, no valid handle MsgBox( 0, 'Error', 'DLLCALL Failed' ) Else $FuncAddr = DllCall( 'kernel32.dll', 'ptr', 'GetProcAddress', 'hwnd', $DLL[ 0 ], 'str', $FuncName ); Get Function Address _ArrayDisplay( $FuncAddr, '3' ) If $FuncAddr[ 0 ] == 0 Then; DLLCALL Failed for whatever reason or Function NOT Found MsgBox( 0, 'Error', 'DLLCALL Failed or Function NOT Found' ) Else $Result = DllCall( 'user32.dll', 'int', 'EnumChildWindows', 'hwnd', $WinHandle[ 0 ], 'ptr', $FuncAddr[ 0 ], 'str', $ControlID ); GO _ArrayDisplay( $Result, '4' ); EnumProc returns FALSE ( 0 ) if it finds $ControlID so dont be alarmed $DLL = DllCall( 'kernel32.dll', 'int', 'FreeLibrary', 'hwnd', $DLL[ 0 ] ); Free DLL _ArrayDisplay( $DLL, '5' ) EndIf EndIf EndIfCallback.dll
seandisanti Posted December 14, 2005 Posted December 14, 2005 well ppl, after several requests to share my secret to ... ( you know ) ... im willing to do that ... BUT ... for a price ... my request is very simple ... GIVE ME THE WORLD no ? ok, i'll sattle for a cent by paypal account. no too ? fine. as some of us know, in autoit there is no direct method to get address of variables or functions what a shame, VERY VERY LIMITING. there are several ways to bypass this limit, i worked it out. heres one, it involves writing the CALLBACK in a different DLL and then using autoits DLLCALL to do ... another ... DLL CALL ( LoadLibrary() ) then, using DLLCALL and GetProcAddress() to get the function address y, i know, VERY ... but it works for my own testing i chose Win API - EnumChildWindows() the dll i wrote is atteched so download and place it in the SAME dir where you save the script otherwise, point $CallbackDLL to the right folder enjoy expandcollapse popupOpt( "TrayIconDebug", 1 ) #include <array.au3> Global $WinHandle, $CallbackDLL, $FuncName, $ControlID Global $DLL[ 2 ], $FuncAddr[ 3 ], $WinHandle[ 3 ], $Result[ 4 ] $WinTitle = 'Calculator'; $CallbackDLL = 'Callback.dll'; this DLL has the CALLBACK function for THIS script $FuncName = 'EnumProc' $ControlID = 'Sta'; $ControlID is the control text ( for this progy ), Calculator MUST be in scientific mode $WinHandle = DllCall( 'user32.dll', 'hwnd', 'FindWindow', 'int', 0, 'str', $WinTitle ); Get Window Handle _ArrayDisplay( $WinHandle, '1' ) If $WinHandle[ 0 ] == '0x00000000' Then; DLLCALL Failed for whatever reason, no valid handle MsgBox( 0, 'Error', 'DLLCALL Failed' ) Else $DLL = DllCall( 'kernel32.dll', 'hwnd', 'LoadLibrary', 'str', $CallbackDLL ); Load DLL _ArrayDisplay( $DLL, '2' ) If $DLL[ 0 ] == '0x00000000' Then; DLLCALL Failed for whatever reason, no valid handle MsgBox( 0, 'Error', 'DLLCALL Failed' ) Else $FuncAddr = DllCall( 'kernel32.dll', 'ptr', 'GetProcAddress', 'hwnd', $DLL[ 0 ], 'str', $FuncName ); Get Function Address _ArrayDisplay( $FuncAddr, '3' ) If $FuncAddr[ 0 ] == 0 Then; DLLCALL Failed for whatever reason or Function NOT Found MsgBox( 0, 'Error', 'DLLCALL Failed or Function NOT Found' ) Else $Result = DllCall( 'user32.dll', 'int', 'EnumChildWindows', 'hwnd', $WinHandle[ 0 ], 'ptr', $FuncAddr[ 0 ], 'str', $ControlID ); GO _ArrayDisplay( $Result, '4' ); EnumProc returns FALSE ( 0 ) if it finds $ControlID so dont be alarmed $DLL = DllCall( 'kernel32.dll', 'int', 'FreeLibrary', 'hwnd', $DLL[ 0 ] ); Free DLL _ArrayDisplay( $DLL, '5' ) EndIf EndIf EndIfhaven't tried it myself yet, but thanks for posting, this is a need that alot of people have been looking for...
rysiora Posted December 26, 2005 Posted December 26, 2005 How does it work? How use it? Any help/tutorial?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now