.NET Framework Bookmark and Share   
 index > .NET Base Class Library > Can .NET do this? (Mouse position utility)
 

Can .NET do this? (Mouse position utility)

I'm not a programmer by trade, but I occasionally dabble in scripting, using VB for Excel, Perl, and whatnot. I looked for a Windows utility on the web and couldn't find one that did what I wanted, so I decided, screw it, why not just write one? It can't be that hard. I looked briefly at Java, but was told it wasn't possible in Java, and to look at C++ instead. So here I am.

Before I start any tutorials in earnest, though, I'd love to get some advice about whether it's actually possible/easy using managed C++ code in .NET, and if not, should I use native C++, or what platform should I be learning?

Let me describe the simple utility I'm imagining. It displays an ordered pair of numbers representing the current mouse absolute screen position relative to the desktop, even when the mouse is not over its window. It operates in the background while other applications are active, which means I want it to continue to display the current desktop mouse position even when it's not the currently active Windows program.

Thanks for your help.
JasonMel
The System.Windows.Forms.Cursor class provides the mouse position indesktop coordinates at all times. Ask farther questionsin the Windows Forms forum.
  • Marked As Answer byJasonMel Sunday, August 23, 2009 10:04 AM
  •  
JohnWein
Hi,

John's answer is correct, and to go one step further I'd just like to point out that c++ isn't necessary, you should be able to do this in C# or Vb.Net either of which should be easier that C++.
  • Marked As Answer byJasonMel Sunday, August 23, 2009 10:04 AM
  •  
Yort
The System.Windows.Forms.Cursor class provides the mouse position indesktop coordinates at all times. Ask farther questionsin the Windows Forms forum.
  • Marked As Answer byJasonMel Sunday, August 23, 2009 10:04 AM
  •  
JohnWein
Hi,

John's answer is correct, and to go one step further I'd just like to point out that c++ isn't necessary, you should be able to do this in C# or Vb.Net either of which should be easier that C++.
  • Marked As Answer byJasonMel Sunday, August 23, 2009 10:04 AM
  •  
Yort
Acutally, someone just proved that it's possible in Java as well, and I have a working reference example running in the background as I write this. I'll just stick with Java, since I had already progressed partway through Sun's tutorials. Thanks for your replies, though. Much appreciated.
  • Unmarked As Answer byJasonMel Sunday, August 23, 2009 10:04 AM
  • Marked As Answer byJasonMel Sunday, August 23, 2009 10:03 AM
  •  
JasonMel

You can use google to search for other answers

Custom Search

More Threads

• prorgamFilesPath
• Large File Dealing
• Event on specific time
• Urgent: Run an EXE file with process?
• Microsoft Report Tutorial?
• Collections in Managed add-in framework (MAF)
• Dynamic controls (buttons) over PictureBox not displaying correctly.
• Programmatically determine calling method at execution time?
• How to calculate number of effective CPUs?
• System.Threading.Thread.CurrentThread.CurrentCulture.Calendar.TwoDigitYearMax