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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:40:10+00:00 2026-05-12T07:40:10+00:00

As per MSDN, http://msdn.microsoft.com/en-us/library/ms646302%28VS.85%29.aspx GetLastInputInfo does not provide system-wide user input information across all

  • 0

As per MSDN, http://msdn.microsoft.com/en-us/library/ms646302%28VS.85%29.aspx

GetLastInputInfo does not provide
system-wide user input information
across all running sessions. Rather,
GetLastInputInfo provides
session-specific user input
information for only the session that
invoked the function.

Is there something similar which provides a system-wide last user input information?

  • 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-12T07:40:10+00:00Added an answer on May 12, 2026 at 7:40 am

    I believe the only way to do this is through hooking into the shell.

    This is (obviously) something that must be done carefully and is something not feasible in managed code until this is fully supported by the operating system (not till windows 7) so you will have to use some unmanaged code to achieve this, perhaps updating some global state queryable from your managed code. The API for this is SetWindowsHookEx.

    With the session isolation of Vista onwards you will need elevated priviledges to do this for other sessions. In this taking cues from how keyloggers work may help but I do not have a ready link to some source for this.

    As a first start here is the source from the windows port of condor for spotting keyboard activity:

    /***************************************************************
     *
     * Copyright (C) 1990-2007, Condor Team, Computer Sciences Department,
     * University of Wisconsin-Madison, WI.
     * 
     * Licensed under the Apache License, Version 2.0 (the "License"); you
     * may not use this file except in compliance with the License.  You may
     * obtain a copy of the License at
     * 
     *    http://www.apache.org/licenses/LICENSE-2.0
     * 
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     *
     ***************************************************************/
    
    
    #include <windows.h>
    
    // Shared DATA
    // put in here data that is needed globally
    #pragma data_seg(".SHARDATA")
    HHOOK hHook = NULL;
    LONG KBkeyhitflag = 0;
    #pragma data_seg()
    #pragma comment(linker, "/SECTION:.SHARDATA,RWS")
    
    __declspec(dllexport) LRESULT CALLBACK KBHook(int nCode, WPARAM wParam,
    LPARAM lParam)
    {
        InterlockedExchange(&KBkeyhitflag,1);
    
        return CallNextHookEx(hHook,nCode,wParam,lParam);
    }
    
    HINSTANCE g_hinstDLL = NULL;
    
    #if defined(__cplusplus)
    extern "C" {
    #endif //__cplusplus
    
    
    int __declspec( dllexport) WINAPI KBInitialize(void)
    {
        hHook=(HHOOK)SetWindowsHookEx(WH_KEYBOARD,(HOOKPROC)KBHook,g_hinstDLL,0);
        return hHook ? 1 : 0;
    }
    
    int __declspec( dllexport) WINAPI KBShutdown(void)
    {
        if ( UnhookWindowsHookEx(hHook) )
            return 1;   // success
        else
            return 0;   // failure
    }
    
    int __declspec( dllexport)  WINAPI KBQuery(void)
    {
        if ( InterlockedExchange(&KBkeyhitflag,0) )
            return 1;   // a key has been hit since last query
        else
            return 0;   // no keys hit since asked last
    }
    
    #if defined(__cplusplus)
    } // extern "C"
    #endif //defined(__cplusplus)
    
    BOOL WINAPI DllMain(HANDLE hInstDLL, ULONG fdwReason, LPVOID lpReserved)
    {
        switch (fdwReason)
        {
            case DLL_PROCESS_ATTACH:
                g_hinstDLL = (HINSTANCE)hInstDLL;
                DisableThreadLibraryCalls(g_hinstDLL);
                break;
        }
        return 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Per Microsoft's ProfileInfo definition http://msdn.microsoft.com/en-us/library/system.web.profile.profileinfo.aspx , an unauthenticated profileinfo object has a username; naturally
http://msdn.microsoft.com/en-us/library/dd997415.aspx Per the article referenced above I am trying to handle exceptions in a
I am creating a C# class as per: http://msdn.microsoft.com/en-us/library/x6h10s6x.aspx however I want my own
As per http://msdn.microsoft.com/en-us/library/h21twfw7(v=VS.100).aspx (for Visual Studio 2010) strstreambuf is deprecated. I was of the
After reading http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentsessions.aspx and http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx I have concluded that: MaxConcurrentSessions is the number of
I found this matrix for browser support: http://msdn.microsoft.com/en-us/library/ms251673.aspx . I'm looking for something more
I have enabled .NET network tracing per this article here: http://msdn.microsoft.com/en-us/library/ty48b824.aspx Unfortunately, the log
I'm making my first Windows Phone App As per this tutorial [ http://msdn.microsoft.com/en-us/library/gg680266(v=pandp.11).aspx ],
I have an API that gives me PCM wave data: http://msdn.microsoft.com/en-us/library/ff966424.aspx The byte[] buffer
I want to use wcf performance counters per operation , like here: http://msdn.microsoft.com/en-us/library/ms731052(v=vs.90).aspx how

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.