Topic: java是否可以向c++一样捕获当前正在运行的进程?

  Print this page

1.java是否可以向c++一样捕获当前正在运行的进程? Copy to clipboard
Posted by: hohaischooldays
Posted on: 2003-09-22 20:44

java是否可以向c++一样捕获当前正在运行的进程?

2.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: archonLing
Posted on: 2003-09-23 09:58

hohaischooldays wrote:
java是否可以向c++一样捕获当前正在运行的进程?


If you mean determining active thread, then you can try Thread.currentThread()

3.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: archonLing] Copy to clipboard
Posted by: hohaischooldays
Posted on: 2003-09-24 16:12

archonLing wrote:
If you mean determining active thread, then you can try Thread.currentThread()

Smile首先我先感谢你的回答,但是如果我想取得当前进程的信息(并非是同一个程序或软件的进程),和当前进程进行通信我该怎么办呢?(我想知道如何搞一个管理当前运行软件的独立软件嘛)

4.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: archonLing
Posted on: 2003-09-24 16:31

Java programs are running within JVM, so it may not be able to interact directly within processes that are outside of its memory space. I could be wrong.

java.lang.Process enables you to get subprocess information, but that is not what you are looking for. I guess you can look into using Jave Native Interface to do this for you. You can code you memory module in C/C++ and access the module through your Java Interface.

5.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: hohaischooldays
Posted on: 2003-09-24 16:38

SmileThanks all the same !I will have a try !

6.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: sunzhaoqin
Posted on: 2003-09-24 17:25

能否得到所有运行的进程??就象任务管理器中的那样??

7.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: BlurEyes
Posted on: 2003-09-26 12:37

C++本身也不提供这样的功能吧
用java的话,也只有用jni了吧。

8.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: sunzhaoqin
Posted on: 2003-09-26 15:38

我使用vc++是可以实现的,不知道用java 怎么能够实现呢?

9.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: hohaischooldays
Posted on: 2003-10-22 12:36

如果都是用CORBA的,才可以吧!也就是说要有一个同意的协议吧!
因为我看到书上说满足CORBA 的任何程序间可以通信,即使编程语言不同!

10.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: yiqiang
Posted on: 2003-10-22 16:37

Your thread is runing on the OS so your problem is how to get the runing thread message from OS API.

11.Re:java是否可以向c++一样捕获当前正在运行的进程? [Re: hohaischooldays] Copy to clipboard
Posted by: dog72
Posted on: 2003-10-23 12:04

拿到process id还是比较容易的,但是在windows上只能支持kill;在Unix上可以发信号给这些进程。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923