Results 1 to 5 of 5

Thread: QProcess starting minimized

  1. #1
    Join Date
    Feb 2006
    Location
    Denmark
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QProcess starting minimized

    Hi.

    I'm using QProcess to start a process, with the static startDetached(...) method.
    How can I make the started process minimized?


    Thanks!

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QProcess starting minimized

    Is the external program written by you? Maybe you could pass a command line parameter? QProcess does not know anything about possible windows created by the process.
    J-P Nurmi

  3. #3
    Join Date
    Feb 2006
    Location
    Denmark
    Posts
    11
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProcess starting minimized

    Unfortunately I have little control over the process...

  4. #4
    Join Date
    Jun 2006
    Location
    Sweden
    Posts
    99
    Thanks
    11
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess starting minimized

    Quote Originally Posted by moe View Post
    Unfortunately I have little control over the process...
    So you know of no command line features the process might have that you can exploit? What about input via standard input? If not, then, unfortunately, you might be out of luck. Of course, you _could_ use win32-api to minimize the window, but that might not be the cleanest solution and it's assuming you're coding on/for a windows platform.

  5. #5
    Join Date
    Aug 2006
    Posts
    44
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QProcess starting minimized

    Assuming you're working in Windows, a quick check of the Qt source confirms that they don't support the mechanism that's available in the STARTUPINFO passed into the CreateProcess function down in QProcess' implementation.

    Even if it did, that doesn't necessarily mean that the application will honor your request.

    A general solution is going to be either insanely complex or simply full of holes. (Examples: app creates many windows; app creates window that can't be minimized; app creates a splashscreen, closes it and then creates main window, etc. etc. etc.) So, I'd say that in a Windows setup, just make your own CreateProcess() call and hope for the best.

    Trying to ferret out the right window to minimize via an OS call is just an excercise in futilty.

    IMO, it's a a valid suggestion to make to TrollTech to request such a feature to be available in QProcess, with the caveat that it may not work.

    All that being said, unless you're truly shooting for a totally general-purpose utility here, having some a priori knowledge of what you're spawning and how to tell it to behave a certain way would be the most reliable solution.

  6. The following user says thank you to Eldritch for this useful post:

    moe (4th March 2007)

Similar Threads

  1. Quoting problem with QProcess
    By the_bis in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2006, 11:24
  2. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30
  3. QProcess problem in accessing stdout
    By aruna in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2006, 17:56
  4. QProcess / system call not working under linux. Why?
    By johnny_sparx in forum Qt Programming
    Replies: 12
    Last Post: 11th March 2006, 00:32
  5. QProcess in a QThread
    By chombium in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2006, 15:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.