|
-
Apr 23rd, 2000, 03:12 AM
#1
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?
-
Apr 23rd, 2000, 03:18 AM
#2
PowerPoster
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
-
Apr 23rd, 2000, 04:25 AM
#3
transcendental analytic
eh, haven't tested that yet, but i think it will erase as soon as something covers it. Seen my thread?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 23rd, 2000, 04:48 AM
#4
PowerPoster
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...
-
Apr 23rd, 2000, 05:42 AM
#5
transcendental analytic
Then that's it, I'm going to sit here too with my sunglasses, waiting for someone to come up with the solution.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|