cursor question

This is a discussion on cursor question within the Windows Programming forums, part of the Platform Specific Boards category; hmmm when i have a cursor i use the mouse with the left top corner of the cursor when i ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    88

    cursor question

    hmmm

    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

    so
    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
    Posts
    1,065
    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
    Location
    near a computer
    Posts
    3,859
    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
    Posts
    387
    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

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