Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how can i hide console from the user when using _popen()

how can i hide console from the user when using _popen()

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mitil20390482304
    wrote on last edited by
    #1

    Hi I am using _popen to execute an exe file and read back the result in to a text file and analyze it. but from the time that user clicks the button the console window appears on the screen and goes away when the process is finished. how can i hide the console window from the user and show something like work in progress instead. is there a way to hide _popen ? char Buffer[9]; string commandline="address"; FILE *fp; if ( (fp= _popen(commandline.c_str(),"r"))==NULL) exit(1); fgets( Buffer, 9, fp );

    D 1 Reply Last reply
    0
    • M mitil20390482304

      Hi I am using _popen to execute an exe file and read back the result in to a text file and analyze it. but from the time that user clicks the button the console window appears on the screen and goes away when the process is finished. how can i hide the console window from the user and show something like work in progress instead. is there a way to hide _popen ? char Buffer[9]; string commandline="address"; FILE *fp; if ( (fp= _popen(commandline.c_str(),"r"))==NULL) exit(1); fgets( Buffer, 9, fp );

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      mitil20390482304 wrote:

      I am using _popen to execute an exe file...

      To create a Windows application that redirects input and output, read the section "Creating a Child Process with Redirected Input and Output" in the Win32 SDK. See here and here.


      "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

      "Judge not by the eye but by the heart." - Native American Proverb

      M 1 Reply Last reply
      0
      • D David Crow

        mitil20390482304 wrote:

        I am using _popen to execute an exe file...

        To create a Windows application that redirects input and output, read the section "Creating a Child Process with Redirected Input and Output" in the Win32 SDK. See here and here.


        "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

        "Judge not by the eye but by the heart." - Native American Proverb

        M Offline
        M Offline
        mitil20390482304
        wrote on last edited by
        #3

        thanks man..i have already read those,,,and I have a really hard time undrestanding how i can use it in my case...can you help me some more...how can i run my _popen inside a process that has a hiden window?

        M 1 Reply Last reply
        0
        • M mitil20390482304

          thanks man..i have already read those,,,and I have a really hard time undrestanding how i can use it in my case...can you help me some more...how can i run my _popen inside a process that has a hiden window?

          M Offline
          M Offline
          mitil20390482304
          wrote on last edited by
          #4

          yoho...i found the answer myself check this out if you have the same problem as i do http://www.codeproject.com/win32/runsilent.asp[^] use the runsilent function that this guy is using in your own program...it is great

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups