Desktop Handle

  • Thread starter Thread starter Juan Romero
  • Start date Start date
J

Juan Romero

Hi guys,

Does anyone know how I can get a handle to the desktop or the screen? (of
for this matter, the device context handle)

I want a program to write some stuff there, but I can't seem to get a
handle. I tried calling API functions, but they return me a negative handle
(-99999), so although the calls I make subsequently do not raise any errors,
nothing gets written to the screen.

Please help.
 
* "Juan Romero said:
Does anyone know how I can get a handle to the desktop or the screen? (of
for this matter, the device context handle)

I want a program to write some stuff there, but I can't seem to get a
handle. I tried calling API functions, but they return me a negative handle
(-99999), so although the calls I make subsequently do not raise any errors,
nothing gets written to the screen.

Did you try it with these declares?

\\\
Private Declare Auto Function GetDesktopWindow Lib "user32.dll" ( _
) As IntPtr
Private Declare Auto Function GetDC Lib "user32.dll" ( _
ByVal hwnd As IntPtr _
) As IntPtr
Private Declare Auto Function ReleaseDC Lib "user32.dll" ( _
ByVal hwnd As IntPtr, _
ByVal hdc As IntPtr _
) As Int32
///
 
Back
Top