Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

clear the Protected Storage System Provider registry

ishraqishraq Member Posts: 20
hi... i need a code when a command box is pressed would clear all data in the Protected Storage System Provider registry (for the current user).. more specifically the msn messenger id and password... pls be very specific on the codes as im a total newbe... thanks alot..

Comments

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : hi... i need a code when a command box is pressed would clear all
    : data in the Protected Storage System Provider registry (for the
    : current user).. more specifically the msn messenger id and
    : password... pls be very specific on the codes as im a total newbe...
    : thanks alot..
    :

    I'd say, the code is not meant for a noobie :(
    If you're using a .NET version of VB then there is probably a class to handle the Registry.
    If however you're using VB6, it involves Windows API's. There is another approach though: there is a library, whos name I have forgotten, - something std5kit or std5tool or something like that - which you can reference and use it's very limited functionality to edit the registry.

    I'm willing to code the VB6 API version for you, but I don't have VB6 handy at the moment.


    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : : hi... i need a code when a command box is pressed would clear all
    : : data in the Protected Storage System Provider registry (for the
    : : current user).. more specifically the msn messenger id and
    : : password... pls be very specific on the codes as im a total newbe...
    : : thanks alot..
    : :
    :
    : I'd say, the code is not meant for a noobie :(
    : If you're using a .NET version of VB then there is probably a class
    : to handle the Registry.
    : If however you're using VB6, it involves Windows API's. There is
    : another approach though: there is a library, whos name I have
    : forgotten, - something std5kit or std5tool or something like that -
    : which you can reference and use it's very limited functionality to
    : edit the registry.
    :
    : I'm willing to code the VB6 API version for you, but I don't have
    : VB6 handy at the moment.
    :
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry


    thank u..thank u..thank u!!!!
    it would mean alot to me if u could code it for me... becoz im using vb6..
    n this is the most important part of my project.... as i run a cyber cafe n i need to eraze the personal info stored on the computers...ppl just cum n store their info..hehe.. also i need this same bit of code for another project 2... THANK U so much!!!! take ur time..to get vb6...but pls do this for me k?
    if u need to contact me or when u r finished cud u pls send it to this id?
    "cimmaron_odd@hotmail.com"
    with the forms n evrything coz it wud be very difficult for me to make such n advanced project...
    thanx again!!
    best wishes n regards... the world needs more ppl like u.. :)
    ps..if u woud like, i cud upload vb6 for u..its approx 135 mb.. is there a free site which wud let me upload this?
    take care..
  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : thank u..thank u..thank u!!!!
    : it would mean alot to me if u could code it for me... becoz im using
    : vb6..
    : n this is the most important part of my project.... as i run a cyber
    : cafe n i need to eraze the personal info stored on the
    : computers...ppl just cum n store their info..hehe.. also i need this
    : same bit of code for another project 2... THANK U so much!!!! take
    : ur time..to get vb6...but pls do this for me k?
    : if u need to contact me or when u r finished cud u pls send it to
    : this id?
    : "cimmaron_odd@hotmail.com"
    : with the forms n evrything coz it wud be very difficult for me to
    : make such n advanced project...
    : thanx again!!
    : best wishes n regards... the world needs more ppl like u.. :)
    : ps..if u woud like, i cud upload vb6 for u..its approx 135 mb.. is
    : there a free site which wud let me upload this?
    : take care..

    Neh, I have VB6, just not on this computer. I still love VB6 and prefer it over VB.NET languages ;) But I figured on this computer I should grow along with the time. Cause actually the .NET framework is the best thing that ever happened for programmers, assuming you're only interested in coding for the future. It's functionality is so much better than anything VB6 has to offer.

    Actually, I stay with VB6 for one reason: the lower dimension for arrays can be specified, which you can't do in any later VB version :(
    I like declaring my arrays 1 To Length ^^

    Anyway, I was actually going to tell you that I'll write it in the weekend. Don't worry, it's 30 mins work tops. I have most of the functions written down somewhere and it's not that hard/much to code - just need to make sure I obey a lot of formalities.

    Note: the program (if run under an NT based system) will need deletion rights to the registry, but I don't think that'll be a problem.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : : thank u..thank u..thank u!!!!
    : : it would mean alot to me if u could code it for me... becoz im using
    : : vb6..
    : : n this is the most important part of my project.... as i run a cyber
    : : cafe n i need to eraze the personal info stored on the
    : : computers...ppl just cum n store their info..hehe.. also i need this
    : : same bit of code for another project 2... THANK U so much!!!! take
    : : ur time..to get vb6...but pls do this for me k?
    : : if u need to contact me or when u r finished cud u pls send it to
    : : this id?
    : : "cimmaron_odd@hotmail.com"
    : : with the forms n evrything coz it wud be very difficult for me to
    : : make such n advanced project...
    : : thanx again!!
    : : best wishes n regards... the world needs more ppl like u.. :)
    : : ps..if u woud like, i cud upload vb6 for u..its approx 135 mb.. is
    : : there a free site which wud let me upload this?
    : : take care..
    :
    : Neh, I have VB6, just not on this computer. I still love VB6 and
    : prefer it over VB.NET languages ;) But I figured on this computer I
    : should grow along with the time. Cause actually the .NET framework
    : is the best thing that ever happened for programmers, assuming
    : you're only interested in coding for the future. It's functionality
    : is so much better than anything VB6 has to offer.
    :
    : Actually, I stay with VB6 for one reason: the lower dimension for
    : arrays can be specified, which you can't do in any later VB version
    : :(
    : I like declaring my arrays 1 To Length ^^
    :
    : Anyway, I was actually going to tell you that I'll write it in the
    : weekend. Don't worry, it's 30 mins work tops. I have most of the
    : functions written down somewhere and it's not that hard/much to code
    : - just need to make sure I obey a lot of formalities.
    :
    : Note: the program (if run under an NT based system) will need
    : deletion rights to the registry, but I don't think that'll be a
    : problem.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry


    i just dont know how to thank u enough! :)
    u hav most definitly made my day!
    m awaiting ur codes.. i will check bak here after the weekend..
    thank u soooo much!
    tc..
    best wishes!

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    I'll just post it here so that if anyone needs the same code they can see it.

    [code]
    Private Const ERROR_SUCCESS As Long = 0&

    Private Const HKEY_CURRENT_USER As Long = &H80000001
    Private Const HKEY_LOCAL_MACHINE As Long = &H80000002

    Private Const KEY_SET_VALUE As Long = &H2
    Private Const KEY_QUERY_VALUE As Long = &H1

    Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
    Alias "RegOpenKeyExA" (ByVal hKey As Long, _
    ByVal lpSubKey As String, ByVal ulOptions As Long, _
    ByVal samDesired As Long, phkResult As Long) As Long

    Private Declare Function RegCloseKey Lib "advapi32.dll" ( _
    ByVal hKey As Long) As Long

    Private Declare Function RegDeleteValue Lib "advapi32.dll" _
    Alias "RegDeleteValueA" (ByVal hKey As Long, _
    ByVal lpValueName As String) As Long

    Private Declare Function RegDeleteKey Lib "advapi32.dll" _
    Alias "RegDeleteKeyA" (ByVal hKey As Long, _
    ByVal lpSubKey As String) As Long

    [color=Green]'//The following code deletes the value Test under
    '// HKCUSoftwareTesting
    '//It does not delete the key or any other value
    '//You'll need to create this value in your registry
    '// before trying this code. When debugging,
    '// a return value of 2 from RegOpenKeyEx means that
    '// the specified key (SoftwareTesting) does not exist[/color]
    Private Sub Command1_Click()
    Dim hKey As Long
    Dim hResult As Long

    hResult = RegOpenKeyEx(HKEY_CURRENT_USER, _
    "SoftwareTesting", 0&, _
    KEY_SET_VALUE Or KEY_QUERY_VALUE, hKey)

    If (hResult <> ERROR_SUCCESS) Then
    MsgBox "Failed to open key", vbCritical
    Exit Sub
    End If

    hResult = RegDeleteValue(hKey, "Test")

    If (hResult <> ERROR_SUCCESS) Then
    [color=Green]'//Display error, but do not exit, because we need to close
    '// our key first[/color]
    MsgBox "Could not delete value", vbCritical
    End If

    RegCloseKey hKey
    End Sub
    [/code]

    Please tell me if this works for you or not. If not, describe to me what went wrong (which reg call failed) and what hResult was returned.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : I'll just post it here so that if anyone needs the same code they
    : can see it.
    :
    : [code]:
    : Private Const ERROR_SUCCESS As Long = 0&
    :
    : Private Const HKEY_CURRENT_USER As Long = &H80000001
    : Private Const HKEY_LOCAL_MACHINE As Long = &H80000002
    :
    : Private Const KEY_SET_VALUE As Long = &H2
    : Private Const KEY_QUERY_VALUE As Long = &H1
    :
    : Private Declare Function RegOpenKeyEx Lib "advapi32.dll" _
    : Alias "RegOpenKeyExA" (ByVal hKey As Long, _
    : ByVal lpSubKey As String, ByVal ulOptions As Long, _
    : ByVal samDesired As Long, phkResult As Long) As Long
    :
    : Private Declare Function RegCloseKey Lib "advapi32.dll" ( _
    : ByVal hKey As Long) As Long
    :
    : Private Declare Function RegDeleteValue Lib "advapi32.dll" _
    : Alias "RegDeleteValueA" (ByVal hKey As Long, _
    : ByVal lpValueName As String) As Long
    :
    : Private Declare Function RegDeleteKey Lib "advapi32.dll" _
    : Alias "RegDeleteKeyA" (ByVal hKey As Long, _
    : ByVal lpSubKey As String) As Long
    :
    : [color=Green]'//The following code deletes the value Test under
    : '// HKCUSoftwareTesting
    : '//It does not delete the key or any other value
    : '//You'll need to create this value in your registry
    : '// before trying this code. When debugging,
    : '// a return value of 2 from RegOpenKeyEx means that
    : '// the specified key (SoftwareTesting) does not exist[/color]
    : Private Sub Command1_Click()
    : Dim hKey As Long
    : Dim hResult As Long
    :
    : hResult = RegOpenKeyEx(HKEY_CURRENT_USER, _
    : "SoftwareTesting", 0&, _
    : KEY_SET_VALUE Or KEY_QUERY_VALUE, hKey)
    :
    : If (hResult <> ERROR_SUCCESS) Then
    : MsgBox "Failed to open key", vbCritical
    : Exit Sub
    : End If
    :
    : hResult = RegDeleteValue(hKey, "Test")
    :
    : If (hResult <> ERROR_SUCCESS) Then
    : [color=Green]'//Display error, but do not exit, because we need to close
    : '// our key first[/color]
    : MsgBox "Could not delete value", vbCritical
    : End If
    :
    : RegCloseKey hKey
    : End Sub
    : [/code]:
    :
    : Please tell me if this works for you or not. If not, describe to me
    : what went wrong (which reg call failed) and what hResult was
    : returned.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry


    thank u so much!
    it works until the delete command....
    i mean it gets the registry opend..n then shows error messege that it cannot be deleted..

    but when i put the protected storage path it does not open.. cannot open error shows.. :(
    tc

  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : thank u so much!
    : it works until the delete command....
    : i mean it gets the registry opend..n then shows error messege that
    : it cannot be deleted..
    :

    Well could you debug it, and check what error return code it gives?
    The code itself is correct - it's in other factors (like access permissions) that it could go wrong.
    The return code will specify what exactly went wrong.

    : but when i put the protected storage path it does not open..
    : cannot open error shows.. :(
    : tc
    :
    Here too, the returned value will help in solving the problem.
    Most likely, the location you specified does not exist.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
  • ishraqishraq Member Posts: 20
    : : thank u so much!
    : : it works until the delete command....
    : : i mean it gets the registry opend..n then shows error messege that
    : : it cannot be deleted..
    : :
    :
    : Well could you debug it, and check what error return code it gives?
    : The code itself is correct - it's in other factors (like access
    : permissions) that it could go wrong.
    : The return code will specify what exactly went wrong.
    :
    : : but when i put the protected storage path it does not open..
    : : cannot open error shows.. :(
    : : tc
    : :
    : Here too, the returned value will help in solving the problem.
    : Most likely, the location you specified does not exist.
    :
    : Best Regards,
    : Richard
    :
    : The way I see it... Well, it's all pretty blurry


    hi!!! its working!!
    i've managed to put the right path to protected storage!!! now it gets open!! im really excited! hehe... but still "cud not be deleted" msg shows..
    what exactly should i write in this code
    hResult = RegDeleteValue(hKey, "i dont kno wat to write here")
    i hav given the permissions 2... n i deleted it manually from regedit..but when i open messenger still my password is there...i think the password must be stored somewhere else..im real confused at the moment....
    thanx very much!!
    tc
  • BitByBit_ThorBitByBit_Thor Member Posts: 2,444
    : hi!!! its working!!
    : i've managed to put the right path to protected storage!!! now it
    : gets open!! im really excited! hehe... but still "cud not be
    : deleted" msg shows..
    : what exactly should i write in this code
    : hResult = RegDeleteValue(hKey, "i dont kno wat to write here")
    : i hav given the permissions 2... n i deleted it manually from
    : regedit..but when i open messenger still my password is there...i
    : think the password must be stored somewhere else..im real confused
    : at the moment....
    : thanx very much!!
    : tc
    :

    Probably in a hash file somewhere on disk.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.