i am having windows7 32 bit in laptop with extended monitor. Screen.AllScreens.Length is returning 1 while calling from Windows service , but from windows application or console application is giving me as 2.
Asked
Active
Viewed 877 times
2
-
2Is your service set to allow interaction with the desktop? If not, I can imagine Windows faking a single screen. Out of curiosity, why are you trying to get the number of screens anyway? – Sep 03 '12 at 07:43
-
Sounds like your service is only detecting your main laptop screen, doesnt it. Is your service configured to run without a login? If so, it may be that the extended screen is only visible once a driver is loaded at user login time. Try setting your service to login. – Surfbutler Sep 03 '12 at 07:53
-
service is running in **Local system account** and allow service to interact with desktop is **also checked**. – snober Sep 03 '12 at 09:10
1 Answers
2
Basically you do not have a screen as a "normal" windows service; nor do you have GDI/GDI+ functions that behave correctly.
See Get Desktop Size from Windows Service? for some more information.
See Allow service to interact with desktop in Windows to interact with the desktop. Note that this is NOT allowed in Vista.

Community
- 1
- 1

Richard Schneider
- 34,944
- 9
- 57
- 73