C sharp - Lanzar ventana tipo CONSOLA minimizado.

 
Vista:
sin imagen de perfil

Lanzar ventana tipo CONSOLA minimizado.

Publicado por Hubert (7 intervenciones) el 23/02/2017 01:08:28
Este código de abajo lanza un ejecutable tipo consola el cual me muestra en un MessageBox su nombre del ejecutable.
Si renombran el ejecutable y vuelven a ejecutar, muestra en el Mensaje el nombre del ejecutable renombrado (esta bien).
Ahora, ya intenté y no logro que solo se muestre el mensaje con la descripción del ejecutable y la pantalla del DOS se lance "minimizado", y luego de presionar el botón se cierre (necesito que sea ligero el ejecutable).


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using System;
using System.Runtime.InteropServices;
using System.Reflection;
using System.IO;
namespace Lanzador
{
    public class Program
    {
        [DllImport("User32.dll", CharSet = CharSet.Unicode)]
        public static extern int MessageBox(IntPtr h, string m, string c, int type);
        public static void Main(string[] args)
        {
            Console.WriteLine("Necesito que esta ventana NEGRA se lance MINIMIZADO.");
            Console.WriteLine("Necesito que esta ventana NEGRA se lance MINIMIZADA.");
            string fullName = Assembly.GetEntryAssembly().Location;
            string myName = Path.GetFileNameWithoutExtension(fullName);
            MessageBox((IntPtr)0, "MI NOMBRE DE EJECUTABLE ES: [" + myName+"]", "MI NOMBRE DE EJECUTABLE", 0);
        }
    }
}

Gracias.
Hubert
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder