WriteConfigSetting Method

PocketBrowser 3.x API

The WriteConfigSetting Method of the Generic ActiveX Object writes a setting to the configuration file.



WriteConfigSetting (Method of the Generic ActiveX Object) Syntax
bRetVal = objGeneric.WriteConfigSetting(strSetting,strValue,strAppName);

ParametersW Toggle Parameters

Items listed in this section indicate parameters, or attributes which can be set.

Name Possible Values Description
Default Value
strSetting See: Configuration Settings A setting identifier N/A
strValue String Value to set. N/A
strAppName String The name of a PocketBrowser application as specified in Config.XML. When writing to a global setting this should be omitted or 'GLOBAL' used. "GLOBAL"

axReturns Toggle Return Values

Name Description
bRetVal Returns a boolean value to indicate whether or not the write was successful.

Examples Toggle Examples

The following javascript sets fullscreen off in the configuration file.

<script>
var objGeneric = new ActiveXObject("PocketBrowser.Generic");
var Ret = objGeneric.WriteConfigSetting("FULLSCREEN","0");
if(Ret=='true'){
alert("Setting saved and will take place on the next PocketBrowser re-start");
}

</script>
Copy example to clipboard Copy example to clipboard

The following javascript example turns the scrollbars setting off for the application named "Menu".

<script>
var objGeneric = new ActiveXObject("PocketBrowser.Generic");
var Ret = objGeneric.WriteConfigSetting("SCROLLBARSENABLED","0","Menu");

if(Ret=='true'){
alert("Setting saved and will take place on the next PocketBrowser re-start");
}

</script>
Copy example to clipboard Copy example to clipboard

Remarks Toggle Remarks

The data is written directly to the configuration file. Configuration changes take effect only after PocketBrowser is re-started.

The configuration settings are accessed using symbolic names written in uppercase. These can be found in Configuration Settings under Getting Started, or just click the link below.

Global settings are placed outside of the <Application> tags. Application settings are placed within the <Application> tags.


Info Toggle Additional Information

Supported Platforms Windows CE, Windows Mobile
Persistence Runs immediately.
Min. Requirements None.