Problem with Group Boxes Win32 GUI

I have multiple group boxes in my GUI. In order to access the controls there, I use WM_PARENTNOTIFY.

POINT pt;
pt.x = GET_X_LPARAM(lParam);
pt.y = GET_Y_LPARAM(lParam);

cout << "pt.x is " << pt.x << endl;
cout << "pt.y is " << pt.y << endl;
HWND hwndButton;
LONG boxControl;

hwndButton = ChildWindowFromPoint(hwndTestControls,pt);
boxControl = GetWindowLong(hwndButton, GWL_ID);

The problem is that each Group Box starts off at the top left corner, even though they and their controls are displayed somewhere else on the screen.

Any help would be very much appreciated. I'd be glad to elaborate or clarify the problem.

Thank you.
why accessing buttons through group box? if gui elements are static use Id or handle.
Topic archived. No new replies allowed.