Results 1 to 7 of 7

Thread: Determine if a folder is clicked/selected in windows Explorer

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Arrow Determine if a folder is clicked/selected in windows Explorer

    I wish to be able to detect if a 'secured' folder is selected/clicked so that I can ask for a password to 'open' the folder, can anyone give me a hint on where or what to look for?

    Been trying to google but I am not finding anything useful in my case.

    TIA
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Determine if a folder is clicked/selected in windows Explorer

    you can loop through all the open shell windows and return the locationurl, which would be in the format of
    file:///C:/test
    change the foldername to suit, probably use ucase or lcase to match strings

    i assume you would need to do this in a timer
    i am not sure if the correct locationurl would be returned for a folder that the user can not open
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

  4. #4
    PowerPoster Spoo's Avatar
    Join Date
    Nov 2008
    Location
    Right Coast
    Posts
    2,656

    Re: Determine if a folder is clicked/selected in windows Explorer

    Dee-u

    I'm a little confused by your chain of events.
    Correct me where I went wrong..

    1. Your VB6 app is running
    2. You then go to Windows Explorer and click on a folder
    3. You want your app to detect which folder was just clicked and prevent
      it from manually being opened if the folder is 'secured' (in which case you
      would ask for a password)

    Spoo

  5. #5
    gibra
    Guest

    Re: Determine if a folder is clicked/selected in windows Explorer

    Quote Originally Posted by dee-u View Post
    I wish to be able to detect if a 'secured' folder is selected/clicked so that I can ask for a password to 'open' the folder, can anyone give me a hint on where or what to look for?
    You can implement a Shell notify (subclassing is need), see this project:

    http://btmtz.mvps.org/shnotify/

  6. #6

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Determine if a folder is clicked/selected in windows Explorer

    Quote Originally Posted by gibra View Post
    You can implement a Shell notify (subclassing is need), see this project:

    http://btmtz.mvps.org/shnotify/
    That is cool but I cannot find what event is raised when we selected a folder in Windows Explorer.

    EDIT:
    Upon removing a user's access to a folder and when we try to click on that folder the following dialogbox (attached) is shown, perhaps there is a way to trap for its showing, cancel it and show my own form instead?
    Attached Images Attached Images  
    Last edited by dee-u; Jul 24th, 2011 at 09:59 PM.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Determine if a folder is clicked/selected in windows Explorer

    Upon removing a user's access to a folder and when we try to click on that folder the following dialogbox (attached) is shown, perhaps there is a way to trap for its showing, cancel it and show my own form instead?
    while that dialog is showing the readystate for that shell window remains at readystate_loading, don't know if that is any help?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width