Share via


IHomePluginEnvironment::SetSingleShotTimer

4/8/2010

The SetSingleShotTimer method causes a PE_TIMER event to be sent to the plug-in after a given amount of time. Calling this method results in one instance of a PE_TIMER event.

Note

Timer events reduce the amount of time the device can spend in a battery conservation mode; use this method sparingly.

Syntax

HRESULT SetSingleShotTimer (
  HPLUGIN hPlugin,
  UINT cMiliseconds
);

Parameters

  • hPlugin
    [in] Handle to the plug-in for which the timer is set.
  • cMiliseconds
    [in] Number of milliseconds the timer waits.

Return Value

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

  • S_OK
    Indicates success.

Remarks

To conserve the battery power of the device, avoid frequent use of this method; the extra processing required for activities such as polling and animation drains the battery more quickly.

Methods in the IHomePluginEnvironment must be called from the thread on which the plug-in was created.

To get your data to update from your worker thread, call ShOnPluginDataChange with the class ID of your plug-in. Your plug-in then receives a PE_DATACHANGE event. In response to the PE_DATACHANGE event, if the data change requires the plug-in be redrawn, call IHomePluginEnvironment::InvalidatePlugin.

Requirements

Header home.h
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Smartphone 2002 and later

See Also

Reference

IHomePluginEnvironment
PluginEvent