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. Create Process in background

Create Process in background

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
6 Posts 3 Posters 0 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.
  • K Offline
    K Offline
    krishnakumartm
    wrote on last edited by
    #1

    Hi, I need to run a process without showing to user, in background, The application is not a MFC it is normal command window application. I tried the way like settinf the STARTUPINFO like SW_HIDE. But this is not working. Can someone help me. Thanks,

    ---------------------------- KRISHNA KUMAR T M

    U N 2 Replies Last reply
    0
    • K krishnakumartm

      Hi, I need to run a process without showing to user, in background, The application is not a MFC it is normal command window application. I tried the way like settinf the STARTUPINFO like SW_HIDE. But this is not working. Can someone help me. Thanks,

      ---------------------------- KRISHNA KUMAR T M

      U Offline
      U Offline
      Uwe Keim
      wrote on last edited by
      #2

      As far as I know, a Console application always shows the console. Try creating a windows application and hide the main window.

      • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

      K 1 Reply Last reply
      0
      • U Uwe Keim

        As far as I know, a Console application always shows the console. Try creating a windows application and hide the main window.

        • My personal 24/7 webcam • Zeta Test - Intuitive, competitive Test Management environment for Test Plans and Test Cases. Download now! • Zeta Producer Desktop CMS - Intuitive, very easy to use. Download now!

        K Offline
        K Offline
        krishnakumartm
        wrote on last edited by
        #3

        Why it is like that, is there any other way to hide the console.

        ---------------------------- KRISHNA KUMAR T M

        K 1 Reply Last reply
        0
        • K krishnakumartm

          Why it is like that, is there any other way to hide the console.

          ---------------------------- KRISHNA KUMAR T M

          K Offline
          K Offline
          krishnakumartm
          wrote on last edited by
          #4

          Hey i got it we can hide the cosole application also. we have to fill the STARTINFO structure correctly like STARTUPINFO si; ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); //set the flags to tell application to use the startup info si.dwFlags = STARTF_USESHOWWINDOW; //set the window hide options. si.wShowWindow = SW_HIDE; Refere the link Running console applications silently

          ---------------------------- KRISHNA KUMAR T M

          1 Reply Last reply
          0
          • K krishnakumartm

            Hi, I need to run a process without showing to user, in background, The application is not a MFC it is normal command window application. I tried the way like settinf the STARTUPINFO like SW_HIDE. But this is not working. Can someone help me. Thanks,

            ---------------------------- KRISHNA KUMAR T M

            N Offline
            N Offline
            norish
            wrote on last edited by
            #5

            This code can hide console window on my system (xp sp3).

            STARTUPINFO si;
            PROCESS\_INFORMATION pi;
            ZeroMemory(&si, sizeof(si));
            si.cb = sizeof(si);
            si.dwFlags	= STARTF\_USESHOWWINDOW;
            si.wShowWindow	= SW\_HIDE;
            if (CreateProcess(NULL, \_T("cmd.exe"), NULL, NULL, FALSE, 0, 
                    NULL, NULL, &si, &pi)) {
            	WaitForSingleObject(pi.hProcess, INFINITE);
            	CloseHandle(pi.hThread);
            	CloseHandle(pi.hProcess);
            }
            
            K 1 Reply Last reply
            0
            • N norish

              This code can hide console window on my system (xp sp3).

              STARTUPINFO si;
              PROCESS\_INFORMATION pi;
              ZeroMemory(&si, sizeof(si));
              si.cb = sizeof(si);
              si.dwFlags	= STARTF\_USESHOWWINDOW;
              si.wShowWindow	= SW\_HIDE;
              if (CreateProcess(NULL, \_T("cmd.exe"), NULL, NULL, FALSE, 0, 
                      NULL, NULL, &si, &pi)) {
              	WaitForSingleObject(pi.hProcess, INFINITE);
              	CloseHandle(pi.hThread);
              	CloseHandle(pi.hProcess);
              }
              
              K Offline
              K Offline
              krishnakumartm
              wrote on last edited by
              #6

              Ya i got it. Thanks for your response. Thanks,

              ---------------------------- KRISHNA KUMAR T M

              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