Re: EnumDisplayDevice does not work from within a service under Vi

Tech-Archive recommends: Fix windows errors by optimizing your registry




In order to set the gamma-ramp correctly, you will have to create a
broker process in each session that will perform that action for you
upon session switches/transitions/disconnect/reconnect.
It cannot be performed from session-0.
If you were to set the gamma-ramp from session zero you could,
at most, set-it on the disconnect display driver, that makes no good to you.

The sentence `The idfe of wuing winmgmt` should have been spell-checked
and it should read as `The idead of using WinMgmt`. Sorry about that.

--

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"EricV" <EricV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AD27291B-B061-4431-9D22-547F0430A142@xxxxxxxxxxxxxxxx
Hi Ivan,
Still a few questions about your reply.
- What do you mean with "the session specific path" in your first
sentence?
- What is "The idfe of wuing winmgmt" in your second sentence?

By the way: the goal of my service is to set the gamma table of all
display
cards correctly (to a predefined state) before any user is logged in. I'm
using SetDeviceGammaRamp() to do this but this function needs a HDC.
Although
the gamma table is a resource that is common for all sessions it seems
that I
should not be able to use it in a service. Do you have any other ideas how
I
could solve this problem?

Thanks and Best Regards,
Eric


"Ivan Brugiolo [MSFT]" wrote:

CreateDC will fail if the session specific path is not available in that
session.
The idfe of wuing winmgmt is to NOT have to make any GDI call to get
the information you need.




.