I made following little example for a member of the purebasic-lounge.com chat.
It shows, how to load strings from stringtable in a DLL file on windows.
To load strings from system DLLs is very advantageous.
'Cause so you can abstain from language files in many cases and the texts in shell32 and user32 DLLs are by default in the language of the current windows installation. (IMHO&AFAIK)
You can examine the IDs of stringtable strings very easy by using the legendary ressourcehacker tool.
Downloadable here: http://angusj.com/resourcehacker/
Code: Select all
; Http://www.purebasic-lounge.com
; Hroudtwolf
; PureBasic 4.x
; Windows
Define.l hLib = LoadLibrary_( "shell32.dll" ) ; Loading library
Define.s sptrBuffer = Space ( 255 ) ; Buffer for receiving strings
Define.l lI
If Not hLib ; DLL not found ?
End
EndIf
; Examining strings from lib
For lI = 60 To 63 ; IDs 60-62
LoadString_( hLib ,lI , @ sptrBuffer , 255 )
Debug sptrBuffer
Next lI
For lI = 4161 To 4175 ; IDs 4161-4175
LoadString_( hLib ,lI , @ sptrBuffer , 255 )
Debug sptrBuffer
Next lI
FreeLibrary_( hLib )
Wolf