Silvio wrote:I cannot restart windows
there is a possibility to restart using an function ?
If I restart the program ?
it must be made without restart window ...then If I want to show disc C I must restart window...
REGCREATEKEY( HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", @hKey )
REGSETVALUE( hKey, "NoDrives", 0, REG_DWORD, L2BIN( nVal ), 4 )
REGCLOSEKEY( hKey )
RAMESHBABU wrote:Hi all
In continuation of the subject, please post an example to show the hidden
drive(s) back.
Thanks in advance
- Ramesh Babu P
#INCLUDE "fivewin.ch"
#define HKEY_CURRENT_USER -2147483647 // 2147483649
FUNCTION Main()
registra(0)
RETURN nil
*********
FUNCTION registra(nNumber)
oReg := TReg32():New(HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\explorer")
oReg:Set("NoDrives", nNumber)
oReg:Close()
RETURN nil
**********
Ugo wrote:
REGCREATEKEY( HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", @hKey )
REGSETVALUE( hKey, "NoDrives", 0, REG_DWORD, L2BIN( nVal ), 4 )
REGCLOSEKEY( hKey )
#INCLUDE "fivewin.ch"
#define HKEY_CURRENT_USER -2147483647 // 2147483649
PROCEDURE Main()
LOCAL hKey
Local REG_DWORD
LOCAL nval
nVal:= nDriveNum( "C" )
? nVal
REGCREATEKEY( HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", @hKey )
REGSETVALUE( hKey, "NoDrives", 0, REG_DWORD, L2BIN( nVal ),4 )
REGCLOSEKEY( hKey )
RETURN
FUNCTION nDriveNum( cDrives )
LOCAL nRet := 0
LOCAL n := 0
for n := 1 to len( cDrives )
nRet += 2 ^( asc( upper( substr( cDrives, n, 1 ) ) ) - 65 )
next
RETURN( int( nRet ) )
Silvio wrote:Sorry Ugo,
But now it not run ok
...
#INCLUDE "fivewin.ch"
#define HKEY_CURRENT_USER 2147483649
#define REG_DWORD ( 4 ) // 32-bit number
PROCEDURE Main()
LOCAL hKey
LOCAL nval := 4 // Drive C
REGCREATEKEY( HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", @hKey )
REGSETVALUE( hKey, "NoDrives", 0, REG_DWORD, L2BIN( nVal ),4 )
REGCLOSEKEY( hKey )
RETURN
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot], Timm Sodtalbers and 67 guests