It looks like the system does not have time to redraw the window after filling in the ListBox. Give her a little time :)
You can try for example:
Code: Select all
#Include Once "window9.bi"
Function OpenWindow_0() As HWND
Var hwnd_0 = OpenWindow("Win0",10,10,500,300)
ListBoxGadget(1,10,10,100,200)
SendMessage(GadgetID(1),LB_SETHORIZONTALEXTENT,200,0)
For r As Long = 0 To 400
AddListBoxItem(1,Str(r) +" AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
Next
For i As Long = 0 To 30
WindowEvent
Next
Var hbitmap = CreateCopyImageRect(hwnd_0,GadgetX(1),GadgetY(1),_
GadgetWidth(1),GadgetHeight(1))
ImageGadget(2,120,10,GadgetWidth(1),GadgetHeight(1),hbitmap)
Return hwnd_0
End Function
OpenWindow_0()
Do: Loop until WaitEvent = EventClose