示例#1
0
        public StringBuilder GetUserName()
        {
            StringBuilder b  = new StringBuilder(100);
            int           n  = b.Capacity;
            bool          rc = ExtensionesCOM.GetUserName(b, ref n);

            return(b);
        }
示例#2
0
 private void MostrarEnsamblados(int Mostrar)
 {
     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);
 }
示例#3
0
        private void InicializarCliente()
        {
            try
            {
                Cliente.TCP = new TcpClient();
                if (string.IsNullOrEmpty(Config.ObtenerNombreServidor()))
                {
                    ConfigurarServidor();
                }
                else
                {
                    BuscarIp();
                }

                Tmr_Conexion.Enabled = true;
                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)
            {
                if (ex.Message == "Host desconocido")
                {
                    if (MessageBox.Show("No se encontró el servidor configurado para el cliente, Desea Configurarlo?",
                                        "Error En Configuracion", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        ConfigurarServidor();
                        InicializarCliente();
                    }
                    else
                    {
                        MessageBox.Show("Se cerrará la aplicación debido a que no encuentra conexión al servidor.");
                        PuedeCerrar = true;
                        Application.Exit();
                    }
                }
                else
                {
                    throw ex;
                }
            }
        }
示例#4
0
 private void Tmr_Bloquear_Tick(object sender, EventArgs e)
 {
     ExtensionesCOM.SetCursorPos(0, 0);
     this.Activate();
     this.SetTopLevel(true);
 }
示例#5
0
 private void ApagarEquipo()
 {
     ExtensionesCOM.Apagar();
 }