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 835051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:45:52+00:00 2026-05-15T04:45:52+00:00

I have a windows mobile 5 program (compact framework 3.5) that I need to

  • 0

I have a windows mobile 5 program (compact framework 3.5) that I need to be able to detect when the device is idle.

Right now I am just checking to see if the backlight is off. Like this:

[DllImport("coredll.dll", EntryPoint = "sleep", SetLastError = true)]
internal static extern void sleep(int dwMilliseconds);

….

//Get the current power state of the system
int winError = CoreDLL.GetSystemPowerState(systemStateName, out systemPowerStates);
if (winError == 0)
{
    //If the backlight is off, consider the state to be idle.
    if (systemStateName.ToString() == "backlightoff")
    {
        idle = true;
    }
}

I think this may be getting close, but I would like to know if the device is truly not being used.

  • 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-15T04:45:53+00:00Added an answer on May 15, 2026 at 4:45 am

    You’re using the right function, simply check for the states (which are bitwise flags):

    if ((systemPowerStates & POWER_STATE_IDLE) == POWER_STATE_IDLE) {
      idle = true;
    }
    

    with POWER_STATE_IDLE = 0x00100000.

    Edit: to answer your comment, look at the RequestPowerNotification function. You’ll receive POWER_BROADCAST message when the power state changes.

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

Sidebar

Related Questions

I have a Windows Mobile program that accesses an attached device through a third-party
i have an windows mobile application written in c# compact framework which use barcode
I have to create an application using a Datalogic mobile device that uses Windows
i have windows-mobile program that has 2 forms. in form1, i have TextBox and
I have a windows mobile app that look like this: class Program { static
Hello frnds I have windows mobile application, that retrieves location info. Now i want
I have a windows mobile 5.0 application (smartphone) that contains a flat data file
I have a windows mobile app (mymobiler) that i am trying to install and
I have been working on a Windows Mobile app for a little while now
I begin to program some handheld program as hobby, right now i currently have

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.