JohnOne Posted August 23, 2010 Share Posted August 23, 2010 (edited) Have you ever had one of those moments where you have a thought, a moment of clarity. then as quick as it happend its gone again? Well I did earlier today and I spent a while trying to invoke the thought again, unsucsessfuly. All I remember was I wondered if you could call functions from Autoit3X.dll from within a regular AU3 script, and I think the thought was how such a thing could be useful. So my question is can you think of a scenario where it might be useful? I hope I'm making sense. Edited August 23, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 23, 2010 Share Posted August 23, 2010 (edited) Considering AutoItX can't do anything that raw AutoIt can't, I'd have to say no. Edited August 23, 2010 by Richard Robertson Link to comment Share on other sites More sharing options...
trancexx Posted August 23, 2010 Share Posted August 23, 2010 @JohnOne, Something like this? expandcollapse popupGlobal $sAutoItX = RegRead("HKLM\Software\Wow6432Node\AutoIt v3\Autoit", "InstallDir") & "\AutoItX\AutoItX3_x64.dll" ConsoleWrite("-> File is: " & $sAutoItX & @CRLF) Global $oAutoIt = ObjCreate("AutoItX3.Control") If Not IsObj($oAutoIt) Then _SomeCoolRegisterFunc($sAutoItX) $oAutoIt = ObjCreate("AutoItX3.Control") EndIf If Not IsObj($oAutoIt) Then MsgBox(48 + 262144, "Ahh!", "Something is wrong. God knows what.") Exit -1 EndIf ; THIS... $oAutoIt.ToolTip("This is some tip from AutoItX version " & $oAutoIt.Version & @LF & "Visible enough?") $oAutoIt.Sleep(2000) $oAutoIt.ToolTip("") $oAutoIt.ToolTip("Bye bye now...") $oAutoIt.Sleep(800) ; Functions: Func _SomeCoolRegisterFunc($sModule) If IsAdmin() Then Return _RegisterServer($sModule) Local $sShellExecuteString = ' /AutoIt3ExecuteLine ' & _ '"Exit (' & _ 'DllCall(''ole32.dll'', ''long'', ''OleInitialize'', ''ptr'', 0) & ' & _ 'DllCall(''' & $sModule & ''', ''long'', ''DllRegisterServer'')' & _ ')"' ShellExecuteWait('"' & @AutoItExe & '"', $sShellExecuteString, "", "runas", @SW_HIDE) EndFunc ;==>_SomeRegisterFunc Func _RegisterServer($sDll) Local $fInit, $fError Local $aCall = DllCall("ole32.dll", "long", "OleInitialize", "ptr", 0) If Not @error Then $fInit = $aCall[0] <> 1 ; The COM library is already initialized $aCall = DllCall($sDll, "long", "DllRegisterServer") If @error Then $fError = True If $fInit Then DllCall("ole32.dll", "none", "OleUninitialize") If $fError Then Return SetError(2, 0, False) Return SetError($aCall[0] <> 0, $aCall[0], $aCall[0] = 0) EndFunc ;==>_RegisterServer Btw, that's dumb. You know why? ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
JohnOne Posted August 23, 2010 Author Share Posted August 23, 2010 is it because its using the interpreter to make the call, and so its just plain slower that doing it normally? My thought probably disappeard because it was stupid really, so its probably for the best I dont recall it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
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