ActivationRegistrationManager.RegisterForProtocolActivation 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當透過 ShellExecute、 Launcher.LaunchUriAsync 或命令列執行指定的 URI 方案時,註冊以啟動應用程式。
public:
static void RegisterForProtocolActivation(Platform::String ^ scheme, Platform::String ^ logo, Platform::String ^ displayName, Platform::String ^ exePath);
/// [Windows.Foundation.Metadata.Experimental]
static void RegisterForProtocolActivation(winrt::hstring const& scheme, winrt::hstring const& logo, winrt::hstring const& displayName, winrt::hstring const& exePath);
static void RegisterForProtocolActivation(winrt::hstring const& scheme, winrt::hstring const& logo, winrt::hstring const& displayName, winrt::hstring const& exePath);
[Windows.Foundation.Metadata.Experimental]
public static void RegisterForProtocolActivation(string scheme, string logo, string displayName, string exePath);
public static void RegisterForProtocolActivation(string scheme, string logo, string displayName, string exePath);
function registerForProtocolActivation(scheme, logo, displayName, exePath)
Public Shared Sub RegisterForProtocolActivation (scheme As String, logo As String, displayName As String, exePath As String)
參數
- scheme
-
String
Platform::String
winrt::hstring
URI 方案用於註冊啟用,例如 https。
- logo
-
String
Platform::String
winrt::hstring
這是 Windows 用於 URI 方案的映像或資源路徑。 對於封裝應用程式,這個參數是影像檔案的套件相關係路徑。 對於未封裝的,這個參數是一則二進位檔案(DLL、EXE)的直譯檔案路徑加上資源索引。
- displayName
-
String
Platform::String
winrt::hstring
這個顯示名稱是 Windows 用於 URI 方案的。
- exePath
-
String
Platform::String
winrt::hstring
要啟用的執行檔路徑。 如果你傳遞空字串,目前執行檔會預設被啟用。 通常,若呼叫此方法的使用者是應用程式的安裝程式而非應用程式本身,則會指定此參數。
- 屬性
備註
已封裝的應用程式應該繼續使用其 appx 指令清單來註冊檔類型、通訊協定或啟動啟用。 他們可以選擇使用 Microsoft.Windows。AppLifecycle.AppInstance.GetActivatedEventArgs 或 Windows.ApplicationModel.AppInstance.GetActivatedEventArgs 用來取得啟用時的參數。