Sunday, 23 May 2010

Dual display user debacle (Part 2)

I also want people aware that I'm targeting Windows 7 in the dual-display-user-debacle, Vista is not different enough to be worth testing on, but Windows XP should work with minimal issues.


##### run the program without any commands
>DisplayReZ.exe
Device 0 = '\\.\DISPLAY1' [NVIDIA GeForce 9800 GTX/9800 GTX+] 00000005...Active
Attached Prim.
Display: '\\.\DISPLAY1' width 1280 x height 1024 bpp 32 freq. 60 flags 0 positn (x,y) (0,0)
Device 1 = '\\.\DISPLAY2' [NVIDIA GeForce 9800 GTX/9800 GTX+] 00000001...Active
Attached
Display: '\\.\DISPLAY2' width 1280 x height 1024 bpp 32 freq. 60 flags 0 positn (x,y) (1280,0)
###### disable the secondary display device \\.\DISPLAY2
>DisplayReZ.exe \\.\DISPLAY2 -disable
Device 0 = '\\.\DISPLAY1' [NVIDIA GeForce 9800 GTX/9800 GTX+] 00000005...Active
Attached Prim.
Display: '\\.\DISPLAY1' width 1280 x height 1024 bpp 32 freq. 60 flags 0 positn (x,y) (0,0)
Device 1 = '\\.\DISPLAY2' [NVIDIA GeForce 9800 GTX/9800 GTX+] 00000001...Active
Attached
Display: '\\.\DISPLAY2' width 1280 x height 1024 bpp 32 freq. 60 flags 0 positn (x,y) (1280,0)
##### turn on the secondary again, screen settings are coppied for the primary device
>DisplayReZ.exe \\.\DISPLAY2 -enable
Device 0 = '\\.\DISPLAY1' [NVIDIA GeForce 9800 GTX/9800 GTX+] 00000005...Active
Attached Prim.
Display: '\\.\DISPLAY1' width 1280 x height 1024 bpp 32 freq. 60 flags 0 positn (x,y) (0,0)
Device 1 = '\\.\DISPLAY2' [NVIDIA GeForce 9800 GTX/9800 GTX+] 00000000...
Display: '\\.\DISPLAY2' width 0 x height 0 bpp 0 freq. 0 flags 0 positn (x,y) (0,0)
My idea is to drop the code into a library, and then call it from a background service automatically when a user logs on or does a fast-user-switch.

No comments:

Post a Comment