NM_BEFORENAVIGATE
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 szURL parameter returned by NM_BEFORENAVIGATE is the navigation URL as it appeared in the SendMessage argument list before being composed into a complete and valid navigation URL. The information contained in the szURL parameter returned by NM_NAVIGATECOMPLETE is the complete navigation URL.
Example
To navigate to msn.com:
SendMessage(g_hWndCtrl, DTM_NAVIGATE, 0, (LPARAM)TEXT("https://msn.com/));
This actually navigates to https://www.msn.com. The szURL parameter returned by NM_BEFORENAVIGATE is "https://msn.com", but the szURL parameter returned by NM_NAVIGATECOMPLETE is "https://www.msn.com".
Requirements
Header | htmlctrl.h |
Library | htmlctrl.lib |
Windows Mobile | Pocket PC 2002 and later, Smartphone 2002 and later |
See Also
Reference
HTML Control API Notifications
DTM_NAVIGATE
DTM_STOP
NM_DOCUMENTCOMPLETE
NM_NAVIGATECOMPLETE
NM_HTMLVIEWA
NM_HTMLVIEWW