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.
Printable View
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.
Process the WM_MOUSEMOVE messages.
thanks, but how could the code knows that the mouse is over the control?
Read this thread to learn about screen and client coordinates and how to work with them.
gg
thanks, but is there any clause like:
I don't know if there is any thing like GetDlgItemID(hwndC MOUSEOVER, 0, 0) :)Code:case WM_MOUSEMOVE
{
// my assumption
CtrID = GetDlgItemID(hwndC MOUSEOVER, 0, 0) //
switch(CtrlID)
{
}
}
Sorry, I couldn't translate this. Could you run it by me again.Quote:
thanks, but I don't know if that is precious, is there any other way to do this?
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)
{
...
}
}
Sorry, that was not "precious" but "precise" :D
In your sample code: does it mean that only we get the hwndCtrl when mouse moves over that defined pt, right?
Thanks. :)