How to get IE main menu hwnd?
-
I want to get hwnd of IE main menu,and click one of the items,for example:View->Refresh,I write codes like this: HWND hwndIE=::FindWindow(_T("IEFrame"),NULL); HMENU appMenu=::GetMenu(hwndIE); HMENU subMenu=::GetSubMenu(appMenu,1); ... Everytime I got zero from subMenu,why?
-
I want to get hwnd of IE main menu,and click one of the items,for example:View->Refresh,I write codes like this: HWND hwndIE=::FindWindow(_T("IEFrame"),NULL); HMENU appMenu=::GetMenu(hwndIE); HMENU subMenu=::GetSubMenu(appMenu,1); ... Everytime I got zero from subMenu,why?
It is because IE doesn't have a standard menu, but instead uses a Rebar band with menu in it. Sadly, there's hardly any way to retrieve IE's menu with GetMenu(). Instead, you may want to try using IE's automation interface. I haven't used it to get IE's menu, but it shouldn't be too difficult.