title: Launch a terminal program but have it continue to run once terminal is closed - Lazarus or Delphi
body: <p><strong>Pre-amble:</strong> I use Lazarus 1.2.6 and Freepascal 2.6.4 on Windows 7 and my solution must be based on that - not C or C++. I could use Delphi though, if something similar exists for that. </p>
  
  <p><strong>Problem:</strong> I wish to create a small program that is ideally launched from the command line, but then just runs in the background without the need for the console application to be open visibly.  </p>
  
  <p>I'm trying to work out how best to achieve it. </p>
  
  <p>I read <a href="https://stackoverflow.com/questions/13042036/how-do-i-hide-the-console-window">this link</a> and <a href="https://stackoverflow.com/questions/13056642/delphi-hide-console-window">this link</a> and <a href="https://stackoverflow.com/questions/9036802/is-it-possible-to-run-a-program-from-terminal-and-have-it-continue-to-run-after">this C based example</a> and <a href="https://stackoverflow.com/questions/8983746/how-can-i-run-my-application-even-when-the-terminal-is-closed">this Linux example</a> but as one user points out "if you don't want a console application, don't make one", which begs the question of what are the other ways? If you don't want a GUI, and you don't want a console, I assume there's another way to create a silent program, then launch it, and then just have it run in the background? Preseumbly as a service or some such? </p>
  
  <p>Or, the other way that occured to me is to create a Library (which generates a DLL when compiled of course) that contains my programs functions, export those functions at the end of the DLL, then call them from a seperate terminal application which, I assume, I could then close but the functions that are called from the DLL might continue to run? In other words - two programs - one terminal program to launch the other non-visible program and then close the launching program? Is that possible or recommended?  </p>