Jump to content

_LoadString($Filehwnd,$StringId)


Raik
 Share

Recommended Posts

#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 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

done.

Liked your idea, so I went ahead and added the _WinAPI_LoadString($hInstance, $iStringId) function which was not in the WinAPI library

This 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...