IStillImage::LaunchApplicationForDevice method

The IStillImage::LaunchApplicationForDevice method starts a specified application for a specified still image device.

Syntax

HRESULT LaunchApplicationForDevice(
  [in] LPWSTR      pwszDeviceName,
  [in] LPWSTR      pwszAppName,
  [in] LPSTINOTIFY pStiNotify
);

Parameters

Return value

If the operation succeeds, the method returns S_OK. Otherwise, it returns one of the STIERR-prefixed error codes defined in stierr.h.

Remarks

The IStillImage::LaunchApplicationForDevice method can only start applications that have registered themselves by calling IStillImage::RegisterLaunchApplication. The specified event must be one that the specified device supports. The method mimics the occurrence of a device event, and is useful for applications that intercept events from devices and reroute them. (When a user starts the scanner, such an application might, for example, ask the user whether she wants to store the scanned image, make a copy, or send a fax.)

Before calling IStillImage::LaunchApplicationForDevice, clients of the IStillImage COM interface must call IStillImage::StiCreateInstance to obtain an IStillImage interface pointer.

Examples

HRESULT hRes;
hRes = pStiDevice->GetLastNotificationData(&pNotify);
if (!SUCCEEDED(hRes))
{
    DisplayOutput("->GetLastNotificationData returned %xh %u",
        hReturn,hReturn);
}
 
// Process or filter events here
 
// Send event on to app
hRes = pSti->LaunchApplicationForDevice(pStiInfoPtr->szDeviceInternalName,
     L"AppName",
     pNotify);
if (!SUCCEEDED(hRes))
{
    DisplayOutput("->LaunchApplicationForDevice on %S returned %xh %u",
        pStiInfoPtr->szDeviceInternalName,hReturn,hReturn);
}

Requirements

Target platform

Desktop

Header

Sti.h (include Sti.h)

 

 

Send comments about this topic to Microsoft