The SetOption method enables or disables a single option
for the browser instance attached to the specified host window. Each
option corresponds to a specific feature or behavior such as scripting,
zoom controls, developer tools, or privacy settings. Only one option
bitflag may be specified in the dwOption parameter when calling
this method. It is not valid to combine multiple option flags with a
bitwise OR. If you need to change the state of multiple options, call
this method once for each option you want to modify.
Some options can be changed dynamically at runtime, while others only
take effect during creation of the browser control. For example, options
related to scripting, dialogs, or developer tools can typically be
toggled while the control is active. In contrast, options that affect
the user data folder, profile isolation, or privacy mode must be set at
creation time using Attach or
Create. Attempting to change those options will
fail once the browser control has been created.
If the method succeeds, the option state will be updated immediately.
The application can verify the new state by calling GetOption
or by retrieving all current options with GetAllOptions.
If the method fails, no changes are made and extended error information
can be obtained with GetLastError.