Share via


Creating the Navigation Control (Windows Embedded CE 6.0)

1/6/2010

The navigation control implements the IOleControlNavigation2AdviseSink interface to coordinate navigation into the control and among its navigation rectangles. To gain access to the browser object, the navigation control calls IOleObject::SetClientSite to query the browser for the IOleControlNavigation2AdviseSink interface. The COM_Map in the browser object should include COM_INTERFACE_ENTRY_IID(IID_IOleControlNavigation2, IOleControlNavigation2).

The GetControlNavigationCapabilities method uses a set of flags to communicate to the browser how the navigation will be managed. This method is called as the browser is laying out the page and just before it begins to lay out the control.

Managing Navigation with the Browser

The browser maintains a list of selectable areas. To include the navigation rectangles for the ActiveX control in this list, the browser calls the GetNavigationRectCount and GetNavigationRects methods during page layout. The coordinates of all rectangles passed to the browser are relative to the upper left hand corner of the control.

As the user navigates among the navigation rectangles in control, the browser calls the ActivateRect method to tell the control which rectangle is receiving the focus. Similarly, the browser calls DeactivateRect to tell the control that the focus is being taken away from a rectangle. The browser calls GetCurrentRectIndex when the document is scrolled or when the navigation control uses the IOleControlNavigation2AdviseSink interface to inform the Browser that the navigation rectangles have changed.

Managing Navigation with the Navigation Control

The browser calls NavigateInControl when the navigation control is loaded initially and positioned correctly on the page, or when the user navigates into the bounding rectangle of the control. Optionally, the control can set the NAV_CONTROLREQUESTSWAITFORNAVIGATIONSTATUS flag in the GetControlNavigationCapabilities method to delay accepting focus after it has been loaded by the browser.

When the control is managing navigation the GetNavigationRects, ActivateRect, DeactivateRect, GetCurrentRectIndex, and GetNavigationRectCount methods are not implemented and should always return S_OK.

See Also

Other Resources

Internet Explorer TV-Style Navigation Application Development