How to disable msg about empty USB-drives ? (solved)
How to disable msg about empty USB-drives ? (solved)
Hello,
on all FWH-samles about drive-informations, there are messages about empty USB-drives.
Is it possible to disable these messages, because selecting 1 of 4 USB-drives,
I get these messages for the 3 unused drives before a dialog opens calliing aDrives().
aDrives()
It returns an array with all the valid drives ids.
Syntax:
aDrives( [<nType>] ) --> aDrives
This function Returns an array with all the units valid of our system.
Parameters:
<nType> 0 = All drives (default), 1 = Floppy drives only, 2 = Hard drives only
Returns:
<aDrives> The array with the drives ids
Sample:
SAMPLES\TESTDRVS.PRG
regards
Uwe
on all FWH-samles about drive-informations, there are messages about empty USB-drives.
Is it possible to disable these messages, because selecting 1 of 4 USB-drives,
I get these messages for the 3 unused drives before a dialog opens calliing aDrives().
aDrives()
It returns an array with all the valid drives ids.
Syntax:
aDrives( [<nType>] ) --> aDrives
This function Returns an array with all the units valid of our system.
Parameters:
<nType> 0 = All drives (default), 1 = Floppy drives only, 2 = Hard drives only
Returns:
<aDrives> The array with the drives ids
Sample:
SAMPLES\TESTDRVS.PRG
regards
Uwe
Last edited by ukoenig on Fri Jul 29, 2016 8:15 pm, edited 2 times in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How to disable messages about empty USB-drives ?
Please show a compilable and runnable sample of the problem. I think it can be solved.
EMG
EMG
Re: How to disable messages about empty USB-drives ?
Enrico,
just compiled the original sample TESTDRVS.prg
before the dialog opens, I get 4 Messages about empty USB-drives of O, P, Q, R
USB < T > is in use
It happens as soon aDrives() is called :
@ 1, 1 LISTBOX cDrive ITEMS aDrives() SIZE 100, 100 OF oDlg ;
ON DBLCLICK oDlg:End()
Windows 10 installed
The result of TESTDRVS.prg
regards
Uwe
just compiled the original sample TESTDRVS.prg
before the dialog opens, I get 4 Messages about empty USB-drives of O, P, Q, R
USB < T > is in use
It happens as soon aDrives() is called :
@ 1, 1 LISTBOX cDrive ITEMS aDrives() SIZE 100, 100 OF oDlg ;
ON DBLCLICK oDlg:End()
Windows 10 installed
The result of TESTDRVS.prg
regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: How to disable messages about empty USB-drives ?
I could not reproduce the problem. How can I get the messages you are talking about?
EMG
EMG
Re: How to disable messages about empty USB-drives ?
Uwe, this code not is perfect, but .....
Code: Select all
function Main()
local oDlg, cDrive
local aDrives := {} //aDrives()
local i
// Execute as an administrator
// Ejecutar como administrador
for i = Asc( "C" ) to Asc( "Z" )
if GetDriveType( Chr( i ) + ":\" ) > 1 .and. File( Chr( i ) + ":\NUL" )
//? Chr( i ) + ":\"
if Memowrit( Chr( i ) + ":\A1A2A3A4.txt", "Test" )
FErase( Chr( i ) + ":\A1A2A3A4.txt" )
// Unidad disponible
// Drive available
AADD( aDrives, CHR( i ) + ":" )
else
// Dummy condition
// Unidad no disponible
// Protegido contra escritura ?
// Drive not available
// Drive write protected?
endif
endif
Next i
DEFINE DIALOG oDlg FROM 5, 5 TO 20, 60 TITLE "Select a drive"
@ 1, 1 LISTBOX cDrive ITEMS aDrives SIZE 100, 100 OF oDlg ;
ON DBLCLICK oDlg:End()
@ 1, 20 BUTTON "&Ok" OF oDlg ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Re: How to disable messages about empty USB-drives ?
Cristobal,
thank You very much
it seems all USB-ports are checked calling aDrives()
If the USB is empty, a message is shown < please insert a data-medium >.
Maybe there is somethig like a < autocheck > for USB inside the system-settings ( I don't know )
I'm wondering <A:\> and the <DVD-burner> is empty as well, but NO message.
The message is shown also 4 times, before the MsgAlert is executed.
function Test()
local aDrives := aDrives()
MsgAlert( len(aDrives) )
return( nil )
------------------------
That works ( drive-selection with included USB ) NO messages !!!
AEval( GetLogicalDriveStrings(), { | c | MsgInfo( c ) } )
regards
Uwe
thank You very much
it seems all USB-ports are checked calling aDrives()
If the USB is empty, a message is shown < please insert a data-medium >.
Maybe there is somethig like a < autocheck > for USB inside the system-settings ( I don't know )
I'm wondering <A:\> and the <DVD-burner> is empty as well, but NO message.
The message is shown also 4 times, before the MsgAlert is executed.
function Test()
local aDrives := aDrives()
MsgAlert( len(aDrives) )
return( nil )
------------------------
That works ( drive-selection with included USB ) NO messages !!!
AEval( GetLogicalDriveStrings(), { | c | MsgInfo( c ) } )
regards
Uwe
Last edited by ukoenig on Fri Jul 29, 2016 8:16 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: How to disable messages about empty USB-drives ?
Uwe, this code work's for meukoenig wrote:Cristobal,
thank You very much
it seems all USB-ports are checked calling aDrives()
If the USB is empty, a message is shown < please insert a data-medium >.
Maybe there is somethig like a < autocheck > for USB inside the system-settings ( I don't know )
I'm wondering <A:\> and the <DVD-burner> is empty as well but NO message.
The message is shown also 4 times, before the MsgAlert is executed.
function Test()
local aDrives := aDrives()
MsgAlert( len(aDrives) )
return( nil )
------------------------
That works ( drive-selection with included USB ) NO messages !!!
AEval( GetLogicalDriveStrings(), { | c | MsgInfo( c ) } )
regards
Uwe
Code: Select all
FUNC Main()
LOCAL nError := SetErrorMode(1)
aDrives := GetALLDrives() // All disks
SetErrorMode( nError)
Xbrowse( aDrives )
RETU
//------------------------------------//
FUNC GetALLDrives( nType )
LOCAL aDrives := {}
LOCAL nBitDrives := GetLogicalDrives(), n, cDrive
FOR n = 1 to 32
IF lAnd( nBitDrives, 2 ^ ( n - 1 ) )
cDrive = Chr( Asc( "A" ) - 1 + n ) + ":\"
IF Empty( nType )
IF n != 1 .and. Empty( nType ) //.and. GetDriveType( cDrive ) == 2
AAdd( aDrives, cDrive )
ENDIF
ELSE
IF n !=1 .and. GetDriveType( cDrive ) = nType
AAdd( aDrives, cDrive )
ENDIF
ENDIF
ENDIF
NEXT
RETU aDrives
Last edited by hebert_j_vargas on Fri Jul 29, 2016 6:54 pm, edited 1 time in total.
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2
Re: How to disable messages about empty USB-drives ?
Hebert,
thank You very much
that WORKS
NO messages !!
regards
Uwe
thank You very much
that WORKS
NO messages !!
regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: How to disable msg about empty USB-drives ? (solved)
Hello,
I finished the one-click BACKUP-section and noticed the following :
Only connected USB-ports are visible. That is OK
But why a harddisk connected to the USB-port < T > changes the type to < 3 >.
I changed the harddisk against a USB-stick and get < 2 >
It seems the return-value is the connected medium and not the port-value.
regards
Uwe
I finished the one-click BACKUP-section and noticed the following :
Only connected USB-ports are visible. That is OK
But why a harddisk connected to the USB-port < T > changes the type to < 3 >.
I changed the harddisk against a USB-stick and get < 2 >
It seems the return-value is the connected medium and not the port-value.
regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- hebert_j_vargas
- Posts: 94
- Joined: Thu Aug 02, 2012 3:21 pm
Re: How to disable msg about empty USB-drives ? (solved)
Uwe, you're right function give you media type, not port value.ukoenig wrote:Hello,
I finished the one-click BACKUP-section and noticed the following :
Only connected USB-ports are visible. That is OK
But why a harddisk connected to the USB-port < T > changes the type to < 3 >.
I changed the harddisk against a USB-stick and get < 2 >
It seems the return-value is the connected medium and not the port-value.
regards
Uwe
Compiler version: xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
FiveWin Version: FWHX 15.01
BCC 5.8.2
FiveWin Version: FWHX 15.01
BCC 5.8.2