how to determine if a POINT is inside the area of a button?
the POINT is in screen coordinates , and I have the handle of the window in which the button is and the handle of the button.
I tried ::ScreenToClient(okBtnH , &tempPosition) where okBtnH is the handle of the button and the tempPosition is a POINT structure in screen coordinates. but it doesn’t work.
Is there any way to do this except manual calculation of the screen position of the button and then compare it with the POINT str ?
how to determine if a POINT is inside the area of a button? the
Share
Are you sure that
okBtnHis a handle for the button control, and not just its ID? IfScreenToClientis failing with “Invalid Handle” then your handle is likely invalid.