Le fichier DriveTools est necessaire. Je ne possede pas le fichier PAS.
Télécharger le zip
J'ai trouver la source: ---->// ____ _ ______ __// / __ \_____(_) _____/_ __/___ ____ / /____// / / / / ___/ / | / / _ / / / __ / __ / / ___/// / /_/ / / / /| |/ / __/ / / /_/ / /_/ / (__ )// /_____/_/ /_/ |___/\___/_/ \____/\____/_/____///(******************************************************************************** DriveTools 1.0 ** ** (c) 1999 Jan Peter Stotz ** ********************************************************************************** ** If you find bugs, has ideas for missing featurs, feel free to contact me ** jpstotz@gmx.de ** ********************************************************************************** Date last modified: May 22, 1999 ********************************************************************************)unit DriveTools;interfaceuses Windows, SysUtils, MMSystem;function CloseCD(Drive : Char) : Boolean;function OpenCD(Drive : Char) : Boolean;implementationfunction OpenCD(Drive : Char) : Boolean;Var Res : MciError; OpenParm: TMCI_Open_Parms; Flags : DWord; S : String; DeviceID : Word;begin Result:=false; S:=Drive+':'; Flags:=mci_Open_Type or mci_Open_Element; With OpenParm do begin dwCallback := 0; lpstrDeviceType := 'CDAudio'; lpstrElementName := PChar(S); end; Res := mciSendCommand(0, mci_Open, Flags, Longint(@OpenParm)); IF Res<>0 Then exit; DeviceID:=OpenParm.wDeviceID; try Res:=mciSendCommand(DeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0); IF Res=0 Then exit; Result:=True; finally mciSendCommand(DeviceID, mci_Close, Flags, Longint(@OpenParm)); end; end;function CloseCD(Drive : Char) : Boolean;Var Res : MciError; OpenParm: TMCI_Open_Parms; Flags : DWord; S : String; DeviceID : Word;begin Result:=false; S:=Drive+':'; Flags:=mci_Open_Type or mci_Open_Element; With OpenParm do begin dwCallback := 0; lpstrDeviceType := 'CDAudio'; lpstrElementName := PChar(S); end; Res := mciSendCommand(0, mci_Open, Flags, Longint(@OpenParm)); IF Res<>0 Then exit; DeviceID:=OpenParm.wDeviceID; try Res:=mciSendCommand(DeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0); IF Res=0 Then exit; Result:=True; finally mciSendCommand(DeviceID, mci_Close, Flags, Longint(@OpenParm)); end; end;end.
Super génial!!!Un grand merci à toi Pag! ;)Babaille.
sinon avec une unit qu'on possede déjà => http://www.passiondelphi.net/astuce.php?PHPSESSID=&action=Show&id=25&categorie=System
Génial.J'ai essayé les 2 autres sources mais aucune ne fonctionne sous WXP ou W 98. Par contre celle-ci fonctionne bien.
Ah enfin ...Bien joué Pag pour avoir trouvé la source de l'unit DriveTools, je la cherchais depuis un moment.Vous ferez attention si vous l'utilisez, il faut remplacer certains caractères dûs au navigateur.Pour exemple:IF Res<>0 Then exit;En clair, c'est Si Res supérieur à 0. C'est sûrement pour celà que slachz n'a pas réussi à le faire fonctionner.
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte
1 623 751 membres 63 nouveaux aujourd'hui 15 511 membres club