VC 获取IE的URL


HWND hwnd=::FindWindow(_T("IEFrame"),NULL);
 if(hwnd)
 {
  HWND hwnd2=::FindWindowEx(hwnd,NULL,_T("WorkerW"),NULL);
  HWND hwnd3=::FindWindowEx(hwnd2,NULL,_T("ReBarWindow32"),NULL);
  HWND hwnd4=::FindWindowEx(hwnd3,NULL,_T("ComboBoxEx32"),NULL);
  HWND hwnd5=::FindWindowEx(hwnd4,NULL,_T("ComboBox"),NULL);
  HWND hwnd6=::FindWindowEx(hwnd5,NULL,_T("Edit"),NULL);

   char sz[255];
  ::SendMessage(hwnd6,WM_GETTEXT,255,(LPARAM)sz);
  AfxMessageBox(sz);
 }
}

你可能感兴趣的:(VC 获取IE的URL)