Thread: :D Now about WM_LBUTTONDOWN... :D

  1. #1
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879

    :D Now about WM_LBUTTONDOWN... :D

    So now that every other problem of mine is fixed, I was just wondering: I'm trying to make a message-handling function for WM_LBUTTONDOWN, but I don't know what parameters it should take - it says "fwFlags = wParam" in MSDEV's help, and also xPos and yPos are HIWORD/LOWORD of lParam. But what data types are fwFlags, xPos and yPos? And then, how could I separate the flags in fwFlags? (is there a macro or something, or is it guess and check?)
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    To find the Xpos and Ypos from a mouse button msg (as a POINTS struct == two shorts)

    POINTS ClickedPoint=MAKEPOINTS(lParam);
    "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

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Ok, I'm sort of confused. I can use the MAKEPOINTS(lParam) thing, but are xPos and yPos shorts? Or is that just with the MAKEPOINTS thing? And then again, what datatype is fwFlags, and how can I separate the flags?
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    POINTS = struct { short X; short Y;}
    POINT = struct { int X; int Y;}

    Copy to a point or to ints. May want to convert to screen coods with ClientToScreen()

    What do you need the flags for?
    If no reason then ignore them.

    here they are though
    Code:
    #define MK_LBUTTON          0x0001
    #define MK_RBUTTON          0x0002
    #define MK_SHIFT            0x0004
    #define MK_CONTROL          0x0008
    #define MK_MBUTTON          0x0010
    (Why the message WM_LBUTTONDOWN contains a flag to say if the Left mouse button is down seems a tad redundant but.....)
    "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

Popular pages Recent additions subscribe to a feed