FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#7
|
|||
|
|||
Hola:
Intenté hacerlo con esta función pero no me funciona. Código:
procedure Abriendo; begin Label_Mensaje.Caption := 'Abriendo...'; end; Código:
unit Lector_bandeja; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls, MMSystem; // No olvidar añadir en uses MMSystem arriba. procedure Abriendo; begin Label_Mensaje.Caption := 'Abriendo...'; end; type TForm1 = class(TForm) RadioGroup_Bandeja: TRadioGroup; Button_Abrir: TButton; Button_Cerrar: TButton; Label_Mensaje: TLabel; procedure Button_AbrirClick(Sender: TObject); procedure Button_CerrarClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure OpenCd(AOpen:Boolean); const DoPlay : array[Boolean] of string = ('Set cdaudio door closed wait', 'Set cdaudio door open wait'); var MyError : LongInt; MyErrorString : array[0..MAXERRORLENGTH - 1] of char; begin MyError := mciSendString(pChar(DoPlay[AOpen]), nil, 0, 0); if MyError <> 0 then begin MciGetErrorString(MyError,MyErrorString,MAXERRORLENGTH - 1); Showmessage(MyErrorString); Exit; end; end; procedure TForm1.Button_AbrirClick(Sender: TObject); begin //Abriendo; OpenCd(TRUE); Label_Mensaje.Caption := 'Abierto.'; end; procedure TForm1.Button_CerrarClick(Sender: TObject); begin Label_Mensaje.Caption := 'Cerrando...'; OpenCd(FALSE); Label_Mensaje.Caption := 'Cerrado.'; end; end. Saludos. Edito: Te acabo de leer. El método o forma que hiciste, no funciona. Ejecuta pero no funciona. Código:
Label_Mensaje.Caption := 'Abriendo...'; Sleep(1000); OpenCd(TRUE); Label_Mensaje.Caption := 'Abierto.'; Saludos.
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino. Última edición por REHome fecha: 16-11-2017 a las 10:32:48. |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Expulsar la bandeja de CD | paldave | Varios | 5 | 01-09-2007 14:59:05 |
nombre de una bandeja | Lucciano | Impresión | 0 | 31-05-2007 23:34:34 |
Mi Aplicacion en la bandeja del Control Panel | Irma | API de Windows | 2 | 08-02-2007 18:52:21 |
Reportes - Seleccionar bandeja | alapaco | Impresión | 0 | 01-09-2006 22:51:08 |
Cerrar bandeja CDs | JMGR | Varios | 6 | 27-07-2003 14:52:12 |
|