1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
| Evénement("DeviceNotification", "FEN_main", WM_DEVICECHANGE)
DEV_BROADCAST_HDR est Structure
dbch_size est un entier sans signe sur 4 octets
dbch_devicetype est un entier sans signe sur 4 octets
dbch_reserved est un entier sans signe sur 4 octets
FIN
DEV_BROADCAST_VOLUME est Structure
dbch_size est un entier sans signe sur 4 octets
dbch_devicetype est un entier sans signe sur 4 octets
dbch_reserved est un entier sans signe sur 4 octets
dbcv_unitmask est un entier sans signe sur 4 octets
dbcv_flags est un entier sans signe sur 2 octets
FIN
nRet est entier = 0
// On bloque la popup de notification d'insertion Windows
// qui demande ce qu'on veut faire du CD/DVD
SI wMsg = WM_QUERYCANCELAUTOPLAY ALORS
nRet = 1
SINON // On gère l'insertion et la suppression d'un device
SI wParam = DBT_DEVICEREMOVECOMPLETE OU wParam = DBT_DEVICEARRIVAL ALORS
SI lParam ALORS
stDevHDR est DEV_BROADCAST_HDR
Transfert(&stDevHDR, lParam, Dimension(stDevHDR))
SI stDevHDR:dbch_devicetype = DBT_DEVTYP_VOLUME ALORS
stDevVOL est DEV_BROADCAST_VOLUME
Transfert(&stDevVOL, lParam, Dimension(stDevVOL))
sDrive est chaîne = BFF_DEVICE_DRIVE(stDevVOL:dbcv_unitmask)
// StockageAmovibleRetiré
// ----------------------
SI wParam = DBT_DEVICEREMOVECOMPLETE ALORS
//rouge
FEN_main.BTN_USB..ImageFond = "USB_BLACK_90.PNG"
// StockageAmovibleInséré
// ----------------------
SINON SI wParam = DBT_DEVICEARRIVAL
sNomVolume est une chaîne
sNomVolume =fDisqueInfo(sDrive,fdNomVolume)
SI sNomVolume = "MERLIN" ALORS
//vert
FEN_main.ONG_choix=1
SI ThreadEtat("5") = threadInexistant ALORS ThreadExécute("5",threadNormal,ExploreMerlin)
SINON
//jaune
FEN_main.BTN_USB..ImageFond = "USB_YELLOW_90.PNG"
writeerror(sDrive+ESP+"is a removable drive but does not bear the name MERLIN")
FIN
FIN
FIN
FIN
FIN
FIN
RENVOYER nRet |
Partager