La Web del Programador: Comunidad de Programadores
 
    Pregunta:  495 - COMO CORRER UNA APLICACIÓN EN BACKGROUND
Autor:  Luis Alberto Lujan
Necesito saber como se hace para ejecutar una aplicacion sin que aparesca en la barra de tareas ya que en delphi 2 solo hay tres tipos de ventana MDIChild MDIFrmMain StayOntop y La normal
Como le puedo hacer ???
Me han dicho que se hace con la libreria shell32.dll con la funcion CreateNotifyICON pero la he tratado de utilizar y me da errores ....

Me podrian ayudar ??? :)


  Respuesta:  Ricardo Scheel
Intenta con :
procedure TForm1.Button1Click(Sender: TObject);
begin
showwindow(application.handle,sw_hide);
showwindow(self.handle,sw_hide);
end;
O puedes probar con esto que hace invisible tu aplicacion a Ctrl+Alt+Del :
program nohupctl;

uses Windows;

{ $R *.RES}

const RSP_SIMPLE_SERVICE = $00000001;

function RegisterServiceProcess(dwProcessId, dwType : DWORD) : DWORD; stdcall; external ´KERNEL32.DLL´;

var SI: TStartupInfo;
PI: TProcessInformation;
LinhaComando : string;

begin
LinhaComando := ´C:\WINDOWS\CALC.EXE´;
With SI Do Begin
cb := SizeOf(SI);
lpReserved := nil;
lpTitle := nil;
wShowWindow := SW_SHOW; {replace with SH_HIDE if desired }
dwFlags := STARTF_USESHOWWINDOW;
cbReserved2 := 0;
lpReserved2 := nil;
End;
CreateProcess(nil, @LinhaComando[1], Nil, Nil, False, 0, Nil, Nil, SI, PI);
RegisterServiceProcess(PI.dwProcessId,RSP_SIMPLE_SERVICE);
end.

ojala te ayude !!