#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    3
    Rep Power
    0

    Unhappy mouse events in visual c++


    hiya,
    I'm trying to do a game interface in visual c++ but i'm having loads of problems.

    I want to be able to use the mouse to drag the pieces into a position. The problem is, that I don't know how to get the bitmap that the mouse clicks and make it follow the mouse.


    void CNineMensMorrisInterfaceDlg::OnMouseMove(UINT nFlags, CPoint point)
    {
    CBitmap *bitmap1;
    //check to see if the left mouse button is down
    if ((nFlags & MK_LBUTTON) == MK_LBUTTON)
    {
    //get this devicecontext
    CClientDC dc(this);
    bitmap1 = dc.GetCurrentBitmap();//returns a pointer to the current bitmap


    }

    i don't even know if the getCurrentBitmap is what i should be doing there.

    i'd appreciate any suggestions
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,255
    Rep Power
    2222
    That feature is called "drag and drop". I haven't played with it myself, but at least with the name you should be able to find it described.

IMN logo majestic logo threadwatch logo seochat tools logo