Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Accessing external programs

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I wish to access a non Java program (Winamp) by sending it a message,
like this...



How is this done in Java (properly), through the Java API somehow?

thanks
 
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by timothy twoshoes:


How is this done in Java (properly), through the Java API somehow?


SendMessage() is very much Windows-specific. I believe that there is no platform independent model of it in Java.

Therefore, you either have to find another way to interact with your external program (does it have a CORBA API, for instance?) or you have to use JNI. The JNI code for the above would be really very easy, once you got over the initial JNI learning curve.
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Timothy --

Welcome to JavaRanch!

It looks like you may not have read our naming policy on the way in. It reqiures that you use a full, real (sounding) first and last name for your display name, and I'm not convinced that you're meeting the "real-sounding" criterion. You can change your display name here.
 
Enjoy the full beauty of the english language. Embedded in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!