Groups | Blog | Home
all groups > c# > october 2005 >

c# : programmatically changing mouse, keyboard, and display settings



MarkZ2001
10/31/2005 11:35:59 PM
Hello:

I'd like to set mouse and display settings programmatically without
having to log out or restart. Is this possible by making registry
settings and then having the winlogin process re-read the registry? Or
is there another way to do this? I will likely need to capture
multiple settings from a host computer and put them into effect on a
target machine.

Thanks.

--M
Dmytro Lapshyn [MVP]
11/2/2005 12:00:00 AM
Hello Mark,

I do know you can do it with the display settings by using the
ChangeDisplaySettingsEx Windows API. As far as I remember there is a flag
telling the system that the changes should be applied without a reboot.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]


[quoted text, click to view]
MarkZ2001
11/4/2005 6:23:09 PM
Thanks Dmytro. I can do it using SystemParametersInfo which can do a
broadcast with SPIF_SENDCHANGE. Since my settings are captured in a
reg file, I'd rather import the settings via a call to regedit and have
the changes immediately take effect. SendMessageTimeout using a
broadcast does not work. It seems to be very difficult to get apps to
"see" changes made to the registry w/o restarting.

Thanks.

--M
AddThis Social Bookmark Button