Windows Mobile 6.5
A version of this page is also available for

This function allows an application to set its priority in the handoff priority list for a particular media type or Assisted Telephony request mode, or to remove itself from the priority list.

LONG WINAPI lineSetAppPriority(
  LPCSTR lpszAppFilename,
  DWORD dwMediaMode,
  DWORD dwRequestMode,
  LPCSTR lpszExtensionName,
  DWORD dwPriority 


Pointer to a string containing the application executable module file name (without directory information). In TAPI 2.0 or later, the parameter can specify a file name in either long or 8.3 file name format.


Media type for which the priority of the application is to be set. The value can be one of the LINEMEDIAMODE constants; only a single bit may be on. The value zero should be used to set the application priority for Assisted Telephony requests.


Pointer to a structure of type LINEEXTENSIONID. This parameter is ignored.


If the dwMediaMode parameter is zero, this parameter specifies the Assisted Telephony request mode for which priority is to be set. It must be either LINEREQUESTMODE_MAKECALL or LINEREQUESTMODE_MEDIACALL. This parameter is ignored if dwMediaMode is nonzero.


This parameter is ignored.


New priority for the application. If the value zero is passed, the application is removed from the priority list for the specified media or request mode (if it was already not present, no error is generated). If the value one is passed, the application is inserted as the highest-priority application for the media or request mode (and removed from a lower-priority position, if it was already in the list). Any other value generates an error.

Returns zero if the request succeeds or a negative error number if an error occurs. The following table shows the return values for this function.

Value Description


The INI file is corrupted.


The request mode is invalid.


The application name is invalid.


Not enough memory is available.


The media mode value is invalid.


The operation failed.


The parameter is invalid.


The resources are unavailable.


The pointer is invalid.

If LINEERR_INVALMEDIAMODE is returned, the value specified in dwMediaMode is not zero and not one of the LINEMEDIAMODE constants, or more than one bit is on in the parameter value.

This function updates the stored priority list. If the telephony system is initialized, it also sets the current, active priorities for applications then running; the new priority is used on the next incoming call or lineHandoff based on media type.

Although this is a new function that older applications would not be expected to call, for backward compatibility they should not be prevented from doing so. The function works the same way for all applications.

This function is for TAPI version 2.0 and later.
When an application is set to the highest priority by calling lineSetAppPriority with dwPriority set to 1, the phone will not ring for incoming calls while this application is running.

Windows Embedded CEWindows CE 1.0 and later
Windows MobileWindows Mobile Version 5.0 and later

Community Additions