Thread: cursor question

  1. #1
    Registered User
    Join Date
    Mar 2002

    cursor question


    when i have a cursor
    i use the mouse with the left top corner of the cursor

    when i click with the left top corner it will work
    and the position of the cursor is by the left top corner

    the question:
    How can i make a cursor that will work with the middle point of
    the cursor

  2. #2
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    If you're talking about a regular cursor and not your own GUI (ie: DirectX) then you could do some tricky stuff when you get a WM_LBUTTONDOWN, WM_RBUTTONDOWN message, etc.

    Offset the x and y values and load them into a POINT. If that POINT lies within your predefined RECT then execute your code.

  3. #3
    train spotter
    Join Date
    Aug 2001
    near a computer
    Your cursor may be out by one or 2 pixcels because if you use GetWindowRect() or GetClientRect() as these functions do not include the last row in the RECT (reducing the area by one each) Try adding one or two to your offset.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  4. #4
    Registered User
    Join Date
    Jan 2002
    OR you could make a *.cur file and set the hotpoint
    "There are three kinds of people in the world...
    Those that can count and those that can't."

Popular pages Recent additions subscribe to a feed