[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to minimize a child process ?

Posted on 2002-04-25
9
Medium Priority
?
597 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

650 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