Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

An application/executable is processing a file in Windows 7.

I need a notification from Windows saying that this file has stopped processing. Is it possible or are there alternatives?

share|improve this question
    
Pedantically, this is not generally possible. See en.wikipedia.org/wiki/Halting_problem –  ChrisInEdmonton Jul 9 at 23:19

2 Answers 2

You can go to Windows' Task Manager and check out if the task is in progress, or terminated.

Press CtlAltDel to go to Task Manager. It's very easy and you can find out whether your task is working or not.

share|improve this answer
    
programmatically using code - can u suggest a windows API etc., –  dhaval May 24 '12 at 6:25
    
@dhaval for that you should be asking your question on Stack Overflow. –  Scott Chamberlain May 24 '12 at 6:58

Depends on your programming language. But in C with Windows-API if you create the task via CreateProcess() you can supply a PROCESS_INFORMATION structure, from which you can get a process handle as a result.

 PROCESS_INFORMATION pi= { 0, };
 BOOL success= CreateProcess(....., &pi);

Then you can use WaitForSingleObject() to either wait for completion, or with a timeout of zero, a return code of WAIT_FAILED or WAIT_TIMEOUT indicates that the process is still running.

 DWORD result= WaitForSingleObject(pi.hProcess, 0);
 if (result==WAIT_OBJECT_0) {
   // Process is complete
 }

Details: CreateProcess WaitForSingleObject

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.