Solved

How to minimize a child process ?

Posted on 2002-04-25
9
574 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
  • 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to monitor the number of connections/threads being utilized on Tomcat 6.0 8 71
map related example 6 49
servlet example issue 6 40
How do I remove an object from a 3 26
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

810 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