Thread: How do i retrieve an X,Y CO_ORD

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    34

    How do i retrieve an X,Y CO_ORD

    Hi

    Could someone please tell me how i could retrieve an X,Y Co-ORD from the point where i right click my mouse on an MDI app, once ive right clicked the point on the window which i want a context menu will then pop up.

    What i want is to retrieve a co-ord from the click and then select an object from the context menu to insert at that point, i know how to create the context menu just not how to retrieve a co-ordinate from the right click at the same time.

    Thanks

  2. #2
    Not to sure on what you mean but if it is the mouse coordinates you want when you click it . they are storend in the long parameter.
    Code:
    POINT pts
    
    pts.x = LOWORD(lParam);
    pts.y = HIWORD(lParam);
    Hope this will help you

  3. #3
    Unregistered
    Guest
    Under WM_LBUTTONDOWN or WM_MOUSEMOVE or WM_LBUTTONUP

    Code:
    POINTSTOPOINT(ptsBegin,MAKEPOINTS(lParam));//get client point from points (int from short int)
    ClientToScreen(hWnd,&ptsBegin);//get in screen coods
    will also work

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 07-07-2005, 06:59 AM
  2. retrieve double variable in scanf
    By cfriend in forum C Programming
    Replies: 1
    Last Post: 11-25-2004, 03:53 PM
  3. [code] Enumerate IE instances and retrieve interfaces.
    By anonytmouse in forum Windows Programming
    Replies: 1
    Last Post: 05-05-2004, 08:01 AM
  4. how do I move cursor to a certain spot on the screen (x,y) ?
    By freeman_peterso in forum C Programming
    Replies: 5
    Last Post: 07-11-2003, 12:30 PM
  5. Using X,Y Coords in DOS Console
    By BigSter in forum C++ Programming
    Replies: 5
    Last Post: 12-11-2001, 08:39 AM