Getting the screen object's hDC 
Author Message
 Getting the screen object's hDC

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.



Sun, 12 Dec 1999 03:00:00 GMT  
 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



Mon, 13 Dec 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting an hDC for a IPictureDisp object.

2. Getting an hDC for a IPictureDisp object.

3. Getting an hDC for a IPictureDisp object.

4. Get hDc for controls that don't expose hDc property

5. Help! I'm getting [object Object]

6. Getting the screen's address (BLOAD)

7. screen.hdc anyone

8. screen.hdc - solved it !!!!!!

9. hDC to screen

10. Getting hDc On Access

11. Getting hWnd or hDC of custom OCX?

12. Using PrintDlg and getting hDC of named printer

 

 
Powered by phpBB® Forum Software