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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:52:27+00:00 2026-05-19T00:52:27+00:00

PROBLEM HISTORY: Now I use Windows Media Player SDK 9 to play AVI files

  • 0

PROBLEM HISTORY:
Now I use Windows Media Player SDK 9 to play AVI files in my desktop application. It works well on Windows XP but when I try to run it on Windows 7 I caught an error – I can not remove AVI file immediately after playback. The problem is that there are opened file handles exist. On Windows XP I have 2 opened file handles during the playing file and they are closed after closing of playback window but on Windows 7 I have already 4 opened handles during the playing file and 2 of them remain after the closing of playback window. They are become free only after closing the application.

QUESTION:
How can I solve this problem? How to remove the file which has opened handles? May be exists something like “force deletion”?

  • 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-19T00:52:28+00:00Added an answer on May 19, 2026 at 12:52 am

    The problem is that you’re not the only one getting handles to your file. Other processes and services are also able to open the file. So deleting it isn’t possible until they release their handles. You can rename the file while those handles are open. You can copy the file while those handles are open. Not sure if you can move the file to another container, however?

    Other processes & services esp. including antivirus, indexing, etc.

    Here’s a function I wrote to accomplish “Immediate Delete” under Windows:

    bool DeleteFileNow(const wchar_t * filename)
    {
        // don't do anything if the file doesn't exist!
        if (!PathFileExistsW(filename))
            return false;
    
        // determine the path in which to store the temp filename
        wchar_t path[MAX_PATH];
        wcscpy_s(path, filename);
        PathRemoveFileSpecW(path);
    
        // generate a guaranteed to be unique temporary filename to house the pending delete
        wchar_t tempname[MAX_PATH];
        if (!GetTempFileNameW(path, L".xX", 0, tempname))
            return false;
    
        // move the real file to the dummy filename
        if (!MoveFileExW(filename, tempname, MOVEFILE_REPLACE_EXISTING))
        {
            // clean up the temp file
            DeleteFileW(tempname);
            return false;
        }
    
        // queue the deletion (the OS will delete it when all handles (ours or other processes) close)
        return DeleteFileW(tempname) != FALSE;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem with some jquery and http://www.mikage.to/jquery/jquery_history_noc.html The function works great,
Currently I'm deal with a history message page using Cakephp.And I got a problem
Problem: I am using Windows as a guest operating system in a Virtual Machine
Problem: to see when computer makes approximation in mathematical calculations when I use Python
Using Hlint via the command prompt works for me, but I have problem trying
I've been stuck with this problem for over a week now. Hopefully some one
I ran into a peculiar problem today when I wanted to migrate the history
In my application I store on every machine some files in an application folder.
I use git (with git-svn) on linux and a colleague uses svn on windows.
Problem: I am having trouble implementing a recursive image lazy load in all relevant

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.