GetDC() should be paired with a ReleaseDC() call otherwise you'll get an eventual GDI leak.
See:
http://msdn.microsoft.com/en-us/library/aa921543.aspx "After painting with a common device context, the ReleaseDC function must be called to release the device context."
If going that route I would do:
Private Declare Function GetDesktopWindow Lib "user32" () As IntPtr
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As IntPtr) As IntPtr
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As IntPtr, ByVal hdc As Integer) As Integer
...
Dim desktopHwnd As IntPtr = GetDesktopWindow()
Dim desktopHdc As IntPtr = GetWindowDC(desktopHwnd)
Dim G As Graphics = Graphics.FromHdc(desktopHd
c)
G.DrawLine(Pens.Red, 0, 0, 1024, 768)
G.Dispose()
ReleaseDC(desktopHwnd, desktopHdc)