Windows service does not support Capturing Screen with GDI in vb.net

  • Thread starter Thread starter hemant
  • Start date Start date
H

hemant

I am trying to Caputre the screen in windows service with the GDI Api
of Win32 in vb.net
1. CreateDc
2. CreateCompatibleDC
3. CreateCompatibleBitmapDc
4. Bitblt
5. SelectObject
6. DeleteDc

The Caputured screen file is always black

Give me the coorrect solution to caputure the scrren in windows service
with vb.net 2005
 
Considering this forum is on ASP.NET, it's probably not the best place to
ask a question like this.
However, I would also like to know the solution if you come across it.
The problem is that a windows service is not associated with any user's
desktop, so it does not know which desktop to grab a screen capture from.
Multiple users could be logged in at once through the "switch user" feature
of windows.
I tried to do something similar, and the best I could come up with is to run
a background app when the user logs in (instead of a windows service) so it
has access to their desktop.
 
Back
Top