Capture screen as windows service

System.Drawing.Graphics.CopyFromScreen inside OnStart of ServiceBase

Page 1 of 1

2 Replies - 3612 Views - Last Post: 08 October 2010 - 04:50 PM Rate Topic: -----

#1 versus5  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-October 10

Capture screen as windows service

Posted 08 October 2010 - 03:57 PM

Hi,
System.Drawing.Graphics.CopyFromScreen throws me a System.ComponentModel.Win32Exception when I invoke it inside onstart method of class inherited from ServiceBase. When I invoke it outside service (inside the same context - the same arguments) all is fine. Does anyone know how to solve this :sad2: ?

This post has been edited by versus5: 08 October 2010 - 03:59 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Capture screen as windows service

#2 Curtis Rutland  Icon User is offline

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4577
  • View blog
  • Posts: 8,019
  • Joined: 08-June 10

Re: Capture screen as windows service

Posted 08 October 2010 - 04:41 PM

Post the entire exception, Message included. Also InnerExceptions, if there are any, with their messages.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6107
  • View blog
  • Posts: 23,663
  • Joined: 23-August 08

Re: Capture screen as windows service

Posted 08 October 2010 - 04:50 PM

Could it be that the service has to be setup to interact with the desktop?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1