I'm sorry Froggerprogger, but that is not a good solution.
First of all, this only updates the client area, the window top will look quite
ugly, if you move some other window over it.
This functiony just bypasses all of PB's own message handling, wich,
doesn't cause any problems right now, but it may very well be a problem
in future versions. As Danilo allready said, they change internal stuff if
it's neccessary without telling everybody, so maybe some day, all your
code just stops working right, and you don't know why.
Why don't you yust use PB's own functions for this? This way you can be
sure, it will work forever.
If you don't want to use WaitWindowEvent(), but only just update the
window, use this:
This just processes all messages in the queue, and does all neccesary updating.
BTW: If you include a close Button on top of your window
(#PB_Window_SystemMenu flag), you should always check, if the user
pressed it. What else would it be there for?
the UpdateWindow_() function doesn't check that, but you can easily check
it wit WindowEvent().
Something like this is a good way here:
Code: Select all
Procedure PBUpdateWindows()
Repeat
Event.l = WindowEvent()
If Event = #PB_EventCloseWindow
End
; or some other action to do
Endif
Until Event = 0
EndProcedure
You should always check for things like that, so no events are lost. If there
is a button on your Window, and pressing it has no effect, the user may
think the program is hung and close it with TaskManager.
Hum, that's just my opinion, if you want, use UpdateWindow_(), but IMHO,
it's not a good way.
Timo