To Stop Indexing in Progress

[The feature associated with this page, Windows Media Format 11 SDK, is a legacy feature. It has been superseded by Source Reader and Sink Writer. Source Reader and Sink Writer have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Source Reader and Sink Writer instead of Windows Media Format 11 SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

After you begin indexing with a call to IWMIndexer::StartIndexing, the indexer will normally continue until the file is indexed. You can stop indexing operations by calling the IWMIndexer::Cancel method. After you have canceled indexing, you can call StartIndexing again, but the indexer will start from the beginning of the file rather than resuming from the point of cancellation.

Because StartIndexing is an asynchronous call, you will normally need to call Cancel from some other thread or event handler in your application. Typically Cancel will be called from an event procedure associated with a button control of a Windows application.

When indexing is canceled, the indexer will pass a status message of WMT_CLOSED, just as if the file had been indexed properly.

IWMIndexer Interface

Working with Indexes