• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing external programs

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic