Solved

How to minimize a child process ?

Posted on 2002-04-25
9
577 Views
Last Modified: 2012-06-21
OS: Windows 2K Pro
Java 2 Platform Std. Ed. v1.4.0

I have an application with its main window running in full screen mode using  setFullScreenWindow.
I launch a native application based on user input using
Runtime rt = Runtime.getRuntime();
Process child = rt.exec("Notepad.exe", "c:\\boot.ini" );

The problem is that once the native application (Notepad.exe) is launched, my full screen window is minimized and the focus is moved to the Notepad.exe.

The questions are:
1. How can I launch the child process in a minimized window.
2. How can I keep my main full screen window maximized, and on the top of all other application (TopMost) and has the focus?

Thanks
0
Comment
Question by:soso071898
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6970379
Don't know of any Java API to do what you wish.
The only way I can think of is find a Windoze command that opens an application up already minimized, and call that using exec().

0
 
LVL 92

Expert Comment

by:objects
ID: 6970382
Have you tried bringing re-maximising your frame and bringing it to the front after notepad has fired up.
0
 
LVL 35

Expert Comment

by:girionis
ID: 6970780
 Maybe this come in handy:

http://forum.java.sun.com/thread.jsp?forum=5&thread=9494 although they suggest that it does not always work.
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 35

Expert Comment

by:girionis
ID: 6970784
 ... and of course, as objects suggested you can monitor the "de-activated" window and bring it back to top again: http://home-1.tiscali.nl/~bmc88/java/sbook/0115.html
0
 
LVL 2

Accepted Solution

by:
Andrey_Kulik earned 500 total points
ID: 6970835
Hi
 
try this:
Runtime.getRuntime().exec(new String[] {"cmd", "/C", "start", "/MIN", "notepad", "c:/boot.ini"});

best regards
Andrey
0
 
LVL 2

Expert Comment

by:Andrey_Kulik
ID: 6970841
After that comand you could return focus back forcedly...

I hope helps :)

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 6970941
Why not open the boot.ini file in a text component in your application window? This would also be safer and more portable.
0
 
LVL 92

Expert Comment

by:objects
ID: 6972791
> Runtime.getRuntime().exec(new String[] {"cmd", "/C", "start", "/MIN", "notepad", "c:/boot.ini"});

That's what I suggested above :-)
0
 
LVL 2

Expert Comment

by:Andrey_Kulik
ID: 6974702
2objects:
your suggestion is suggestion only :)
Because java has only one way to launch other applications and this method hasnot any additional parameters to handle launching (minimazing and others), so your suggestion was obviously... but it's not solution :)

best regards
Andrey
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question