How can I retrieve the handle of the child control whitch have the focus (the caret) ?

The GetFocus function return the handle of the main window but not its childs.

I can also retrieve the handle of all the childWindows of a specific window with EnumWindowEx function but I don't know whitch one is focused.

I tried that but in some cases that don't work:



invoke GetForegroundWindow
mov hwndActif, eax
invoke GetCursorPos, addr Point
invoke ScreenToClient, hwndActif, addr Point
invoke ChildWindowFromPointEx, hwndActif, Point.x, Point.y, 1
mov hEditActif, eax
Posted on 2004-11-21 16:47:29 by Morgatte
Posted on 2004-11-21 17:02:41 by ti_mo_n
No I can't use a simple WM_KILLFOCUS Message, because It is a Hook. The Childs Controls whose I try to retrieve there handles aren't in my own process but into others programmes.
Posted on 2004-11-22 04:21:52 by Morgatte