Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. [Message Deleted]

[Message Deleted]

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kwanalouie
    wrote on last edited by
    #1

    [Message Deleted]

    N 1 Reply Last reply
    0
    • K Kwanalouie

      [Message Deleted]

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      Kwanalouie wrote:

      The problem I have is that when the cursor is at the top of the client window and I click the right mouse button, the value of point.y is around 72 instead of zero. When I use this same code in the OnLeftMouseDown routine, the value of point.y at the top of the Client window is zero.

      Because OnContextMenu point parameter is in screen co-ordinates and your right click handler point is in client co-ordinates so call ClientToScreen/MapWindowPoints to convert to screen co-ordinates. That's why it's zero in right click handler and 72 in context menu handler. From MSDN for OnContextMenu point parameter Position of the cursor, in screen coordinates, at the time of the mouse click. From MSDN for OnLButtonDown point parameter Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.

      Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

      modified on Thursday, June 5, 2008 11:52 PM

      K 1 Reply Last reply
      0
      • N Nibu babu thomas

        Kwanalouie wrote:

        The problem I have is that when the cursor is at the top of the client window and I click the right mouse button, the value of point.y is around 72 instead of zero. When I use this same code in the OnLeftMouseDown routine, the value of point.y at the top of the Client window is zero.

        Because OnContextMenu point parameter is in screen co-ordinates and your right click handler point is in client co-ordinates so call ClientToScreen/MapWindowPoints to convert to screen co-ordinates. That's why it's zero in right click handler and 72 in context menu handler. From MSDN for OnContextMenu point parameter Position of the cursor, in screen coordinates, at the time of the mouse click. From MSDN for OnLButtonDown point parameter Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.

        Nibu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

        modified on Thursday, June 5, 2008 11:52 PM

        K Offline
        K Offline
        Kwanalouie
        wrote on last edited by
        #3

        Thanks a lot. That did the trick!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups