Additional uses of the SetRuntimeProperty function

The SetRuntimeProperty function lets you set global properties and modify them at runtime.

EnableExtraActivates property

In PocketBuilder 2.5, you can use the SetRuntimeProperty system function to set the EnableExtraActivates property and increase the number of window activation and deactivation messages you receive from an application running on a mobile device.

Windows operating systems typically provide fewer window activation and deactivation messages for mobile devices than for desktop computers. This is especially true for pop-up windows. Setting the EnableExtraActivates property to true enables you to capture more window activation and deactivation messages on a mobile device without breaking legacy behavior. Unfortunately, it can also cause a window to receive two identical activation or deactivation messages. However, you can turn this property on or off at any time to fine tune the message capturing behavior.

You can use the following script to capture additional windows activation and deactivation messages on a mobile device:

integer li_return
li_return = SetRuntimeProperty &
    + (“EnableExtraActivates”, true)

MOPEnable property

In PocketBuilder 2.5, you can disable MOP views, or allow the end user to disable MOP views by setting the MOPEnable property to false. This can be convenient if you want MOP views turned off only for a series of dialog boxes, after which, you can enable MOP views again by setting the MOPEnable property to true. It can also be useful if a MOP view results in an undesired layout, permitting the end user to regain control over the screen display.

When you turn off the MOPEnable property, the last values saved for X, Y, Width, and Height properties determine the positions and dimensions of windows and controls regardless of the screen orientation of the handheld device.

MOP views are enabled by default. You can use the following script to disable MOP views on a particular device:

integer li_return
li_return = SetRuntimeProperty &
    + (“MOPEnable”, false)

For more information on the SetRuntimeProperty function and the other properties that it allows you to modify, see the PowerScript Reference in the online Help.