Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6594389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:48:17+00:00 2026-05-25T17:48:17+00:00

I am writing some C# code and I need to detect if a specific

  • 0

I am writing some C# code and I need to detect if a specific folder on my windows file system has been opened while the application is running. Is there any way to do it? WinAPI maybe?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:48:17+00:00Added an answer on May 25, 2026 at 5:48 pm

    There are three API things I think you should check out:

    FindFirstChangeNotification() http://msdn.microsoft.com/en-us/library/aa364417%28VS.85%29.aspx
    That gives you a handle you can wait on and use to find changes to a file in a particular file, directory, or tree of directories. It won’t tell you when a directory is browsed, but it will tell you when a file is saved, renamed, and so on and so forth.

    SetWindowsHookEx() http://msdn.microsoft.com/en-us/library/ms644990%28v=VS.85%29.aspx
    You can set that up to give you a callback when any number of events occur – in fact I’m pretty positive that you CAN get this callback when a directory is opened, but it will probably be inordinately difficult because you’ll be intercepting messages to explorer’s window. So you’ll be rebooting during debugging.

    Windows Shells http://msdn.microsoft.com/en-us/library/bb776778%28v=VS.85%29.aspx
    If that wasn’t painful enough, you can try writing a shell program.

    If you’re trying to write a rootkit, I suppose you don’t want me to spoil the details for you. If you’re NOT trying to write a rootkit, I suggest you look it up – carefully. There are open source rootkits, and they all basically have to monitor file access this way to hide from the user / OS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing some code and I need to write a number to a specific
I'm writing some code where the UI thread need to communicate with the background
I am writing some code in which i need to get a line from
I am writing some Ruby code, not Rails, and I need to handle something
I'm writing some terrible, terrible code, and I need a way to put a
I have been writing some code that creates a generic blog. Its features are
I'm writing some code and I need to get the window handle of the
I'm writing some code in which I need to use my own HttpResponse object
So I've been pigeon-holed into writing some Jython code. I've been using the latest
In a .NET application I am writing, I need to detect whether a particular

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.