mouse move & control ID

This is a discussion on mouse move & control ID within the Windows Programming forums, part of the Platform Specific Boards category; Hi Assue that there are some controls on a modal dialog box, and then here is my problem: How can ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    173

    mouse move & control ID

    Hi

    Assue that there are some controls on a modal dialog box, and then here is my problem:

    How can I get the control ID or handle if I move the mouse over it.

    I really can't find the way out , please, I would apprecate that.

    Thanks.
    Don't laugh at me,I am just a SuperNewbie.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Process the WM_MOUSEMOVE messages.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    thanks, but how could the code knows that the mouse is over the control?
    Don't laugh at me,I am just a SuperNewbie.

  4. #4
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,646
    Read this thread to learn about screen and client coordinates and how to work with them.

    gg

  5. #5
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    thanks, but is there any clause like:
    Code:
    case WM_MOUSEMOVE
    {
     // my assumption
        CtrID = GetDlgItemID(hwndC MOUSEOVER, 0, 0) //
        switch(CtrlID)
       {
    
    
    
       }
    
    }
    I don't know if there is any thing like GetDlgItemID(hwndC MOUSEOVER, 0, 0)
    Don't laugh at me,I am just a SuperNewbie.

  6. #6
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    thanks, but I don't know if that is precious, is there any other way to do this?
    Sorry, I couldn't translate this. Could you run it by me again.

    If you follow the 'Windows overview' link at the bottom of
    a related function such as GetWindow you will find a list of related functions.

    In other words, try browsing the documentation.

    Code:
    case WM_MOUSEMOVE:
    {
    	POINT pt;
    
    	pt.x = GET_X_LPARAM(lParam);
    	pt.y = GET_Y_LPARAM(lParam);
    
    	hwndCtrl = ChildWindowFromPoint(hwnd, pt);
    	idCtrl   = GetDlgCtrlID(hwndCtrl);
    
    	switch(idCtrl)
    	{
    		...
    	}
    }

  7. #7
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    Sorry, that was not "precious" but "precise"

    In your sample code: does it mean that only we get the hwndCtrl when mouse moves over that defined pt, right?

    Thanks.
    Don't laugh at me,I am just a SuperNewbie.

  8. #8
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. linux mouse troubles
    By Kinasz in forum Tech Board
    Replies: 0
    Last Post: 01-07-2004, 04:35 AM
  2. Friggin Mouse on Laptop
    By OneStiffRod in forum Tech Board
    Replies: 2
    Last Post: 03-27-2003, 06:49 PM
  3. Game Design Topic #2 - Keyboard or Mouse?
    By TechWins in forum Game Programming
    Replies: 4
    Last Post: 10-08-2002, 03:34 PM
  4. Mouse in 800x600 24Bit Mode?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 11-11-2001, 12:38 AM
  5. Replies: 5
    Last Post: 09-08-2001, 09:18 AM

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