Hi Mustafa
You are right, this works on pen drive.
It does not work on external HDD
Decrypt_tools doesn't work wit bat file also. No executable file is produced.
Moderator: Rathinagiri
Hi Mustafa
here is a Function that did samemustafa wrote: ↑Fri Mar 06, 2020 10:28 am 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 DriveCode: 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
Code: Select all
FUNCTION GetDrive( nMask )
Local cBin := NToC ( nMask, 2 )
Local nBit:= Len ( cBin ) - hb_At( '1', cBin )
RETURN Chr( nBit + 65 ) + ":"
Code: Select all
FUNCTION USB_Detect()
LOCAL nHWnd := EventHWND()
LOCAL nMsg := EventMSG()
LOCAL nWParam := EventWPARAM()
LOCAL nLParam := EventLPARAM()
LOCAL nMask, cDevice := ""
Local xRet
Local lThreatRet := hb_mutexSubscribe( s_mtxReturn, 0.00000001, @xRet )
DO CASE
CASE lThreatRet .AND. hb_isArray ( xRet )
//return message from Wait4Action thread
Msginfo( xRet[1], STR( xRet[2] ) )
CASE nMsg == WM_DEVICECHANGE
DO CASE
CASE nWParam == DBT_DEVICEARRIVAL
nMask := DeviceChangeInfo( nWParam, nLParam )
if !Empty( nMask ) .and. nMask > 0
cDevice := GetDrive( nMask )
endif
//send job
hb_mutexNotify( s_mtxUSB, { "INSERT", cDevice, nMask, nHWnd } )
CASE nWParam == DBT_DEVICEREMOVECOMPLETE
nMask := DeviceChangeInfo( nWParam, nLParam )
if !Empty( nMask ) .and. nMask > 0
cDevice := GetDrive( nMask )
endif
//send job
hb_mutexNotify( s_mtxUSB, { "REMOVE", cDevice, nMask, nHWnd } )
End CASE
End Case
RETURN cDevice
Code: Select all
DEFINE WINDOW Form_003 ;
At 0,0 Width 650 Height 592 ;
Title 'Decrypt_Tools Files Zip 2020' ;
ICON "Logo" ;
MAIN NOSIZE NOMAXIMIZE
ON KEY ESCAPE ACTION Form_003.Release
DrawWindowBoxRaised( "Form_003" , 10, 10, 500, 633 ) //<------------------ Lib "hmg_GFilatov.ch"