I try to draw a rectangle directly on the Desktop with the following Function
Code: Select all
Procedure DrawRectOnScreen()
CallDebugger
;Draw on Screen
lngDC.l = 0
lngPen.l = 0
lngRetValue.l = 0
;Get The Desktop DC
lngDC = GetDesktopWindow_()
Debug lngDC
;Create a new solid Pen, Width 5, Color Blue
lngPen = createPen_(#PS_SOLID, 5, RGB(192,214,20))
Debug lngPen
If lngDC <> 0 And lngPen <> 0
structRect.RECT
structRect\right = 500
structRect\left = 500
structRect\bottom = 500
structRect\top = 500
;Draw the Rectangle on Desktop
lngRetValue = rectangle_(lngDC, structRect\right, structRect\left, structRect\bottom, structRect\top)
Debug lngRetValue
EndIf
;Free Memory
deleteObject_(lngPen)
EndProcedure
Thanks in advance for your help