private void InicializarFormulario()
        {
            try
            {
                int Conf = Config.ObtenerTipoConfiguracion();
                ConfiguracionSeleccionada = Conf == 0 ? 2 : Conf;
                SeleccionarConfiguracion();

                if (ConfiguracionSeleccionada == 1)
                {
                    Txt_Nombre.Text = Config.ObtenerNombreServidor();
                }

                InterfazNet Net = new InterfazNet();
                Net.BuscarEquiposEnRed().Cast <string>().ToList()
                .FindAll(E => E != NombreEquipo)
                .ForEach(E => Cmb_Equipos.Items.Add(E));

                HWND_TaskBar    = ExtensionesCOM.FindWindow("Shell_TrayWnd", null);
                HWND_Inicio     = ExtensionesCOM.FindWindow("BUTTON", null);
                HWND_TrayNotify = ExtensionesCOM.FindWindowEx(HWND_TaskBar, 0, "TrayNotifyWnd", null);
                HWND_Iconos     = ExtensionesCOM.FindWindowEx(HWND_TrayNotify, 0, "Syspager", null);
                HWND_Reloj      = ExtensionesCOM.FindWindowEx(HWND_TrayNotify, 0, "TrayClockWClass", null);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        public StringBuilder GetUserName()
        {
            StringBuilder b  = new StringBuilder(100);
            int           n  = b.Capacity;
            bool          rc = ExtensionesCOM.GetUserName(b, ref n);

            return(b);
        }
 private void Btn_Desconectar_Click(object sender, EventArgs e)
 {
     ExtensionesCOM.ShowWindow(HWND_TaskBar, Mostrar);
     ExtensionesCOM.ShowWindow(HWND_Iconos, Mostrar);
     ExtensionesCOM.ShowWindow(HWND_Inicio, Mostrar);
     ExtensionesCOM.ShowWindow(HWND_TrayNotify, Mostrar);
     ExtensionesCOM.ShowWindow(HWND_Reloj, Mostrar);
     Frm_Principal.PuedeCerrar = true;
     Application.Exit();
 }