2016-09-14 54 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

嗯但这没用。运行时应该有一种方法来定义参数。 –

相关问题