Ok, this is probably far from advanced, but it's still quite cool.
Code: Select all
Declare FormWndProc (Hwnd, uMsg, wParam, lParam)
Declare PaintForm()
#Window_0 = 0
OpenWindow(#Window_0, 246, 197, 382, 279, "Our desktop window...", #PB_Window_SizeGadget | #PB_Window_MaximizeGadget | #PB_Window_MinimizeGadget)
SetWindowCallback(@FormWndProc())
PaintForm()
Repeat
EVENT = WaitWindowEvent()
Until EVENT = #PB_Event_CloseWindow
Procedure FormWndProc (Hwnd, uMsg, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
If uMsg = #WM_MOVING Or uMsg = #WM_SIZING Or uMsg = #WM_PAINT
PaintForm()
EndIf
ProcedureReturn Result
EndProcedure
Procedure PaintForm()
PaintDesktop_(GetDC_(WindowID(#Window_0)))
EndProcedure