How do i retrieve an X,Y CO_ORD

This is a discussion on How do i retrieve an X,Y CO_ORD within the Windows Programming forums, part of the Platform Specific Boards category; Hi Could someone please tell me how i could retrieve an X,Y Co-ORD from the point where i right click ...

  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
    Banned maes's Avatar
    Join Date
    Aug 2001
    Posts
    744
    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
    SVG is the future

  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, 02: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, 07:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21