Jump to content

Reader CD-ROM


 Share

Recommended Posts

Welcome !

This software to control Reader CD-ROM

Posted Image

#include <GUIConstants.au3>
#NoTrayIcon;==============================================> Pour Cacher l'icon

;~ =========================================================

RegWrite("HKEY_CLASSES_ROOT\Drive\shell\Ouvrir et Fermer CD-ROM\command","","REG_SZ","C:\Windows\System32\cdrom.exe");=========> Pour ajouter l'application dans la base de registre

;~ =========================================================

MsgBox(64,"Bienvenue .....!","created By B.Hocine GHOST SKIKDA");=====================> Pour afficher message

;~ =========================================================
If FileExists(@SystemDir & "cdrom.exe") Then
   #Region ### START Koda GUI section ### 
 $Form1_1 = GUICreate("Ouvrir & Fermer Lecteur CD", 287, 163, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,

$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetBkColor(0x7EE2ED)
 $Group1 = GUICtrlCreateGroup("", 8, 3, 273, 153)
    $Combo1 = GUICtrlCreateCombo(" Choirir le nom de lecture ", 72, 43, 145, 25,$CBS_DROPDOWNLIST)
    GUICtrlSetData(-1, "D:|E:|F:|G:|H:|I:|J:|K:|L:|M:|N:|O:|P:|Q:|R:|S:|T:|U:|V:|W:|X:|Y:|Z:")
    GUICtrlSetCursor (-1, 1)
    $Button1 = GUICtrlCreateButton("&Ouvrir", 25, 99, 65, 25)
    GUICtrlSetCursor (-1, 0)
    $Button2 = GUICtrlCreateButton("&Fermer", 112, 99, 65, 25)
    GUICtrlSetCursor (-1, 0)
    $Apropos = GUICtrlCreateButton("&A propos", 194, 99, 75, 25, 0)
 GUICtrlSetCursor (-1, 4)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
Else
    FileMove(".\cdrom.exe", @SystemDir);==================> Déplacer l'application 
    #Region ### START Koda GUI section ### 
    $Form1_1 = GUICreate("Ouvrir & Fermer Lecteur CD", 287, 163, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,

$WS_BORDER,$WS_CLIPSIBLINGS))
    GUISetBkColor(0x7EE2ED)
    $Group1 = GUICtrlCreateGroup("", 8, 3, 273, 153)
    $Combo1 = GUICtrlCreateCombo(" Choirir le nom de lecture ", 72, 43, 145, 25,$CBS_DROPDOWNLIST)
    GUICtrlSetData(-1, "D:|E:|F:|G:|H:|I:|J:|K:|L:|M:|N:|O:|P:|Q:|R:|S:|T:|U:|V:|W:|X:|Y:|Z:")
    GUICtrlSetCursor (-1, 1)
    $Button1 = GUICtrlCreateButton("&Ouvrir", 25, 99, 65, 25)
    GUICtrlSetCursor (-1, 0)
    $Button2 = GUICtrlCreateButton("&Fermer", 112, 99, 65, 25)
    GUICtrlSetCursor (-1, 0)
    $Apropos = GUICtrlCreateButton("&A propos", 194, 99, 75, 25, 0)
 GUICtrlSetCursor (-1, 4)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState()
    #EndRegion ### END Koda GUI section ###
EndIf

;========================================

While 1
 $nMsg = GUIGetMsg()
 Switch $nMsg
  Case $GUI_EVENT_CLOSE
   GUISetState(@SW_HIDE);=====================> Pour Cacher l'application
   MsgBox(64,"Merci .....!","Bye Bye, http://www.autoitscript.com")
   Exit;==================================> Pour Fermer l'application
  Case $Button1
   $read = GUICtrlRead($Combo1)
   CDTray($read,"open");======================> pour Ouvrir lecture CD-Rom
  Case $Button2 
   $read = GUICtrlRead($Combo1)
   CDTray($read,"closed");====================> pour Fermer lecture CD-Rom
  Case $Apropos
   GUISetState(@SW_HIDE);========> Pour Cacher l'application
   MsgBox(64,"A propos .....","Created By: B.Hocine GHOST SKIKDA: hocin_2000fr@hotmail.com")
   GUISetState(@SW_SHOW);=======> Pour Afficher l'application
 EndSwitch
WEnd

:)

Edited by ALG
[center]I LOVE ALGERIA .... ;-)[/center]
Link to comment
Share on other sites

Hi,

Suggestions:

Make the Reg entry for run Optional, just because a user tries your script does not mean they want things written to their registry.

Instead of listing D: to Z: for drives to choose from maybe use DriveGetDrive("CDROM") and populate the combo with the return, then a user can only select an actual cd drive that's in their pc.

Cheers

Link to comment
Share on other sites

  • 1 month later...

Could someone please explain what this does? I'm an ignorant American who can't speak whatever language that is.

[center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...