开发者

How does one detect the action of adding/removing of a UNC share with Delphi? (Prev D7)

开发者 https://www.devze.com 2023-01-04 06:42 出处:网络
How does one detect the action of adding/removing a UNC share? I basically just need to know if a share has been added/removed not details about the share itself. A working example would be greatly ap

How does one detect the action of adding/removing a UNC share? I basically just need to know if a share has been added/removed not details about the share itself. A working example would be greatly appreciated.

Thanks SB开发者_如何学C


"By monitoring the registry at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\Shares\ I can catch changes to it."

To monitor a registry key... http://delphi.about.com/od/kbwinshell/l/aa052003a.htm


AFAIK there is no callback/event mechanism to be notified of such an event so I think you can only enumerate (poll) and compare to the previous state at intervals.

(or the ugly way: hook WNetAddConnection* and WNetCancelConnection* API's)

0

精彩评论

暂无评论...
验证码 换一张
取 消