Results 1 to 5 of 5

Thread: QProcess, child and setWorkingDirectory, for Windows process...

  1. #1
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default QProcess, child and setWorkingDirectory, for Windows process...

    Hello !

    I've a simple application that needs to launch Mozilla Firefox : that's OK.
    The matter is that this application is called by Windows when the computer user clic on a mailto link : my application is the one defined in the system registry to be launched as default mail client.

    So, when I'm clicking a mailto link on my favorite navigator (Mozilla Firefox), my application is launched and try to run Firefox (to set-up data in our Webmail message compose page). Like Firefox is already running, it should open a new tab for the Webmail... But not.

    As said before, it's Windows that launch my application. So the application user isn't the computer user and isn't the current Mozilla Firefox user : another Mozilla Firefox process is launched by my application.

    Is it possible to force the application to be run bu the current computer user ?
    I've tried to use the QProcess:: setWorkingDirectory(QString) function to launch the application from it's real directory (in program files), but Windows crashed .

    Thanks for your ideas and suggestions !

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QProcess, child and setWorkingDirectory, for Windows process...

    I'm not sure what you mean... Even if Windows launches the application, it does it on behalf of the current user. I don't know if this is the case on Windows, but on Linux I can manipulate a running instance of Firefox through a small app that is bundled with the browser.

    Isn't your problem that you form an endless loop between firefox and your app? When mailto: is called, your app i launched and it starts firefox and probably passes it the mailto: address, which again calls your app, etc.

  3. #3
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QProcess, child and setWorkingDirectory, for Windows process...

    I think that works well : my application is launched only when the user clic the milto link.
    I've controled it, and - lucky me - there is no such loop

    I'm very interested in this small application you use : you can control Firefox ?!
    Have you made this application, or is it coming with Firefox ?
    If it comes with Firefox, what is the name of this application ?
    What sort of control have you ?

    In my case, if I launch my application manually, a new tab is open in Firefox.
    If I launch it with a Batch script : the same.
    If my application is launched by Windows : it's a new Firefox that is opened.

    Moreover I've controled where the application is executed.
    If I launch it, it's executed from its directory in C:/Program Files.
    When Windows launch it, it's executed from a strange root disk M:///

    Thanks for your answers, that really help me

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QProcess, child and setWorkingDirectory, for Windows process...

    Quote Originally Posted by Nyphel View Post
    I'm very interested in this small application you use : you can control Firefox ?!
    Yes, sort of.
    Have you made this application, or is it coming with Firefox ?
    It's part of Firefox distribution for Linux.
    If it comes with Firefox, what is the name of this application ?
    mozilla-xremote-client

    What sort of control have you ?
    You can open new windows and urls.

  5. The following user says thank you to wysota for this useful post:

    Nyphel (4th June 2007)

  6. #5
    Join Date
    Feb 2007
    Posts
    158
    Thanks
    25
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QProcess, child and setWorkingDirectory, for Windows process...

    Ups...
    That was only because I didn't gave arguments to my QProces Firefox.
    If we don't give an argument (the URL to be opened), Firefox open a new window instead of opening a new tab in the current window.


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.