Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

closing windows programs

Status
Not open for further replies.

fatcodeguy

Programmer
Feb 25, 2002
281
CA
Hi. I was wondering if there was a way that a java program could close another windows (XP) program, such as winamp. For example, I have a timer set for one hour, and after that hour, I want winamp to shut down. How is this done (I know the Timer and TimerTask classes)? Thanks
 
Hi someguy32,
I know 2 ways that possibly might be able to do what you want. Both involve knowing some Windows programming or scripting which hopefully someone else can help you with, since I'm not up on that sort of stuff.
Anyway, the first way involves using native classes to close the window, which would be called by Java.
The second way involves using
Code:
Runtime.exec (String)
. If it's possible to close down winamp from the command console, this should work. The string you would enter in to the console to close down winamp would go into
Code:
Runtime.exec (String)
.

Hope this helps,
MarsChelios
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top