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.
A version of this page is also available for
4/8/2010

This function sets options for the current Internet session.

Syntax

HRESULT UrlMkSetSessionOption(
  DWORD 
dwOption,
  LPVOID 
pBuffer,
  DWORD 
dwBufferLength,
  DWORD 
dwReserved
);

Parameters

dwOption

[in] Unsigned long integer value that contains the option to be set. This can be one of the values shown in the following table.

Value Description

INTERNET_OPTION_PROXY

Sets the proxy settings. The pBufferparameter must contain an INTERNET_PROXY_INFOstructure. INTERNET_OPTION_PROXYand INTERNET_PROXY_INFOare defined in the Wininet.h file. For more information, see the WinInet API.

INTERNET_OPTION_REFRESH

Sets the value that determines if the proxy information can be reread from the registry. The value TRUE indicates that the proxy information can be reread from the registry. For more information, see the WinInet API.

URLMON_OPTION_USERAGENT

Sets the user agent string for this process.

URLMON_OPTION_USERAGENT_REFRESH

Refreshes the user agent string from the registry for this process.

pBuffer

[in] Address of the buffer containing the new session settings.

dwBufferLength

[in] Unsigned long integer value that contains the size of pBuffer.

dwReserved

[in] Reserved. Must be set to zero.

Return Value

Returns S_OK if options were successfully set or E_INVALIDARG if one of the parameters is invalid.

Remarks

This function maps directly to the Windows Internet function InternetSetOption, although UrlMkSetSessionOptionallows only global options to be set.

To use this function, the client code must include the Wininet.h file, which declares values for the dwOptionparameter and structures for the pBufferparameter.

Requirements

Header urlmon.h, urlmon.idl
Library urlmon.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later