To minimize the java window tosystem tray

P

Percy

I am programming a application which is based on socket .

And i want that it starts at system startup and a method which can
minimize the java frame to system tray so that the client can't notice
it .

Or i want that it even can't be at system tray ,it should be hidden
process like the processes which we see in task manager's processes
tab.And one more thing how i can make the process in a waythat it cant
be stopped ,like explorer.exe,and if someone end it the system also
gets shutdown.
 
O

Oliver Wong

Percy said:
I am programming a application which is based on socket .

And i want that it starts at system startup and a method which can
minimize the java frame to system tray so that the client can't notice
it .

Java 1.6, which is coming out soon, is supposed to have support for the
system tray.

Or i want that it even can't be at system tray ,it should be hidden
process like the processes which we see in task manager's processes
tab.

Isn't this just like writing a regular Swing application, except you
never actually call setVisible(true)?
And one more thing how i can make the process in a waythat it cant
be stopped ,like explorer.exe,and if someone end it the system also
gets shutdown.

Not sure that it can be done in a platform independent way. Sounds like
you're mostly interested in Windows though. Maybe use JNI in combination
with http://www.codeguru.com/cpp/w-p/win32/tutorials/article.php/c8647/

- Oliver
 
J

Jeffrey Schwab

Percy said:
I am programming a application which is based on socket .

And i want that it starts at system startup and a method which can
minimize the java frame to system tray so that the client can't notice
it .

Or i want that it even can't be at system tray ,it should be hidden
process like the processes which we see in task manager's processes
tab.

It sounds like you want to write a daemon. For Linux-like platforms,
you just need to write a script or two to start and stop your program,
and put the script in the appropriate rc file directory. For Windows,
you'll need to register your program as a Windows Service. JET claims
to help with this: http://www.excelsior-usa.com/kb/000019.html
And one more thing how i can make the process in a waythat it cant
be stopped ,like explorer.exe,and if someone end it the system also
gets shutdown.

That's not how explorer works. A redundant process (or possibly part of
the kernel) polls the Windows shell (explorer.exe) periodically, and if
the process doesn't respond, it gets restarted. This doesn't seem to
work particularly well on my own XP boxes.

Intentionally bringing down the whole system when your program crashes
sounds like a spectacularly bad idea. Like Darwin Award bad. Would you
please post a quick description of why you want this? My curiosity is
piqued.
 
R

Rhino

Jeffrey Schwab said:
It sounds like you want to write a daemon. For Linux-like platforms, you
just need to write a script or two to start and stop your program, and put
the script in the appropriate rc file directory. For Windows, you'll need
to register your program as a Windows Service. JET claims to help with
this: http://www.excelsior-usa.com/kb/000019.html


That's not how explorer works. A redundant process (or possibly part of
the kernel) polls the Windows shell (explorer.exe) periodically, and if
the process doesn't respond, it gets restarted. This doesn't seem to work
particularly well on my own XP boxes.

Intentionally bringing down the whole system when your program crashes
sounds like a spectacularly bad idea. Like Darwin Award bad. Would you
please post a quick description of why you want this? My curiosity is
piqued.

Perhaps he has mischief in mind; some kind of attack on recipients of a
virus for example. It's hard to think of a GOOD reason for doing what he
wants to do.
 
A

Alun Harford

Rhino said:
Perhaps he has mischief in mind; some kind of attack on recipients of a
virus for example. It's hard to think of a GOOD reason for doing what he
wants to do.

Indeed. I can't think of any legitimate reason to do this.
Part of me thinks it would be appropriate to inform the India authorities.

Alun Harford
 
C

Chris Uppal

Percy said:
Or i want that it even can't be at system tray ,it should be hidden
process like the processes which we see in task manager's processes
tab.And one more thing how i can make the process in a waythat it cant
be stopped ,like explorer.exe,and if someone end it the system also
gets shutdown.

If you don't know enough about Windows system programming to be able to do this
without help, then you /definitely/ don't know enough to be trusted to create
such a dangerous program.

BTW, why ask a bunch of Java programmers about Windows system programming ? I
suppose there may be a few Win32 experts here, but it's not the place you'd
expect to find many.

-- chris
 
O

Oliver Wong

Rhino said:
Perhaps he has mischief in mind; some kind of attack on recipients of a
virus for example. It's hard to think of a GOOD reason for doing what he
wants to do.

I was at this arcade where there was this touchscreen game. You put in
quarters and you get to play games that you could otherwise play for free on
the internet (e.g. tetris, bejeweled, etc.) Anyway, I was just messing
around with the device, pressing my finger all over the touchscreen as
quickly as possible when the machine crashed.

After a few seconds pause, the machine rebooted itself (it was running
some variant of Linux, for the curious), and got back into the lobby, where
I was prompted to select a game, and insert money for the priviledge of
playing the selected game.

I guess this is more desirable than having me go over to the person who
gives you change and complain about how the machine swallowed my quarter,
and having the person stare dumbfoundedly at the frozen machine, with no
idea how to fix it.

- Oliver
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top