Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: Image Panning Pin
Heks28-Nov-04 13:34
Heks28-Nov-04 13:34 
GeneralVisual C# Liabraries Pin
javaedict26-Nov-04 9:35
sussjavaedict26-Nov-04 9:35 
GeneralRe: Visual C# Liabraries Pin
MoustafaS27-Nov-04 0:36
MoustafaS27-Nov-04 0:36 
Generalusing csc.exe from an application Pin
thepersonof26-Nov-04 8:14
thepersonof26-Nov-04 8:14 
GeneralRe: using csc.exe from an application Pin
Alex Korchemniy26-Nov-04 8:29
Alex Korchemniy26-Nov-04 8:29 
GeneralRe: using csc.exe from an application Pin
thepersonof27-Nov-04 8:02
thepersonof27-Nov-04 8:02 
GeneralWindows service for changing wallpaper Pin
Morpork26-Nov-04 8:04
Morpork26-Nov-04 8:04 
GeneralRe: Windows service for changing wallpaper Pin
Dave Kreskowiak26-Nov-04 8:26
mveDave Kreskowiak26-Nov-04 8:26 
A service was mot a good choice for this application. It should stay as an application that runs from the users Startup folder. This is why:

The wallpaper is a user-specific settings, meaning that each user has their own preference for this setting. The setting, if changed by one user, is not applied to all other users on the machine, logged in or not.

Next, on Windows XP, you can have multiple people logged in at the same time, though you can only have one session active at a time.

Now, a windows service doesn't run in the context of the user(s) that is lgged in. In normally runs under the context of Local System. Further, the services each have their own desktop, or more specifically, no VISIBLE desktop. So, when your service is setting the wallpaper, it's actually doing on a desktop that you can't see.

Having said all that, it is possible to have a service interact with the desktop that's currently logged in/active. In the Service Control Manager (Administrative Tools), find your service and get the properties on it. Find the little check box that says "Allow interact with desktop". Now, this is no way guarantees that the SystemParametersInfo call will work. But if it does, the service will be changeing the wall paper for ANY user that logs in, regardless if they want it to or not. This is why it's best to leave it as a normal Windows Application and let it run out of the users Startup folder.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Windows service for changing wallpaper Pin
Alex Korchemniy26-Nov-04 20:05
Alex Korchemniy26-Nov-04 20:05 
GeneralAffect Column Headers in the DataGrid Pin
Anonymous26-Nov-04 7:54
Anonymous26-Nov-04 7:54 
GeneralWindows startup Pin
Bjoern.adG26-Nov-04 6:11
Bjoern.adG26-Nov-04 6:11 
GeneralRe: Windows startup Pin
Colin Angus Mackay26-Nov-04 6:53
Colin Angus Mackay26-Nov-04 6:53 
GeneralRe: Windows startup Pin
Dave Kreskowiak26-Nov-04 7:15
mveDave Kreskowiak26-Nov-04 7:15 
QuestionWhy event doesnt fire in .NET object from VBS? Pin
soniko26-Nov-04 5:53
soniko26-Nov-04 5:53 
Questionsscanf like function? Pin
Pedro S Ferreira26-Nov-04 5:18
Pedro S Ferreira26-Nov-04 5:18 
AnswerRe: sscanf like function? Pin
Daniel Turini26-Nov-04 5:29
Daniel Turini26-Nov-04 5:29 
QuestionHow can i Export grid to word.. Pin
john kuruvila26-Nov-04 4:55
john kuruvila26-Nov-04 4:55 
AnswerRe: How can i Export grid to word.. Pin
Alex Korchemniy26-Nov-04 20:11
Alex Korchemniy26-Nov-04 20:11 
QuestionHow Do I Convert Char[] to string? Pin
Member 154451526-Nov-04 3:46
Member 154451526-Nov-04 3:46 
AnswerRe: How Do I Convert Char[] to string? Pin
Dennis C. Dietrich26-Nov-04 4:12
Dennis C. Dietrich26-Nov-04 4:12 
AnswerRe: How Do I Convert Char[] to string? Pin
machocr26-Nov-04 4:19
machocr26-Nov-04 4:19 
GeneralRe: How Do I Convert Char[] to string? Pin
Lim Bio Liong26-Nov-04 19:45
Lim Bio Liong26-Nov-04 19:45 
GeneralLicensing Pin
machocr26-Nov-04 3:18
machocr26-Nov-04 3:18 
GeneralRe: Licensing Pin
Daniel Turini26-Nov-04 5:35
Daniel Turini26-Nov-04 5:35 
Questionhow to add images Pin
bhawana Pal26-Nov-04 0:23
sussbhawana Pal26-Nov-04 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.