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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:28:01+00:00 2026-06-11T10:28:01+00:00

I am planning a develop an application, which starts up with windows (a service

  • 0

I am planning a develop an application, which starts up with windows (a service perhaps) and silently records User’s Login, Logout and System Lock/Unlock events..

It would be awesome if someone can give a me a tip to record their total idle time (the time where no system activity was performed by user)

I am looking for a pre-developed library or something which can help me smoothly complete the project.

  • 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-06-11T10:28:02+00:00Added an answer on June 11, 2026 at 10:28 am

    try it out the below code….

    private enum WTS
    {
            CONSOLE_CONNECT = 1,
            CONSOLE_DISCONNECT = 2,
            REMOTE_CONNECT = 3,
            REMOTE_DISCONNECT = 4,
            SESSION_LOGON = 5,
            SESSION_LOGOFF = 6,
            SESSION_LOCK = 7,
            SESSION_UNLOCK = 8,
            SESSION_REMOTE_CONTROL = 9
     }
    
    protected override void WndProc(ref System.Windows.Forms.Message m)
    {
        switch (m.Msg) {
            case WM_WTSSESSION_CHANGE:
                switch (m.WParam.ToInt32) {
                    case WTS.CONSOLE_CONNECT:
                        //MessageBox.Show("A session was connected to the console session.");
    
                        break;
                    case WTS.CONSOLE_DISCONNECT:
                        //MessageBox.Show("A session was disconnected from the console session.");
    
                        break;
                    case WTS.REMOTE_CONNECT:
                        break;
                    //MessageBox.Show("A session was connected to the remote session.");
                    case WTS.REMOTE_DISCONNECT:
                        break;
                    //MessageBox.Show("A session was disconnected from the remote session.");
                    case WTS.SESSION_LOGON:
    
                        break;
                    //MessageBox.Show("A user has logged on to the session.")
                    case WTS.SESSION_LOGOFF:
                        //MessageBox.Show("A user has logged off the session.");
    
                        break;
                    case WTS.SESSION_LOCK:
                        //MessageBox.Show("A session has been locked.")
    
                        break;
                    case WTS.SESSION_UNLOCK:
                        //MessageBox.Show("A session has been unlocked.")
    
                        break;
                    case WTS.SESSION_REMOTE_CONTROL:
                        MessageBox.Show("A session has changed its remote controlled status. To determine the status, call GetSystemMetrics and check the SM_REMOTECONTROL metric.");
                        break;
                }
    
                break;
        }
    
        base.WndProc(m);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am planning to develop a windows application in .net which will act like
I am planning to use vaadin to develop internal application, which will be used
I'm planning to develop a Web/cloud application using python which does the following, 1.
I'm planning to develop a remote desktop system consisting of: The desktop application that
I am planning to develop a small web application, which enable users to create
I'm planning to develop a web application which will have many static pages (about,
I am planning on to develop a application for windows. It is basically a
I am planning to develop a standalone application, which infact will be used for
I'm planning to develop a web service application to support an iPhone app and
I am planning to develop a facebook application which uses iframe concept, it involves

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.