Share via


UrlMkSetSessionOption

Send Feedback

Sets options for the current Internet session.

Syntax

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

Parameters

  • dwOption
    [in] Contains the option to be set. See Remarks for more information about this parameter.
  • pBuffer
    [in] Address of the buffer containing the new session settings.
  • dwBufferLength
    [in] The size of pBuffer.
  • dwReserved
    [in] Reserved; must be set to zero.

Return Values

This function returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    The function completed successfully.
  • S_FALSE
    If dwOption was URLMON_OPTION_USERAGENT_REFRESH, there was no user agent string in the registry. If dwOption was INTERNET_OPTION_PROXY or INTERNET_OPTION_REFRESH, the call to InternetSetOption failed.

Remarks

The dwOption parameter is either a flag or a constant, described in the following two tables. The flags are defined in the urlmon.h header file, and the constants are defined in the wininet.h header file.

Flag Value Description
URLMON_OPTION_USERAGENT 0x10000001 Sets the user agent string for this process.
URLMON_OPTION_USERAGENT_REFRESH 0x10000002 Refreshes the user agent string from the registry for this process.
Constant Value Description
INTERNET_OPTION_PROXY 38 Sets the proxy information from the registry.
INTERNET_OPTION_REFRESH 37 Refreshes the proxy information from the registry.

If dwOption is either INTERNET_OPTION_PROXY or INTERNET_OPTION_REFRESH, UrlMkSetSessionOption maps to the following call of InternetSetOption:

InternetSetOption(NULL, dwOption, pBuffer, dwBufferLength)

Requirements

Pocket PC: Pocket PC 2000 and later
Smartphone: Smartphone 2002 and later
OS Versions: Windows CE 3.0 and later
Header: urlmon.h
Library: urlmon.lib

See Also

URL Moniker Services Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.