Detect Pendrives connected

HMG Samples and Enhancements

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Detect Pendrives connected

Post by Pablo César »

Hi colleagues !

For long time I wish to develop a app which shows only pendrives units for backups and others proposes, and I make it with help with divers helps examples codes of others colleagues. I hope all you enjoy it !
Attachments
PenDrive.rar
(691.83 KiB) Downloaded 607 times
Last edited by Pablo César on Sun Nov 20, 2011 1:10 pm, edited 1 time in total.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
Rathinagiri
Posts: 5351
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 212 times
Been thanked: 233 times
Contact:

Post by Rathinagiri »

Very useful. Thanks a lot!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil
Has thanked: 100 times
Been thanked: 182 times

Post by Pablo César »

You are wellcome Mr. Rathinagiri, I am very happy and very very gratefully using HMG. Thank you too for all your efforts contributing for xBase growing and giving to all Clipper developpers a one hope with easy efforts. Thank you all of you !
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein

User avatar
mustafa
Posts: 1059
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Has thanked: 2 times
Been thanked: 266 times
Contact:

Post by mustafa »

Hello friends:

By text capability, it is published only
in English, you have the translation in Spanish
in file "Readme.txt"
*------------------------------------------------------------------------*
I've been experiencing watching for a while
BackUp works with USB-PenDrive

http://hmgforum.com/viewtopic.php?f=9&t=2174
viewtopic.php?f=5&t=4524&hilit=cDriveLetter

This Sample creates Zip files with an option to Password
and Folder we can't do with Compress
See my post of Nov 26, 2018
viewtopic.php?f=8&t=5864&p=57940&hilit= ... ile#p57940
Decrypt_Tools Files Zip is also attached to be able to decode the
Zip files (See demos)

  PenDrive_BackUp_v07\Decrypt_Tools\ Decrypt_Help\Decrypt_Tools.gif
  PenDrive_BackUp_v07\PenDrive_BackUp_v07\USB_Pendrive_Help\PenDrive.gif

Description:
 Extension Selection for Back_Up and Select the Directory where
 are the files to make the ZIP

 We mark Manual or Automatic if we want Password and if the Zip includes Folders?

 The files selected for the New Zip will appear in a Grid

 We choose Folder for USB-Pendrive Drive to do Back-UP and indicate the
 time in minutes it will take us to do the Back-up from 1 minute to 60 minutes

 We do [Save Time] and start the countdown and if we prefer Back-Up
 instant, press [Back_Up Now!]

 In option [View] we have Grid that indicates all the positions of the Zip copy

 Delete all the DataBase or Delete some record and a list of the DataBase.

 Pressing [Exit] will not leave a Message that indicates that if we want to disconnect
 the PenDrive of our computer, if you indicate If it disconnects but I am running
 The PenDrive with the Light on but Win-10 indicates that there is no F Unit:

 PS: I don't know how to hold the USB-PenDrive Drive Letter, the Sample is
     Based on my Computer that the Unit is F:

Dedicated in memory of Pablo César

Por capacidad de texto , se publica solo
en Ingles, teneis la traducción en Español
en fichero "Readme.txt"
 Regards /Saludos
 March - 2020

 Mustafa Lopez
Attachments
PenDrive_BackUp_v07.zip
(3.17 MiB) Downloaded 116 times
Pantallazo.jpg
Pantallazo.jpg (115.6 KiB) Viewed 1957 times

User avatar
danielmaximiliano
Posts: 2447
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Has thanked: 553 times
Been thanked: 117 times
Contact:

Post by danielmaximiliano »

Buenísimo.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO

RPC
Posts: 237
Joined: Fri Feb 10, 2017 4:12 am
DBs Used: DBF
Has thanked: 124 times
Been thanked: 13 times

Post by RPC »

Hi Mustafa
Does your program work only on USB drive or also on external HDD ?
Your program does recognize external drive but when I try to back up it say No pen drive
Secondly the Decrypt_tools program gives linker error
Thanks

User avatar
mustafa
Posts: 1059
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Has thanked: 2 times
Been thanked: 266 times
Contact:

Post by mustafa »

Hola amigo RPC
perdona mi ignorancia del Ingles
Solo he probado hacer copias en mi computadora
que es la Letra F:
Ami me está haciendo las copias bien en mi unidad USB F:

Decrypt_tools
es para desenciptar los ficheros Zip con Password
se tiene de copiar en Decrypt_Zip el zip y el fichero asociado txt
y aparece descomprimido en carpeta Files_Picture
Haber si conseguimos que detecte la unidad USB autonmaticamente
en "Detect_USB.prg"
yo fuerzo para que sea F:
en mi computer

