i was wondering if it was possible to draw directly on the desktop. for example,
screen.line (0,0)-(screen.scalewidth,screen.scaleheight)
or something like that so you draw things directly on the desktop instead of a picture box.
is this possible?
Printable View
i was wondering if it was possible to draw directly on the desktop. for example,
screen.line (0,0)-(screen.scalewidth,screen.scaleheight)
or something like that so you draw things directly on the desktop instead of a picture box.
is this possible?
Of course.
You can get the Desktop (screen) DC with two short API calls. Then draw on it with any function which draws on a DC (like BitBlt, LineTo and so on)
Code:'In module
Public Declare Function GetDesktopWindow Lib "user32" Alias "GetDesktopWindow" () As Long
Public Declare Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As Long) As Long
Public Declare Function LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
'Anywhere
Dim DC as Long
'Get DC
DC = GetWindowDC( GetDesktopWindow )
'Draw Line from current pos to 100, 300
LineTo DC, 100, 300
eh, haven't tested that yet, but i think it will erase as soon as something covers it. Seen my thread?
That's right. As soon as you press F5 the drawed things will disappear. Also they don't stay if you move the window below...
Then that's it, I'm going to sit here too with my sunglasses, waiting for someone to come up with the solution.