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

  • SEARCH
  • Home
  • 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 65385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:56:17+00:00 2026-05-10T18:56:17+00:00

i want to be a good developer citizen, pay my taxes , and disable

  • 0

i want to be a good developer citizen, pay my taxes, and disable things if we’re running over Remote Desktop, or running on battery.

If we’re running over remote desktop (or equivalently in a Terminal server session), we must disable animations and double-buffering. You can check this with:

/// <summary> /// Indicates if we're running in a remote desktop session. /// If we are, then you MUST disable animations and double buffering i.e. Pay your taxes! ///  /// </summary> /// <returns></returns> public static Boolean IsRemoteSession {     //This is just a friendly wrapper around the built-in way     get     {         return System.Windows.Forms.SystemInformation.TerminalServerSession;     } } 

Now i need to find out if the user is running on battery power. If they are, i don’t want to blow through their battery. i want to do things such as

  • disable animations
  • disable background spell-checking
  • disable background printing
  • turn off gradients
  • use graphics.SmoothingMode = SmoothingMode.HighSpeed;
  • use graphics.InterpolationMode = InterpolationMode.Low;
  • use graphics.CompositingQuality = CompositingQuality.HighSpeed;
  • minimize hard drive access – to avoid spin up
  • minimize network access – to save WiFi power

Is there a managed way to see if the machine is currently running on battery?

Bonus Reading

  • How do you convince developers to pay their ‘taxes’? (archive.is)
  • Taxes: Remote Desktop Connection and painting (archive.is)
  • GetSystemMetrics(SM_REMOTESESSION) (archive.is)
  • 1 1 Answer
  • 4 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. 2026-05-10T18:56:18+00:00Added an answer on May 10, 2026 at 6:56 pm

    I believe you can check SystemInformation.PowerStatus to see if it’s on battery or not.

    Boolean isRunningOnBattery =       (System.Windows.Forms.SystemInformation.PowerStatus.PowerLineStatus ==         PowerLineStatus.Offline); 

    Edit: In addition to the above, there’s also a System.Windows.Forms.PowerStatus class. One of its methods is PowerLineStatus, which will equal PowerLineStatus.Online if it’s on AC Power.

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

Sidebar

Related Questions

Good Afternoon Developer, this is my content in asp .net, I want the user
I am ASP.NET developer with good amount of experience. I want to start with
I am attempting to use Scintilla .NET in a project (I want a good
Can I use UnityContainer in View's codebehind when I want to write good MVVM
I want to have a good test setup but, I can't find a way
Is this good OO Design assuming you want every inheriting class to be a
Good Day! i want to add a subview in another view in iphone. and
Good day! I want to protect my database when I save a row in
I have a string: hello good old world and i want to upper case
i want to know how Delegate is differ from object in cocoa any good

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.