locked
mouse movement and position -SK RRS feed

  • Question

  • Hi Every on !
    I like to know 2 task
    1. How to get the coordinates of the mouse cursor present in any windows outside my form (like Desktop) using VC# or VB.
    2.Can we change a mouse position by specifying its coordinates by program in VC# or VB
       eg : i have a two text box which gets coordinates x, y - when i specify the coordinates and toggle an event using a command button the mouse cursor should move to the specified coordinate position. PLz help me with this any one.......................................................

    Friday, November 21, 2008 1:51 AM

Answers

  • I'm not sure if this is what you're after, and haven't tried this, but maybe this would help:
    http://msdn.microsoft.com/en-us/library/ms171548(VS.80).aspx

    Saturday, November 22, 2008 5:36 AM

All replies

  • 1. System.Windows.Forms.Cursor.Position // the position of the cursor.

    2. System.Windows.Forms.Cursor.Position = new Point(x, y); // set the position of the cursor to x, y pixels from the top left

    Friday, November 21, 2008 4:23 AM
  • thanks a lot Vikstar ,  i tried it and it worked !!!!!!!!!!!
    one more issue how do you implement a virtual click using  a program..................
    Saturday, November 22, 2008 12:20 AM
  • I'm not sure if this is what you're after, and haven't tried this, but maybe this would help:
    http://msdn.microsoft.com/en-us/library/ms171548(VS.80).aspx

    Saturday, November 22, 2008 5:36 AM
  • That's what i wanted thank you again Vikstar,
    if you know about network programming i want to know how to send a file form one PC to another over the internet using ip address of both PC,
     
    Sunday, November 23, 2008 12:34 AM
  • Hmm, this is fundamental programming. You should buy or borrow a book about network programming. I'm guessing you're new to programming, so perhaps also try something like these: http://www.programmingbooks.org/Books_Every_Programmer_Should_Read

    I'm a .NET newb, and the solutions I sent you so far in this thread took me only about 10 seconds to find via google. One of the most important aspects of being a programmer is being able to search for information yourself, since this skill is also useful in finding bugs and problems in your own code. Before asking a question on these forums please give a decent attempt to search for the solution yourself.
    Sunday, November 23, 2008 12:50 AM