You'll need to find all the IE instances or your program's instances with FindWindowEx or EnumWindows. Then you can use GetWindowText to find out what the text is for each of the above windows. You'll want to use SendMessage with WM_Keydown and WM_Keyup to do the key pressing.