Re: Asking Windows Specific Questions



Luc The Perverse <sll_noSpamlicious_z_XXX_m@xxxxxxxxxx> wrote:
1. System Integration: I would like to "launch" a file using the system's
default handler (identical functionality to double clicking a file in
explorer or putting file in run menu) I can use
Runtime.getRuntime().exec("explorer.exe " + filename) but I believe that
has high overhead, and it prompts if you want to open the file.
("D:\media\Short Vids\Star Wars Kid Matrix Parody.wmv" loads default system
handler, in this case VLC media player)

Try running the command "start filename". This is Windows-specific,
though, so you should check the os.name system property and perhaps
offer an alternative.

2. Configuration Management: This may not be windows specific, but it is a
problem I have with virtuall every app I write. I need to store options -
but the first piece of information I need is where the configuration file
is. Knowing the path of my JAR file should be sufficient, but I don't know
how to grab this. Some programs need to run with multiple configurations.
What is the best way to handle settings/parameters/configuration management?

Have you considered the Preferences API, in java.util.prefs. That's the
good portable Java programmer answer, and if it meets your needs it's
better than anything else you could do.

Otherwise, see this long answer:

http://www.javamoderator.org/Java%20White%20Papers/05%20-%20Miscellaneous/Finding%20Application%20Intrinsic%20Data.doc

4. Windows Messaging: Right now I am writing an application which
interacts which interacts with a windows program called winamp (A music
player). I was forced to use a third party program called CLAmp to allow
command line interaction for enqueue and playing songs. If I could send
windows messages from my program directly the only command line interaction
I would need would be to invoke winamp if it is not already running.

This would require native code, and I'm not aware of an existing API to
do it. Does winamp implement a COM automation API? If so, then JACOB
is pretty easy to use to talk to automation servers.

5. Focus Question: In order for my program to work I need to invoke another
program (winamp). As long as winamp is already running there is no
problem, but when I invoke it my application loses focus and requires an Alt
Tab or mouse click to regain focus. I looked through the available
functions for a Gain Focus, Set Focus or Get Focus and I found MANY
functions, none of which seemed to regain the window focus. Am I just
misinterpriting the names - or has Gain Focus been deliberately removed from
Java?

Try Window.toFront(). I seem to recall that it flashes the title bar,
but it whould bring the window to the font of the system, and give it
focus.

Note that Window "focus" is different from normal component focus. Each
window has its own focused component. Using requestFocus will only
change which component is focused in that window, and not which window
is active.

6. Installation Program Question: This had extensive redundancy with
question #2. Basically I am looking for an installation program that can
do all of the following:

I've used WISE to build install kits. It will do most of this, as I
imagine anything else would, too. I have heard good things about
http://www.jrsoftware.org/isinfo.php.

Two things, though.

b. Check for JRE and direct user to a location to get it if they don't
have it. (or allow a bundled JRE optionally)

Are you sure? By far the safest thing to do when distributing a Java
app is to bundle a copy of the JRE in a subdirectory of where you
install the application, and invoke that JRE by its full path. Unless
you're distributing a developer tool (in which case you would want to
let the developer specify the location of the JRE), your users shouldn't
care whether reinstalling Java in FireFox breaks your app.

e. Register DLLs or EXE files that my program interacts with

This is only necessary if they contain COM components. Do they?

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.



Relevant Pages

  • Re: Opening programs already opened in taskbar (not going "on top")
    ... When a window that does not have focus is updated by its program, ... Customize Auto Hide Taskbar Settings Right hand side ... > programs opened up (say Internet Explorer, Word, Winamp, Visual Basic.NET, ... I just recently moved to XP from 2000 and this is the first problem I ...
    (microsoft.public.windowsxp.general)
  • Re: Does WinAmp LockUp for you on XP Pro?
    ... WinAmp will lockup and freeze for several minutes when trying to ... it wants 30-45 seconds to load a new window for example. ... To test hardware: ... computer repair shop. ...
    (microsoft.public.windowsxp.general)
  • Re: Trying to "embed" winamp in my app
    ... The program checks to see if Winamp is installed, ... panel height & then centre it meaning the starting point would be 5, ... 275, or actually, 280 is the perfect height for the Winamp window without ... explain my motivation for what I want to do, which is all the responses have ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Window Shade mode from WinAmp, PLEASE REPLICATE
    ... and open it with WMP, voila, WinAMP 2.x UI, with Window Shade mode. ... See http://zachd.com/pss/pss.html for some helpful WMP info. ... Look up the WinAMP Skin Converter power toy, ...
    (microsoft.public.windowsmedia.player)
  • Re: Emulators: Mess v.s. DVE v.s. ParaJVE
    ...   I don't consider my machine to be slow either. ... as switching the JRE completely fixes ... it is OK to run them in a window. ... all JREs *should* run a java program in exactly the ...
    (rec.games.vectrex)