Hàm getforegroundwindow chỉ lấy cửa sổ mẹ đang nhận focus, thế còn muốn lấy 1 cửa sổ con bên trong nó, 1 ô text chẳng hạn đang nhận focus thì làm thế nào
Life:\> dir
Cậu gọi GetForegroundWindow để lấy hwnd, sau đó call GetWindowThreadProcessId để lấy threadid của thread tạo hwnd đó, rồi call AttachThreadInput để attach vào hwnd này, rồi call GetFocus, sau đó de-attach.