L_C>>>Для получения хендела окна использую ::GetForegroundWindow();
L_C>>>Может, кто знает, как добраться до EditBox`а?
AS>>GetForegroundWindow, GetWindowThreadProcessId, AttachThreadInput и GetFocus.
L_C>Вроде так и делаю, может что то не так?!!!
Вам нужно получать фокус, а не устанавливать? Если так, тогда приведенный вами код выглядит по меньшей мере странно.
L_C>L_C>HWND hwnd = ::GetForegroundWindow();
L_C> if(IsWindow(hwnd))
L_C> {
L_C> if(hwnd != this->m_hWnd)
L_C> {
L_C> if(m_hwndFocus != hwnd)
L_C> {
L_C> DWORD t1 = GetWindowThreadProcessId(hwnd, NULL);
L_C> DWORD t2 = GetCurrentThreadId();
L_C> if(IsWindow(m_hwndFocus))
L_C> {
L_C> AttachThreadInput(t2, t1, FALSE);
L_C> }
L_C> m_hwndFocus = hwnd;
L_C> AttachThreadInput(t2, t1, TRUE);
L_C> ::SetFocus(hwnd);
L_C> }
L_C> }
L_C> }
L_C>