Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/01/2009, 17:27
Trulala de cordoba
 
Fecha de Ingreso: octubre-2000
Mensajes: 1.692
Antigüedad: 23 años, 6 meses
Puntos: 19
Respuesta: c#: dejar un ejecutable corriendo oculto

Hola.
Por ahí lo que te hubiere convenido para esto es hacer una aplicacion con un winForms, pero bueno, tendras a lo mejor otros motivos.

Bueno, aca te muestro un código que encontré y lo que hace oculta y muestra la ventana.

Te paso el codigo completo:

Código PHP:
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Runtime.InteropServices;

namespace ConsoleApplication1
{
    class 
Program
    
{
        [
DllImport("user32.dll")]
public static 
extern int ShowWindow(int Handleint showState);
[
DllImport("kernel32.dll")]
public static 
extern int GetConsoleWindow();
// constants
const int SW_SHOWNORMAL 1;
const 
int SW_HIDE 0;
        static 
void Main(string[] args)
        {

int win GetConsoleWindow();
ShowWindow(winSW_HIDE);
System.Threading.Thread.Sleep(3000);
ShowWindow(winSW_SHOWNORMAL);

        }
    } 
__________________
PD: Con amor, fe, amor a Dios y amistad podemos hacer un mundo mejor!!!!