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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Win32 application with out an UI.

Win32 application with out an UI.

Scheduled Pinned Locked Moved C / C++ / MFC
designhelptutorial
13 Posts 6 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.
  • R Rajesh R Subramanian

    Why do you need such a thing? Why can't the 'another application' be launched directly instead? There are valid reasons, but I want to know what's your case.

    It is a crappy thing, but it's life -^ Carlo Pallini

    B Offline
    B Offline
    birajendu
    wrote on last edited by
    #3

    I am lunching the 2nd application with some specific command line options, that is why i need this 1st appliaction.

    birajendu CyberG India Delhi India

    R 1 Reply Last reply
    0
    • B birajendu

      Hi, I want a simple application which will only launch another application. But I dont want to show the cosole or any UI for the 1st application. can any one help me how to do so.

      birajendu CyberG India Delhi India

      N Offline
      N Offline
      Naveen
      wrote on last edited by
      #4

      Create a "Win32 Application" project. it won,t be having any GUI or console by default.

      nave [OpenedFileFinder] [My Blog]

      1 Reply Last reply
      0
      • B birajendu

        I am lunching the 2nd application with some specific command line options, that is why i need this 1st appliaction.

        birajendu CyberG India Delhi India

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #5

        I'm just curious before I can give you an answer, why can you not just launch the second application with command lines already? Why the extra 'launcher' application?

        It is a crappy thing, but it's life -^ Carlo Pallini

        B 1 Reply Last reply
        0
        • R Rajesh R Subramanian

          I'm just curious before I can give you an answer, why can you not just launch the second application with command lines already? Why the extra 'launcher' application?

          It is a crappy thing, but it's life -^ Carlo Pallini

          B Offline
          B Offline
          birajendu
          wrote on last edited by
          #6

          The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)

          birajendu CyberG India Delhi India

          X R D 3 Replies Last reply
          0
          • B birajendu

            Hi, I want a simple application which will only launch another application. But I dont want to show the cosole or any UI for the 1st application. can any one help me how to do so.

            birajendu CyberG India Delhi India

            M Offline
            M Offline
            Michael Schubert
            wrote on last edited by
            #7

            Something like this maybe:

            #include <windows.h>
            #include <shellapi.h>

            int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
            {
            SHELLEXECUTEINFO ShExecInfo;
            ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
            ShExecInfo.fMask = NULL;
            ShExecInfo.hwnd = NULL;
            ShExecInfo.lpVerb = NULL;
            ShExecInfo.lpFile = "program.exe";
            ShExecInfo.lpParameters = "-switch1 -switch2";
            ShExecInfo.lpDirectory = "c:\\yourpath";
            ShExecInfo.nShow = SW_HIDE;
            ShExecInfo.hInstApp = NULL;

            ShellExecuteEx(&ShExecInfo);

            return 0;
            }

            B 1 Reply Last reply
            0
            • B birajendu

              The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)

              birajendu CyberG India Delhi India

              X Offline
              X Offline
              Xing Chen
              wrote on last edited by
              #8

              why not create a shortcut for your customer?

              1 Reply Last reply
              0
              • B birajendu

                The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)

                birajendu CyberG India Delhi India

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #9

                You could do something like this:

                #include <windows.h>
                #include <tchar.h>

                int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPTSTR lpCmdLine, int nCmdShow)
                {
                CreateProcess[^]
                return false;
                }

                You might as well use ShellExecute or ShellExecuteEx, like Michael Schubert suggested.

                It is a crappy thing, but it's life -^ Carlo Pallini

                1 Reply Last reply
                0
                • M Michael Schubert

                  Something like this maybe:

                  #include <windows.h>
                  #include <shellapi.h>

                  int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
                  {
                  SHELLEXECUTEINFO ShExecInfo;
                  ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
                  ShExecInfo.fMask = NULL;
                  ShExecInfo.hwnd = NULL;
                  ShExecInfo.lpVerb = NULL;
                  ShExecInfo.lpFile = "program.exe";
                  ShExecInfo.lpParameters = "-switch1 -switch2";
                  ShExecInfo.lpDirectory = "c:\\yourpath";
                  ShExecInfo.nShow = SW_HIDE;
                  ShExecInfo.hInstApp = NULL;

                  ShellExecuteEx(&ShExecInfo);

                  return 0;
                  }

                  B Offline
                  B Offline
                  birajendu
                  wrote on last edited by
                  #10

                  Thanks, I tried this and also CreateProcess(), but my problem is i dont want the console window of the parent application. I am creating a win 32 project in visual studio 2005.

                  birajendu CyberG India Delhi India

                  M R 2 Replies Last reply
                  0
                  • B birajendu

                    Thanks, I tried this and also CreateProcess(), but my problem is i dont want the console window of the parent application. I am creating a win 32 project in visual studio 2005.

                    birajendu CyberG India Delhi India

                    M Offline
                    M Offline
                    Michael Schubert
                    wrote on last edited by
                    #11

                    The code I supplied (same for Rajesh's suggestion) doesn't create any window, neither console nor GUI.

                    1 Reply Last reply
                    0
                    • B birajendu

                      Thanks, I tried this and also CreateProcess(), but my problem is i dont want the console window of the parent application. I am creating a win 32 project in visual studio 2005.

                      birajendu CyberG India Delhi India

                      R Offline
                      R Offline
                      Rajesh R Subramanian
                      wrote on last edited by
                      #12

                      I don't see how can you see a window when the code creates none... You have probably created a Win32 console application. You need to create a Win32 application instead.

                      It is a crappy thing, but it's life -^ Carlo Pallini

                      1 Reply Last reply
                      0
                      • B birajendu

                        The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)

                        birajendu CyberG India Delhi India

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

                        So why not just change the shortcut to include the necessary arguments?

                        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                        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