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 7060255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:19:50+00:00 2026-05-28T04:19:50+00:00

I use next code to know when a files is changed in a certain

  • 0

I use next code to know when a files is changed in a certain folder:

HANDLE hDir = ::CreateFile(path, FILE_LIST_DIRECTORY, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS|FILE_FLAG_OVERLAPPED, NULL);

FILE_NOTIFY_INFORMATION returnData[1024];
DWORD returnDataSize = 0;                   

while(ReadDirectoryChangesW(hDir, returnData, sizeof(returnData), TRUE, FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME|FILE_NOTIFY_CHANGE_LAST_WRITE, &returnDataSize, NULL, NULL))
{
    ...
}

ReadDirectoryChangesW blocks the thread until a file changes occurs. Is there any way to stop/force return from this function?

  • 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-28T04:19:51+00:00Added an answer on May 28, 2026 at 4:19 am

    From your description, it sounds like CancelIoEx should do the trick. Obviously, you need another thread for that, since you’re now calling it synchronously. That blocks the calling thread, so you can’t do anyting from that thread, not even stop.

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

Sidebar

Related Questions

I use next code to print current time Calendar cal = Calendar.getInstance(); System.out.println(cal.getTime()); I
In Flash Builder (flex 4) I try to use next code to set selected
I allocate a color entry with the next code, then I use it to
I am use next type of strings: LPCSTR, TCHAR, String i want to convert:
I am planning to use Drizzle in my next C# Mono app. Since there
I have the next query that I run via SQLCMD.EXE use [AxDWH_Central_Reporting] GO EXEC
I am looking to use/buy a OCR solution for my next iPhone app. Searching
I use the ASPxGridView with paging, pager settings is next: <SettingsPager Mode=ShowPager Position=Bottom Visible=true>
I am use libxml2 for XML parsing. The sample code on the libxml website
When modifying code I find I often have to go through dozens of files

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.