Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to know if a file copy is in progress ?

Posted on 2008-06-24
5
Medium Priority
?
461 Views
Last Modified: 2013-11-20
Hello every body,

In an application written using VC++2005 with MFC support, is there a way to know if a file copy is in progress (some where else in windows, not especially in my application) ?

Thanks in advance,
Mike
0
Comment
Question by:mike_marquet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:evilrix
ID: 21854247
Suggestion: Try to obtain an exclusive lock on the file, if you can't it's probably being modified.
http://msdn.microsoft.com/en-us/library/aa365203(VS.85).aspx
0
 

Author Comment

by:mike_marquet
ID: 21854525
It's not want I want. I don't know anything about the file.
I only want to know if a FileCopy is somewhere in progress what else which file is being copied.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21854538
Oh, ok. I might help to know why you want to do this -- what's the rational? There might be a different way to approach this.
0
 

Author Comment

by:mike_marquet
ID: 21854656
If a file copy is in progress, I must disable some controls in my application.
0
 
LVL 19

Accepted Solution

by:
mrwad99 earned 200 total points
ID: 21858088
At first thought you would need to hook the API functions CopyFile and CopyFileEx, as I would imagine most copying on the system would employ one of those API functions.  Wait for the function to exit, then you know the copy has been completed so you can enable your controls.

That said, I don't know much about it myself, although if you look hard enough I am sure there is some info out there about hooking API function calls.

HTH
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question