CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9

Thread: start hidden

  1. #1
    Join Date
    Aug 2008
    Posts
    373

    start hidden

    I have a dialog-based app which runs loads at windows startup, but problem is i don't want to showing up this dialog at every startup so i need it to start hidden.Plz help me

  2. #2
    Join Date
    May 2006
    Location
    Dresden, Germany
    Posts
    458

    Re: start hidden

    There are many possibilities for doing that.

    What exactly do you want to do?

    Launching an app with putting it in the autostart folder gives you the possibilty to start it minimized (use "properties" context menu entry). But I'm not sure if this works for dialog based apps (which are not intended for running without the (modal) dialog shown).

    So you can use a non-dlg app.

    Maybe you can run a GUI-less message loop before the modal dialog is called (it's usually inside the InitApplication method of your app).

    With regards
    Programartist

  3. #3
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

  4. #4
    Join Date
    Aug 2008
    Posts
    373

    Re: start hidden

    Quote Originally Posted by laitinen View Post
    Have a look here: How to start your dialog application in hidden mode?

    Cheers,

    Laitinen
    Thanks laitinen

    i am useing you example it's hide application.But when i start through desktop exe then i want to show application .Plz help me

  5. #5
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

    Re: start hidden

    What do you mean? If you start it from the desktop you want it to be visible? You might add command line arguments to your app, and use them when starting from desktop. Search for command line arguments.

  6. #6
    Join Date
    May 2006
    Location
    beyond the pillars of hercules
    Posts
    295

    Re: start hidden

    make ur app accepts command line
    when u set up the registry entry to start the app on startup , add a command line on the
    registry key

  7. #7
    Join Date
    Aug 2008
    Posts
    373

    Re: start hidden

    Quote Originally Posted by Cpp_Noob View Post
    make ur app accepts command line
    when u set up the registry entry to start the app on startup , add a command line on the
    registry key
    Can any one give me command line example for dialog application.Plz help me

  8. #8
    Join Date
    Dec 2008
    Posts
    144

    Re: start hidden

    Quote Originally Posted by Msm View Post
    Can any one give me command line example for dialog application.Plz help me
    Code:
    BOOL CMyApp::InitInstance()
    {
       // ...
      
       if (m_lpCmdLine[0] == _T('\0'))
       {
          // Create a new (empty) document.
          OnFileNew();
       }
       else
       {
          // Open a file passed as the first command line parameter.
          OpenDocumentFile(m_lpCmdLine);
       }
      
       // ...
    }

  9. #9
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured