EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Explorer current folder

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#13113
Posted: 04/26/2010 07:07:43
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

Hi folks,

Does anyone know how to tell what folder is currently selected in Windows Explorer (or other app for that matter). I was using a network mount point, but I've switched to local for some functionality changes/testing. CbFSOpenFile was perfect for network, but for local it goes "searching" through other folders as well so I get a stack of open file events for those.

Is there some way I can tell what the current folder selected is?

Thanks.
#13114
Posted: 04/26/2010 07:30:04
by Eugene Mayevski (EldoS Corp.)

For local drivers Explorer does read more information including scanning of subdirectories. While it's probably possible to obtain the list of open Explorer windows and get corresponding folders out of them, you can't easily get the folders of (possibly existing) open or save dialogs or Choose Folder dialogs. So you would need to take some other approach.


Sincerely yours
Eugene Mayevski
#13128
Posted: 04/27/2010 04:06:38
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

Hmmm that's an issue then... I want to use the notifychange function so I can tell Explorer what files have been modified by other users, and I was hoping to be able to only send a notifychange event for the currently selected folder.

How smart is Explorer if I send a whole stack of notifychange events for files that are not in the currently viewed folder? Will it ignore them, or force a refresh/enum directory all the time? It's possible that another user could create 100 files in my back-end system at once, so that could mean 100 notifychange events. That's OK if Explorer will filter out the ones it doesn't care about.
#13131
Posted: 04/27/2010 07:12:10
by Volodymyr Zinin (EldoS Corp.)

You should use NotifyDirectoryChange for all files and directories that are changed (created, deleted, or modified) and only if such changes are made outside the CallbackFS mehcanism (for example if your CallbackFS files represent records in some DB and these records are changed at the same time by third-party programs).

Quote
Gavin McKay wrote:
How smart is Explorer if I send a whole stack of notifychange events for files that are not in the currently viewed folder? Will it ignore them, or force a refresh/enum directory all the time?

It will ignore them. This functionality is connected with the ReadDirectoryChangesW system API. Explorer (or another file manager) calls this API only for folders it wants to observe.
#13135
Posted: 04/27/2010 16:21:49
by Gavin McKay (Standard support level)
Joined: 09/01/2009
Posts: 48

Ah OK, I think I understand. So the NotifyDirectoryChange isn't contacting Explorer directly, it is just raising a notification message in Windows itself? And then Explorer filters this list down to what it wants to view?
#13142
Posted: 04/28/2010 01:03:28
by Volodymyr Zinin (EldoS Corp.)

Something is like that but Explorer obtains the notification only for folders it's interested in (i.e. for which it has called ReadDirectoryChangesW).
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.

Reply

Statistics

Topic viewed 1314 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!