Language

DispatcherQueueController.CreateOnCurrentThread メソッド

定義

呼び出し元のスレッドで、USER32 メッセージ ループと相互運用する DispatcherQueue を作成します。

public:
 static DispatcherQueueController ^ CreateOnCurrentThread();
 static DispatcherQueueController CreateOnCurrentThread();
public static DispatcherQueueController CreateOnCurrentThread();
function createOnCurrentThread()
Public Shared Function CreateOnCurrentThread () As DispatcherQueueController

返品

呼び出し元スレッドの DispatcherQueue 。

注釈

DispatcherQueue が作成され、現在のスレッドに関連付けられます。 現在のスレッドに関連付けられている DispatcherQueue が既にある場合、エラーが発生します。 作成された DispatcherQueue には、 DispatcherQueueController.DispatcherQueue を使用してアクセスできます。

ディスパッチャー キューがタスクをディスパッチできるように、現在のスレッドはメッセージをポンプする必要があります。 現在のスレッドが終了する前に、 DispatcherQueueController.ShutdownQueueAsync を呼び出し、 IAsyncAction が完了するまでメッセージのポンプを続行する必要があります。または 、DispatcherQueueController.ShutdownQueue を呼び出します。これは、キューがシャットダウンされるまで戻りません。

適用対象