Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
4/8/2010

This notification message is sent by the HTML viewer control before a navigation request to a URL begins.

Syntax

NM_BEFORENAVIGATE
NM_HTMLVIEW * pnmHTMLView = (NM_HTMLVIEW *)lParam;
szURL = pnmHTMLView->szTarget;
szPostData = pnmHTMLView->szData;
dwFlags = pnmHTMLView->dwFlags;
pszHeaders = pnmHTMLView->szExInfo;

Parameters

szURL

A null-terminated string that contains the navigation URL.

szPostData

A null-terminated string that contains the navigation POST data.

dwFlags

The following table gives various values and descriptions.

Value Description

NAVIGATEFLAG_REFRESH

The navigation is a forced refresh of the URL content from the server, without checking expiration time or last-modified time.

NAVIGATEFLAG_RELATIVE

The navigation is relative to the current page.

NAVIGATEFLAG_ENTERED

The user entered the URL for the navigation.

NAVIGATEFLAG_IGNORETARGET

The navigation is ignoring the TARGET attribute (if navigated via an <A HREF> tag.

NAVIGATEFLAG_GETFROMCACHE

The navigation loads the content from the cache, without checking expiration time. Goes online only if there is no cache.

NAVIGATEFLAG_NOCACHE

The content of the navigation will not be cached.

NAVIGATEFLAG_RELOAD

Same as NAVIGATEFLAG_REFRESH, except that the referer on the HTTP request does not get set, and the content may be loaded from the cache if it has not expired.

NAVIGATEFLAG_RESYNCHRONIZE

The navigation checks the server to see that the most recent content is available. This will allow the HTML control to go online without checking the expiration time. Then, the underlying code will compare the "last modified" time with the server, and download the more recent content, if necessary.

pszHeaders

A null-terminated string that contains the headers sent to the server for the navigation.

Return Value

The return value is ignored by the control.

Remarks

The information contained in the szURLparameter returned by NM_BEFORENAVIGATEis the navigation URL as it appeared in the SendMessageargument list before being composed into a complete and valid navigation URL. The information contained in the szURLparameter returned by NM_NAVIGATECOMPLETEis the complete navigation URL.

Example

To navigate to msn.com:

Copy Code
SendMessage(g_hWndCtrl, DTM_NAVIGATE, 0,
(LPARAM)TEXT("http://msn.com/));

This actually navigates to http://www.msn.com. The szURLparameter returned by NM_BEFORENAVIGATEis "http://msn.com", but the szURLparameter returned by NM_NAVIGATECOMPLETEis "http://www.msn.com".

Requirements

Header htmlctrl.h
Library htmlctrl.lib
Windows Mobile Pocket PC 2002 and later, Smartphone 2002 and later

See Also