2016-09-14 63 views
2

什麼是最好的工作方式,從JavaScript調用UWP應用一個Win32可執行文件(視窗週年更新)UWP JavaScript的應用程序:運行Win32的EXE與參數

我曾試圖通過AppService服務配置的win32:

<uap:Extension Category="windows.appService" StartPage="www\index.html"> 
    <uap:AppService Name="CommunicationService" /> 
</uap:Extension> 

<desktop:Extension Category="windows.fullTrustProcess" Executable="mywin32app.exe" EntryPoint="Windows.FullTrustApplication" /> 

現在我可以用JavaScript從Windows.ApplicationModel.FullTrustProcessLauncher.launchFullTrustProcessForCurrentAppAsync()啓動它,但是如何使用參數啓動它?

+0

你有沒有每找到一個方法來做到這一點?我同意你,參數組是無用的,因爲你不能通過運行時參數 – mikeysee

+0

@mikeysee:不,我嘗試appservice aproach現在 –

回答

1

但我怎麼啓動它與參數

有一個帶參數的版本,這個方法,你可以使用的:FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync(String)

而且declear在appxmanifest文件中的參數:

<desktop:Extension Category="windows.fullTrustProcess" Executable="fulltrustprocess.exe"> 
     <desktop:FullTrustProcess> 
     <desktop:ParameterGroup GroupId="SyncGroup" Parameters="/Sync"/> 
     <desktop:ParameterGroup GroupId="OtherGroup" Parameters="/Other"/> 
     </desktop:FullTrustProcess> 
</desktop:Extension> 
+0

但它看起來像參數只能在清單中定義,對吧?那麼如何使用動態參數進行通話? –

+0

是的,參數只能在清單中定義,並且'GroupId'作爲參數傳遞給方法。我沒有其他選項的想法來傳遞參數。 –

+1

嗯但這沒用。運行時應該有一種方法來定義參數。 –

相關問題