Windows Dev Center

StorageItemQueryResult.GetItemsAsync(UInt32, UInt32) | getItemsAsync(UInt32, UInt32) method

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Retrieves a list of items (files and folders) in a specified range.


Public Function GetItemsAsync(
  startIndex As UInteger,  
  maxNumberOfItems As UInteger 
) As IAsyncOperation(Of IReadOnlyList)



Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

The zero-based index of the first item to retrieve. This parameter defaults to 0.


Type: Number [JavaScript] | System.UInt32 [.NET] | uint32 [C++]

The maximum number of items to retrieve. Use -1 to retrieve all items. If the range contains fewer items than the max number, all items in the range are returned.

Return value

Type: IAsyncOperation<IVectorView>

When this method completes successfully, it returns a list (type IVectorView) of items. Each item is the IStorageItem type and represents a file, folder, or file group.

In this list, files are represented by storageFile objects, and folders or file groups are represented by storageFolder objects.


You can use the isOfType method on both types of storage objects to find out whether an item is a storageFile or storageFolder object.

For C#/C++/VB: After you know whether the item is a StorageFile or StorageFolder, you can then cast the item to the appropriate type in order to access properties and methods specific to that object.

Use this overload to improve system performance by presenting a virtualized view of the query results that includes only the necessary subset of folders. For example, if your app displays many items in a gallery you could use this range to retrieve only the items that are currently visible to the user.

Requirements (device family)

Device family


API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::Storage::Search [C++]



Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows 10 Mobile Insider Preview


Windows::Storage::Search [C++]



See also

storageItemQueryResult class
storageItemQueryResult.getItemsAsync() method
Windows.Foundation.Collections.IVectorView interface
Windows.Storage.IStorageItem interface
Windows.Storage.IStorageItem.isOfType method
Windows.Storage.storageFile class
Windows.Storage.storageFolder class



© 2015 Microsoft