I tried, but sorry still not working, curious no?russellbdavis wrote:Perhaps, move the OpenWindow() procedure past the 'End' statement, to the bottom of your code.
Code: Select all
UseJPEGImageDecoder()
UseJPEGImageEncoder()
LoadImage (5, "pic1.jpg")
hBrush = CreatePatternBrush_(ImageID(5))
Declare open_window()
open_window()
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
Procedure open_window()
If OpenWindow(0, 218, 0, 1031, 405, "MOROSH SERIAL PORT MONITOR", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar )
SetClassLongPtr_(WindowID(0), #GCL_HBRBACKGROUND, hBrush)
InvalidateRect_(WindowID(0), 0, 1)
EndIf
EndProcedure



