473,797 Members | 2,970 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to detect mouse presence ?

Hi to all

I have to detect the mouse presence and disconection if occurs to give
alerts. I'm using VB .NET, if somebody can help i'll apretiate it.
Nov 20 '05 #1
6 2379
You can use System.Windows. Forms.SystemInf ormation.MouseP resent to check for the presence of the mouse

"Perquiaga" wrote:
Hi to all

I have to detect the mouse presence and disconection if occurs to give
alerts. I'm using VB .NET, if somebody can help i'll apretiate it.

Nov 20 '05 #2
Using System.Windows. Forms.SystemInf ormation.MouseP resent I get a true or
false saying the mouse is installed or not, but it does not detect it. If i
unplugg the mouse it keeps telling its installed.

"Anand M [MVP]" <Anand M [MVP]@discussions.mi crosoft.com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
You can use System.Windows. Forms.SystemInf ormation.MouseP resent to check for the presence of the mouse
"Perquiaga" wrote:
Hi to all

I have to detect the mouse presence and disconection if occurs to give
alerts. I'm using VB .NET, if somebody can help i'll apretiate it.

Nov 20 '05 #3
That I would assume is because for the OS, the mouse is still available. I think if finds out the mouse is not there only when you reboot. I suspect this may not be the case for a USB mouse, as the OS should be able to detect unplugging of a USB device.

Rgds,
Anand M
http://www.dotnetindia.com

"Perquiaga" wrote:
Using System.Windows. Forms.SystemInf ormation.MouseP resent I get a true or
false saying the mouse is installed or not, but it does not detect it. If i
unplugg the mouse it keeps telling its installed.

"Anand M [MVP]" <Anand M [MVP]@discussions.mi crosoft.com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
You can use System.Windows. Forms.SystemInf ormation.MouseP resent to check

for the presence of the mouse

"Perquiaga" wrote:
Hi to all

I have to detect the mouse presence and disconection if occurs to give
alerts. I'm using VB .NET, if somebody can help i'll apretiate it.


Nov 20 '05 #4
"Perquiaga" <perquiaga> schrieb
Using System.Windows. Forms.SystemInf ormation.MouseP resent I get a
true or false saying the mouse is installed or not, but it does not
detect it. If i unplugg the mouse it keeps telling its installed.


That's a low-level issue not handled by VB.Net or the .Net Framework. You
might find something in the MSDN library.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #5
Hi Perquiaga,

I think that the mouse can only be tested if it is working with tracking the
mouse move event.

However just an idea.

Cor
Nov 20 '05 #6
Any idea for re detect devices ?
Maybe could refresh the mouse status

"Anand M [MVP]" <Anand M [MVP]@discussions.mi crosoft.com> wrote in message
news:92******** *************** ***********@mic rosoft.com...
You can use System.Windows. Forms.SystemInf ormation.MouseP resent to check for the presence of the mouse
"Perquiaga" wrote:
Hi to all

I have to detect the mouse presence and disconection if occurs to give
alerts. I'm using VB .NET, if somebody can help i'll apretiate it.

Nov 20 '05 #7

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

Similar topics

0
3472
by: selowan | last post by:
Hi, In VB6 Pro SP5, I have a form that contains an MSFlexGrid and a few other textboxes and comboboxes. I am using the technique from MSDN article Q241355, which describes how to tab and edit in a flexgrid. Briefly, the technique is to overlay the cell to be edited with "floating" textbox; data is edited in the floating textbox and moved to the cell when the floating textbox loses focus. The technique works well except for when the...
0
1584
by: Michiel | last post by:
Hello, Can anyone give me an idea of what classes/interfaces I could use when I want to detect the presence of a virtual machine (VMware, Virtual PC) on a user's system ? Both managed and unmanaged classes are ok (no MFC). I'm familiar with WMI as well. It needs only to work on Windows XP operating systems. Thanks !
2
2421
by: Eitan | last post by:
Hello, I am creating a new window class based on CWnd. I am placing it on the View (CFormView). How can I get the notification or any other indication that the cursor/mouse is not on this window? I also tried the same to create a new window based on CStatic but I was not able to detect when the mouse leaves the window. Regards,
2
5015
by: Sam | last post by:
Hi, I can't figure out how to detect when my mouse cursor leaves a panel control. It should not trigger the event (or do anything) when the mouse leave the panel but still is over a control that is contained by the panel. I've done this : Protected Overrides Sub OnMouseLeave(ByVal e As System.EventArgs) If Cursor.Position.X > Me.Location.X + Me.Width Or Cursor.Position.Y > Me.Location.Y + Me.Height _
10
1964
by: Phoe6 | last post by:
Operating System: Windows Python version: 2.4 I have bookmarks.html and wumpus.c under my c: When I tried to check the presence of the bookmarks.html, I fail. >>> os.path.isfile('c:\bookmarks.html') False >>> os.path.isfile('c:\wumpus.c')
5
4012
by: foolsbar | last post by:
Hi there, I'm trying to write a C# application that gets information from a machine such as operating system, memory, cpu etc. I'm using WMI for this, and it all seems to work fine apart from the fact that Win32_PhysicalMemory doesn't have any instances. I have therefore come to the conclusion that I need to try and access the memory information using the Serial Presence Detect (SPD) information on the EEPROM on the memory stick(s)....
3
2882
by: Iosy | last post by:
Hi all, I'm working in a application where I need to detect when the mouse is inactive outside my form. I mean, I want to detect if the mouse hasn't move in the last X seconds (2 por example) and in case that it hasn't, show a menu. Thanks
3
4967
by: squeak | last post by:
Hi there, I'm new to VB2005 so its probably a very simple answer too! But i just can't think how to do it... Basically i need to detect mouse (and preferably keyboard) movement and kepresses when my application is just minimized and not the active forground app. I only need to triger an event which is going to tell my app if the
2
5529
by: Mohit | last post by:
Hi all, I am working on a windows application with a list view on a form. Now I wanted to show hand cursor when mouse is over list view item and default(arrow) cursor at other places. List view's ItemMouseHover event can tell me that mouse is on the item and here I can change my cursor to hand. But I have no clue to change it back to default cursor when mouse is moved out of the list view item.
0
9685
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
10468
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...
0
10245
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10205
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
10021
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
9063
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
7559
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
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.