When running as a windows service, how do i get the number of active monitors? C++ -


i have ran issue when retrieving number of active monitors while exe running windows service. have tried using enumdisplaydevices , getsystemmetrics(sm_cmonitros) number of monitors, these 2 methods woulds give me correct number of monitors when running them console mode (meaning initiated user), when register exe service , run through windows service, number of monitors reported turned out incorrect.

is there other way determine number of active monitors while running windows service? or other work around? in advance!

services not allowed interact user desktop security reason. therefore running in virtual desktop has nothing physical one. can try following. in service list of service manager. rightclick service, go properties , there "log on". there can change account service using. "local system account" can check "allow service interact desktop". didn't try self. interacting service has access "real" desktop , therefore monitor count should right.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -