|
-
Jul 21st, 2011, 10:33 PM
#1
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
-
Jul 22nd, 2011, 04:17 AM
#2
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
-
Jul 22nd, 2011, 01:05 PM
#3
Re: Determine if a folder is clicked/selected in windows Explorer
-
Jul 22nd, 2011, 03:20 PM
#4
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..
- Your VB6 app is running
- You then go to Windows Explorer and click on a folder
- 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
-
Jul 23rd, 2011, 05:28 AM
#5
Re: Determine if a folder is clicked/selected in windows Explorer
 Originally Posted by dee-u
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/
-
Jul 24th, 2011, 09:40 PM
#6
Re: Determine if a folder is clicked/selected in windows Explorer
Last edited by dee-u; Jul 24th, 2011 at 09:59 PM.
-
Jul 25th, 2011, 04:26 AM
#7
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|