473,810 Members | 3,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

keyboard and system inavtivity

Hello NG,

I want to find if there is any user input (via mouse and keyboard only) even
my app do not have focus (minimized or in background). How can I do that in
managed code?

Thx,
Po
Nov 16 '05 #1
2 1644
Unfortunately there isn't an easy way to do this that works across different
versions of Windows.
Most applications adopt a global keyboard and mouse hook, which can monitor
activity and set a flag accordingly.

Global hooks in .net aren't as easy as they could be... luckily there's some
free code to help you out:
http://www.codeproject.com/csharp/GlobalSystemHook.asp

--
John Wood
Blog: http://spaces.msn.com/members/johnwood

"Pohihihi" <pohihihi@ho> wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hello NG,

I want to find if there is any user input (via mouse and keyboard only) even my app do not have focus (minimized or in background). How can I do that in managed code?

Thx,
Po

Nov 16 '05 #2
thanks.
"John Wood" <john.wood@prio rganize_nospam_ _.com> wrote in message
news:es******** ******@TK2MSFTN GP15.phx.gbl...
Unfortunately there isn't an easy way to do this that works across
different
versions of Windows.
Most applications adopt a global keyboard and mouse hook, which can
monitor
activity and set a flag accordingly.

Global hooks in .net aren't as easy as they could be... luckily there's
some
free code to help you out:
http://www.codeproject.com/csharp/GlobalSystemHook.asp

--
John Wood
Blog: http://spaces.msn.com/members/johnwood

"Pohihihi" <pohihihi@ho> wrote in message
news:OR******** ******@TK2MSFTN GP15.phx.gbl...
Hello NG,

I want to find if there is any user input (via mouse and keyboard only)

even
my app do not have focus (minimized or in background). How can I do that

in
managed code?

Thx,
Po


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
13041
by: daFritz | last post by:
Hi! I need to prevent Task-Switching in my App, so I tried to implement a low level keyboard hook in a extra class. But it seems that the Parameters are not passed correctly to my Hook function. Similar Examples in VB .NET work correctly. Heres the Source Code: using System; using System.Runtime.InteropServices;
3
1815
by: Paul Aspinall | last post by:
Hi I have an MDI app.... All child MDI windows are non-updateable... however, the users may leave the windows open... and there can be several of them. I want to implement a system to dispose of MDI child windows after a period of inactivity, in order to release resources and fire a garbage collect... Does anyone have any views, or ideas on how to do this??
2
8771
by: rs | last post by:
Hi guys, I am trying to read from a USB keyboard using vb.net and HID classes. the USB keyboard is not my primary keyboard. I have a ps2 keyboard connected and is detected in device manager as my keyboard. the USB keyboard is detected as HID keyboard device. the program finds the keyboard if it is attached. and I am getting valid handles. however, everytime I use the readfile function I am getting "object reference not set to an instant...
4
7792
by: jonathandrott | last post by:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen keyboard to use with a touch screen. how do i get it to print a letter on the screen when the button is pressed in the textbox that is selected? do i do it as a ascii character? i'm trying to get data from a user. there are a couple of different field the user will have to type information into. (i.e. first name, last name, .etc)
9
10991
by: Kbalz | last post by:
I have an application that minimizes itself, and I want it to listen for certain key commands, and when they are pressed, my program can react to them. So far I've gotten my application to react as I intend while the program has focus, but when the application loses focus, the listening stops. I am using VS 2008 beta 2, with .net 3.5.
7
3420
by: RADAR | last post by:
i use VC++ 6,0 and i have problems with getting keyboard system inputs and to use them to check to proceed or break the loop. for example if i want to proceed until Ctrl+z is written for input.What will the compiler do?Does it accept Ctrl+Z as a normal string input , char* input, or a char input which has ASCII 26... suppose i have a loop that does the following: -first check the choice -if not Ctlr+Z continue -else go to the next stage. ...
1
13239
by: Techno3000 | last post by:
import java.io.*; import java.awt.*; import hsa.Console; public class Calculator { static Console c; public static void main (String args) throws IOException
1
2283
by: Aycex | last post by:
I am taking my first java class as i am a Database person this is quite interesting and here is my problem. We are supposed to be learning to overload a class and i believe i have my code correct the problem is I cannot get the keyboard.nextdouble to accept me hitting enter and it having a null to make my overloaded method work. Here is the code i have. I am supposed to be able to just add in one, two, or three variables and the...
1
9105
by: MBMSOFT | last post by:
Any idea how to change system keyboard language with vba I tried changing keyboard property in the control property and it works but i need change in one control only, and if i change property it change for all contols after so i need code on exit control event to change the system keyboard language \e.g. **************************************************** Private Sub A_Enter()
0
9722
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10644
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10393
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10124
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4334
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.