Code: Select all

  unit :=   Aadd( aDrives, Chr(64+6) )     //  6 <------- Unidad F:
  SAVE ALL LIKE unit* TO 'USB-Drive.mem' 
view---> viewtopic.php?f=8&t=5864&p=56978&hilit=mustafa#p56978
PD: estas compilando con los fichero.bat que hay en mi sample
32ó 64 bits ? build.3.4.4.bat

PenDrive_BackUp_v07
@ECHO OFF
call c:\hmg.3.4.4\build.bat USB-Pendrive.hbp %*

Decrypt_Tools
@ECHO OFF
call c:\hmg.3.4.4\build.bat Decrypt_Tools.hbp %*

Regards/Saludos
Mustafa

*---------------------------------------- Google ----------------------------------------*
Hello friend RPC
forgive my ignorance of English
I have only tried to make copies on my computer
what is Letter F
Ami is making me copies well on my USB F drive:

Decrypt_tools
It is to decrypt Zip files with Password
you have to copy the zip and the associated txt file in Decrypt_Zip
and it appears unzipped in Files_Picture folder
If we can detect the USB drive automatically
in "Detect_USB.prg"
I force it to be F:
on my computer

Code: Select all

   unit: = Aadd (aDrives, Chr (64 + 6)) // 6 <------- Unit F:
   SAVE ALL LIKE unit * TO 'USB-Drive.mem'
view ---> viewtopic.php?f=8&t=5864&p=56978&hilit=mustafa#p56978
PD: you are compiling with the file.bat that is in my sample
32 or 64 bits? build.3.4.4.bat

PenDrive_BackUp_v07
@ECHO OFF
call c:\hmg.3.4.4\build.bat USB-Pendrive.hbp %*

Decrypt_Tools
@ECHO OFF
call c:\hmg.3.4.4\build.bat Decrypt_Tools.hbp %*


Regards / Greetings
Mustafa

User avatar
mustafa
Posts: 1059
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Has thanked: 2 times
Been thanked: 266 times
Contact:

Post by mustafa »

Hola aqui pongo el código resumido
solo detecta si esta Pendrive en USB
y cancela
Esta última opción en Win-10 desconecta
pera la unidad se queda encendida
Mustafa
*------------------- Google ---------------------------------*
Hello here I put the summary code
only detect if this USB flash drive
and cancel
This last option in Win-10 disconnects
but the unit stays on
Mustafa
Attachments
Usb_Detect.zip
(66.2 KiB) Downloaded 108 times
Pantallazo.jpg
Pantallazo.jpg (22.37 KiB) Viewed 1925 times

User avatar
AUGE_OHR
Posts: 1268
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 240 times
Been thanked: 349 times

Post by AUGE_OHR »

hi,

thx for file.
i have done it with HMG_CALLDLL but your HB_FUNC are much better :D
viewtopic.php?f=5&t=6316
mustafa wrote:
Thu Mar 05, 2020 6:16 pm
If we can detect the USB drive automatically in "Detect_USB.prg"
i notice that your Version need USB Device insert before start APP
have a look here for DEVICECHANGEINFO
viewtopic.php?f=12&t=6191&p=60008

it will notice when USB Device is plug in so you can automatic refresh drivelist
have fun
Jimmy

User avatar
mustafa
Posts: 1059
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Has thanked: 2 times
Been thanked: 266 times
Contact:

Post by mustafa »

Hola Jimmy
No se como intrepretar el código de su escrito
podria poner un pequeño sample completo solo
referente a la detección de unidades USB PenDrive

Con este código solo detecta si esta PenDrive
dentro de Unidad USB

Code: Select all


 For i := 1 To 32
   If IsBit ( nBitMask , i )                 // <------ função IsBit da biblioteca LIBCT.LIB
   MsgInfo(   Aadd( aDrives, Chr(64+i)+":\" ) )
   EndIf
 Next i

Gracias, Saludos
Mustafa

*-------------------- Google ----------------------*

Hi jimmy
I don't know how to interpret your writing code
I could put a small complete sample just
concerning the detection of USB PenDrive drives

With this code it only detects if this PenDrive
Inside USB Drive

Code: Select all


 For i := 1 To 32
   If IsBit ( nBitMask , i )                 // <------ função IsBit da biblioteca LIBCT.LIB
   MsgInfo(   Aadd( aDrives, Chr(64+i)+":\" ) )
   EndIf
 Next i


Thank you, Regards
Mustafa

Post Reply