S
Sinisa
Hi, first sorry on awkward english.
I'll try to illustrate my problem:
(dont know how will this look on your scrren)
|--Dialog----------------------------------------------------------------------------|
|
|
| |-------groupbox----
-----------------------------------------------------| |
| |
| |
| |
| |
| | |-------------------------------|
| |
| | | Button P(x,y) |
| |
| | |-------------------------------|
| |
| |
| |
| |
| |
|
|-------------------------------------------------------------------------------|
|
|
|
|
|
|-----------------------------------------------------------------------------------------|
P(x,y) represents (point) position of cursor with coordinates x,y
, and that point
lies on button.
Button and groupbox are childs from dialog.
My problem is how to get handle form Button.
i tryed something like:
(this is only part of code)
HWND hwDlg;
HWND hwGroup;
HWND hwButt;
hwGroup = :: WindowFromPoint(p);
/* this is working, i get valid handle*/
hwDlg = ::GetParent(hwGroup);
/* this is also working */
hwButt = ::RealChildWindowFromPoint(hwDlg,p);
/* but here i always get NULL */
as i understand from msdn RealChildWindowFromPoint should return child
handle if
window(in this case button) if point is "over" window , and window is
in transparent area of groupbox .
any advice is most welcome.
I'll try to illustrate my problem:
(dont know how will this look on your scrren)
|--Dialog----------------------------------------------------------------------------|
|
|
| |-------groupbox----
-----------------------------------------------------| |
| |
| |
| |
| |
| | |-------------------------------|
| |
| | | Button P(x,y) |
| |
| | |-------------------------------|
| |
| |
| |
| |
| |
|
|-------------------------------------------------------------------------------|
|
|
|
|
|
|-----------------------------------------------------------------------------------------|
P(x,y) represents (point) position of cursor with coordinates x,y
, and that point
lies on button.
Button and groupbox are childs from dialog.
My problem is how to get handle form Button.
i tryed something like:
(this is only part of code)
HWND hwDlg;
HWND hwGroup;
HWND hwButt;
hwGroup = :: WindowFromPoint(p);
/* this is working, i get valid handle*/
hwDlg = ::GetParent(hwGroup);
/* this is also working */
hwButt = ::RealChildWindowFromPoint(hwDlg,p);
/* but here i always get NULL */
as i understand from msdn RealChildWindowFromPoint should return child
handle if
window(in this case button) if point is "over" window , and window is
in transparent area of groupbox .
any advice is most welcome.