如何从任务管理器进程列表中的进程列表中区分不同的JavaWS应用程序? [英] How to differentiate between different JavaWS applications from the list of processes in the task manager process list?

查看:33
本文介绍了如何从任务管理器进程列表中的进程列表中区分不同的JavaWS应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 JavaWS 来启动一个应用程序,然后如何检查该应用程序是否在用户的机器上运行,因为它在任务管理器进程列表中的名称不是我在 JNLP 文件中给出的.

I am using JavaWS to launch an application, then how to check whether that application is running or not in the user's machine as it's name in the Task manager process list is not what I gave in the JNLP file.

注意. 我检查了任务管理器进程列表,但进程的名称是 javaw.exe,所有使用 JavaWS 的应用程序都将具有相同的名称.我的问题是,如果用户启动了多个 JavaWS 应用程序,那么我们如何确定要检查的进程?我想获取进程的 PID,但不幸的是没有任何方法可以获取进程的 PID.我在 Windows 上工作.

NOTE. I checked the task Manager process list but there the name of the process is javaw.exe and all the applications which are using JavaWS will have the same name. My question being if the user has launched multiple JavaWS applications then how can we identify the process which we want to check? I thought of getting the PIDs of the process but unfortunately there wasn't any way to get the PIDs of the process. I am working on Windows.

推荐答案

..如何检查该应用程序是否在用户机器上运行..

..how to check whether that application is running or not in the user's machine..

无需求助于检查进程,这是一种固有的操作系​​统特定方法.

There's no need to resort to examining processes, an inherently OS specific approach.

JNLP API 提供了 SingleInstanceService 其中...

The JNLP API offers the SingleInstanceService which..

..允许在 Java Web Start 下启动的应用程序将自己注册为单例,并在用户尝试启动它们的新实例时传入新的参数集.

..allow(s) applications launched under Java Web Start to register themselves as singletons, and to be passed in new parameter sets when user attempts to launch new instances of them.

然后,您的代码将决定是更新当前应用、将其置于最前面还是启动新实例.

Your code will then get to decide whether to update the current app., bring it to the front, or launch a new instance.

这篇关于如何从任务管理器进程列表中的进程列表中区分不同的JavaWS应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