Thread: Start a new program with your program.

  1. #1
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90

    Start a new program with your program.

    I got 2 .exe files and want to start the other program with the first file.
    I've got it working with:
    Code:
    system("blablabla.exe");
    But that kinda builds in the the program to the first one.

    Like if both programs are like this:
    1: Print "lol"
    2: Print "omfg"

    So when I start the first program, it prints" lol", then it opens program 2 and prints "omfg" in the same DOS window as "lol".

    If you understand what I mean. :P
    I want it to be 2 windows running alone.

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Then each process/program will need to create its own window for output.

    Someone else should be able to help with that.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    is this what you are looking for?

    Code:
    system("start blablabla.exe");

  4. #4
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90
    Rocky, that works but it exits the first window.
    I want to keep the first program still running.

    nvm, im stupid...
    fixed it.
    Last edited by XunTric; 10-04-2005 at 06:35 AM.

  5. #5
    Unregistered User
    Join Date
    Sep 2005
    Location
    Antarctica
    Posts
    341
    oh, you may want to use CreateProcess then, and call WaitForSingleObject on the executed process handles.

  6. #6
    Pawn, Pascal and C++
    Join Date
    Sep 2005
    Posts
    90
    Quote Originally Posted by XunTric
    nvm, im stupid...
    fixed it.
    Thanks anyway!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to make my program run on windows start up
    By kantze in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 03-24-2007, 11:14 AM
  2. How to start program from subfolder
    By trancedeejay in forum C Programming
    Replies: 2
    Last Post: 04-01-2006, 03:39 PM
  3. Start up program
    By Breetai in forum Windows Programming
    Replies: 2
    Last Post: 01-11-2003, 01:12 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  5. Start a program
    By FunkeeMunkee in forum C++ Programming
    Replies: 1
    Last Post: 08-26-2001, 07:18 PM