it urgent get current mouse position in vc++6.0

Discussion in 'Software' started by sonalibinthe, Mar 31, 2010.

  1. sonalibinthe

    sonalibinthe

    Joined:
    Mar 27, 2010
    Messages:
    1
    hai
    i want to get a current mouse position in dialog window, then what s the difference between the getcurrentmessage and get mouseposition,pls guide me




    Thanks
    Sonali
     
    sonalibinthe, Mar 31, 2010
    #1
    1. Advertising

  2. sonalibinthe

    pandiaraj_4u

    Joined:
    Mar 30, 2010
    Messages:
    3
    Location:
    Chennai
    get mouse position

    hi just try this code..
    it is for non-mfc application...
    (ie) this code for console window....

    int _tmain(void)

    {

    TCHAR buffer[MAX_PATH];

    TCHAR szTitle[MAX_PATH+1] = {0};

    GetConsoleTitle(szTitle, MAX_PATH); // Get the console window title

    HWND hwnd = FindWindow(NULL, szTitle); // Get the handle of the console window

    if(!GetLine(buffer, MAX_PATH))

    PutString(_T("GetLine() return FALSE!"));

    POINT pt; // To get the Mouse position

    TCHAR szText[MAX_PATH+1] = {0};

    for ( int i = 0; i < 10; i++ )

    {

    GetCursorPos(&pt); // Get the cursor position for a screen

    ScreenToClient(hwnd, &pt); // Convert this to console window co-ordinates

    _stprintf(szText, _T("X: %d , Y: %d \n"), pt.x, pt.y); // format the result

    Sleep(200); // Sleep for 200 milliseconds

    PutString( szText ); // print the result

    }

    PutChar(_T('\n'));

    PutString(buffer);

    return 0;

    }
     
    pandiaraj_4u, Apr 7, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. unholy
    Replies:
    37
    Views:
    5,903
    CRAZIE_GUY
    Sep 17, 2006
  2. Slarty Bartfast
    Replies:
    11
    Views:
    1,451
  3. Security Advisory

    !!URGENT!! Tor Vulnerability Discovered !!URGENT!!

    Security Advisory, Aug 6, 2007, in forum: Computer Security
    Replies:
    1
    Views:
    992
    http://tinyurl.com/23k3dt@$NIFF-deeply.ahh
    Aug 11, 2007
  4. pooja
    Replies:
    0
    Views:
    1,214
    pooja
    Mar 3, 2009
  5. Griffin
    Replies:
    0
    Views:
    657
    Griffin
    Aug 27, 2010
Loading...

Share This Page