
Maybe some PB-expert can help me out here:
I am trying to get the text which is contained in the resource of the exe into a string variable by using the "LoadText_()" API function.
When trying this in order to display icons or bitmaps my code works just fine. But I can't get the text string to work...
Perhaps I am missing something in my code but don't know what I am doing wrong: Here is the source code:
Code: Select all
#ImageGadget_1 = 1
#ImageGadget_2 = 2
If OpenWindow(0,0,0,300,200,"ImageGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ImageGadget(#ImageGadget_1, 4,4,100,100,0,#PB_Image_Border)
ImageGadget(#ImageGadget_2, 104,4,100,100,0,#PB_Image_Border)
hinstance=GetClassLong_(WindowID(0),#GCL_HMODULE)
IconhWnd=LoadIcon_(hinstance, @"#1") ;get Icon_Resource handle / No_1
BitmapWnd = LoadBitmap_(hinstance,@"#2") ;get Bitmap_Resource handle / No_1
TextWnd = LoadString_(hinstance,1,@"#1",10) ;get Text_Resource handle / No_1
; Display Icon_Resource
SetGadgetState(#ImageGadget_1,IconhWnd)
DestroyIcon_(IconhWnd)
; Display Bitmap Resource
SetGadgetState(#ImageGadget_2,BitmapWnd)
DestroyIcon_(BitmapWnd)
; Display Text Resource
Text$ = Str(TextWnd)
MessageRequester("Info",Text$,0)
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf