共用方式為


DispatcherQueueController.CreateOnCurrentThread 方法

定義

在呼叫執行緒上,建立 DispatcherQueue ,以與 USER32 訊息迴圈交互操作。

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

傳回

呼叫執行緒上的 DispatcherQueue

備註

會建立 DispatcherQueue,並與目前的執行緒相關聯。 如果已經有與目前線程相關聯的 DispatcherQueue ,就會產生錯誤。 您可以透過DispatcherQueueController.DispatcherQueue存取已建立的DispatcherQueue

因此,發送器佇列可以分派工作,目前的執行緒必須提取訊息。 在目前的執行緒結束之前,它必須呼叫 DispatcherQueueController.ShutdownQueueAsync,然後繼續幫浦訊息,直到 IAsyncAction 完成為止;或呼叫 DispatcherQueueController.ShutdownQueue,直到佇列關機才會傳回。

適用於