
Getting the screen object's hDC
Quote:
> I would like to use the API MoveTo and LineTo functions to draw on the
> screen object from within a VB program. How do I get the handle to the
> screen device context? Thanks for any help!
> --
> Steve Brey
> Numonics Corporation
> Engineering Dept.
In 16bit VB:
Declare Function ReleaseDC Lib "User" (ByVal hWnd As Integer, ByVal
hDC As Integer) As Integer
Declare Function GetDC Lib "User" (ByVal hWnd As Integer) As Integer
...
Dim hDC As Integer
hDC = GetDC(0)
' do whatever you want with the hDC
...
When you're finished with the DC be sure to release it:
RetVal = ReleaseDC(0, hDC)
-chris