Raik Posted November 15, 2007 Share Posted November 15, 2007 (edited) #AutoIt3Wrapper_useansi=y Func _LoadString($File,$StringId) Local $String,$StringResult $Dll = DllCall("Kernel32.dll","hwnd","LoadLibraryExA","str",$File,"hwnd",0,"int",2) $String = DllCall("user32.dll","int","LoadStringA","ptr",$Dll[0],"int",$StringId,"str",$StringResult,"int",255) DllCall("Kernel32.dll","long","FreeLibrary","long",$Dll[0]) If $String[0] > 0 Then Return $String[3] EndFunc Edited March 25, 2010 by Raik AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1) Link to comment Share on other sites More sharing options...
XxXFaNtA Posted November 15, 2007 Share Posted November 15, 2007 Works great! Have searched for something like that! Now would it also be possible to actually change the Text? /[center][/center] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 15, 2007 Moderators Share Posted November 15, 2007 Shouldn't you free the library? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
weaponx Posted November 15, 2007 Share Posted November 15, 2007 My library is already free, I just show them my card and off I go with my books. Link to comment Share on other sites More sharing options...
XxXFaNtA Posted November 16, 2007 Share Posted November 16, 2007 Should that be funny? /[center][/center] Link to comment Share on other sites More sharing options...
therks Posted November 16, 2007 Share Posted November 16, 2007 I thought it was funny. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
BrettF Posted November 16, 2007 Share Posted November 16, 2007 Same here... And now on topic, it looks good Should probably do what Smoke says to... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
GaryFrost Posted November 18, 2007 Share Posted November 18, 2007 _WinAPI_LoadLibraryEx _WinAPI_FreeLibrary Only thing missing from the _WinAPI for this is the LoadString SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Raik Posted November 18, 2007 Author Share Posted November 18, 2007 (edited) sorry? what do you taking about? should i add something like dllclose or set $Dll and $String to zero? i'm not shure, its my first use of dlls. :-O Edited November 18, 2007 by Raik AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1) Link to comment Share on other sites More sharing options...
therks Posted November 18, 2007 Share Posted November 18, 2007 Add in a line like this? DllCall("Kernel32.dll","long","FreeLibrary","long",$Dll[0]) After the LoadStringA call. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
Raik Posted November 19, 2007 Author Share Posted November 19, 2007 done. AutoIt-Syntaxsheme for Proton & Phase5 * Firefox Addons by me (resizable Textarea 0.1d) (docked JS-Console 0.1.1) Link to comment Share on other sites More sharing options...
GaryFrost Posted November 20, 2007 Share Posted November 20, 2007 done.Liked your idea, so I went ahead and added the _WinAPI_LoadString($hInstance, $iStringId) function which was not in the WinAPI libraryThis is the function header in 3.2.9.13 beta; #FUNCTION# ====================================================================================================================; Name...........: _WinAPI_LoadString; Description ...: loads a string resource from the executable file associated with a specified module; Syntax.........: _WinAPI_LoadString($hInstance, $iStringId); Parameters ....: $hInstance - Handle to an instance of the module whose executable file contains the string resource; $iStringId - Specifies the integer identifier of the string to be loaded; Return values .: Success - The string requested, @extended is the number of TCHARS copied; Failure - Empty string and @error is set; Author ........: Gary Frost used correct syntax, Original concept Raik; Modified.......:; Remarks .......:; Related .......: _WinAPI_LoadLibraryEx, _WinAPI_FreeLibrary; Link ..........; @@MsdnLink@@ LoadString; Example .......; Yes; =============================================================================================================================== SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. 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