Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6709223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:51:19+00:00 2026-05-26T07:51:19+00:00

I have a problem with changing wallpaper via code, i have below code as

  • 0

I have a problem with changing wallpaper via code, i have below code as every SO/Codeproject threads talks about on changing wallpaper. (Have not tested on other Win OS so far)

    const int SPI_SETDESKWALLPAPER = 20;
    const int SPIF_UPDATEINIFILE = 0x01;
    const int SPIF_SENDWININICHANGE = 0x02;

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    static extern int SystemParametersInfo(
        int uAction, int uParam, string lpvParam, int fuWinIni); 

    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, @"C:\Temp\100_5715.JPG.bmp",
            SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);

The actual problem i have here is that if i make the above code as windows service and install it as a “Local Service” or “Local System”, it wont work at all. But if i make the above code as a ConsoleApp, then things work.

I wonder whats the problem? Yes my user account has Admin rights. Also i have Windows 7 Ultimate here.

Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:51:20+00:00Added an answer on May 26, 2026 at 7:51 am

    Services run in their own session, called session 0 since Vista. It is isolated from the user session for security reasons, services run with a very privileged account. You are changing the desktop of that otherwise invisible session.

    You can’t use a service.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem changing the focus to some button on xaml. The code
HI! I have a problem with changing the name of a select element. I
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem when I try insert some data to Informix TEXT column via
I'm using the jQuery datepicker from jqueryui.com and I have a problem changing the
I have a problem with changing my spring/hibernate application from MySql to SQL Server.
I have a problem that I really need solved in any way (changing data
I have problem with changing activity. I added the line to AndroidManifest and it
I have a problem with updating the value of property from code which is
I have a very odd problem where live wallpapers will not work right on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.