StrFromTimeIntervalA.3w

Langue: en

Version: Jun 2009 (debian - 07/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

StrFromTimeIntervalA (SHLWAPI.@)

SYNOPSIS

INT StrFromTimeIntervalA
 (
  LPSTR lpszStr,
  UINT  cchMax,
  DWORD dwMS,
  int   iDigits
 )

DESCRIPTION

Format a millisecond time interval into a string.

PARAMS

lpszStr [Out] Output buffer for formatted time interval.

cchMax [In] Size of lpszStr.

dwMS [In] Number of milliseconds.

iDigits [In] Number of digits to print.

RETURNS

The length of the formatted string, or 0 if any parameter is invalid.

NOTES

This implementation mimics the Win32 behaviour of always writing a leading space before the time interval begins.

iDigits is used to provide approximate times if accuracy is not important. This number of digits will be written of the first non-zero time class (hours/minutes/seconds). If this does not complete the time classification, the remaining digits are changed to zeros (i.e. The time is _not_ rounded). If there are digits remaining following the writing of a time class, the next time class will be written.

For example, given dwMS represents 138 hours,43 minutes and 15 seconds, the following will result from the given values of iDigits:

  iDigits    1        2        3        4               5               ...

  lpszStr   "100 hr" "130 hr" "138 hr" "138 hr 40 min" "138 hr 43 min"  ...

IMPLEMENTATION

Defined in "shlwapi.h".

Implemented in "dlls/shlwapi/string.c".

Debug channel "shell".