|
Niklas, this message comes -after- my own delete message confirmation (i'm running the SHFileOperation command in silent mode using FOF_SILENT). I'm displaying the user my own confirmation details which is different than explorer's, it contains some details about a task that was ended, and there's no need for an extra confirmation.
Is there a way I can know in advance wherever a file is going to the recycle bin or not? how does explore does that?
I've tried querying the folder with GetAttributesOf, but I can't find a flag to indicate this.
thanks,
|
|
|
|
|
elie002 wrote: ...if they reside on network drives, removable drives or if they are too large).
The first two can easily be checked beforehand.
For the last, can you check if SHFileOperation() returns DE_FILE_TOO_LARGE ? As has already been mentioned, I think FOF_WANTNUKEWARNING is a better choice.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
David, maybe it's better for me to check if the file is too large (so I'll know if it goes to the recycle bin or not) - as I need this information before calling SHFileOperation.
I'm doing some tests to verify the size which, above it, explorer deletes the files permanently.
thanks-
|
|
|
|
|
Hi,
If we close a window application in task manager using end process method, the applcation should get some message to close the window. Can anyone please tell me what message that window applcation will get from task manager?
Thanks,
|
|
|
|
|
|
i put breakpoint in close and destroy windows message while debugging and closed the applcation via task manager,but control is not coming to that function. The applcation closes suddenly.
|
|
|
|
|
|
Hi,
I have added WM_ENDSESSION and WM_QUERYENDSESSION message,but still the control is not coming to that corresponding function.
|
|
|
|
|
When an application is terminated using end process of task manager, the application is terminated externally.
There is no message or event sent to the application.
So there is no way that the application can know if such a thing is happening.
Task Manager uses the TerminateProcess API with an exit code of 1 to achieve this.
So the only chance you have is to hook into the TerminateProcess API.
|
|
|
|
|
Can you please tell me how to do this?
|
|
|
|
|
|
i need to send some information to server while client application crashes. So that only im asking.
|
|
|
|
|
Either hook TerminateProcess API or make it as your design limitation.
Another way is to make a service or another application which will continuously monitor your client application and once it has been closed from Task Manager, that service or application should send signal to your server.
f
|
|
|
|
|
thanks for all answer ...
|
|
|
|
|
«_Superman_» wrote: will not work properly from Vista onwards.
Why do you say it won't work from Vista onward?
I have a hooking library that works just fine in Vista.
I agree that IAT patching is a poor way to hook, however. The Detours way is far superior.
|
|
|
|
|
Sorry. That is what I meant.
Should have been more specific there.
|
|
|
|
|
You'd have to hook it globally, something that's hard to do. Almost all hooking methods word within a process.
Steve
|
|
|
|
|
As has been said, when a process is terminated it's killed with prejudice and receives no notifications. That's the purpose of TerminateProcess , to kill a process that's misbehaving and can't be trusted.
Perhaps a better approach would be to use an external process to monitor the process in question.
Steve
|
|
|
|
|
hi,
how do i solve the "memory leak" problem in my VC++ project? is it calling SetProcessWorkingSetSize function?
Zo.Naderi-Iran
|
|
|
|
|
Where did you find memory leak in code?
Or do you want to find if there is memory leak in your code?
--
"Programming is an art that fights back!"
|
|
|
|
|
1. Search for all occurrences of the new keyword.
2. Make sure they have a corresponding delete (or delete [] where applicable)
3. Search for alloc (will catch malloc, calloc, ...)
4. Make sure they have a corresponding free() .
What else? Do you use COM components? GDI? Files? Databases? Registry?
Try to run a subset of your application with a low code coverage to see if you still leak to narrow it down. (This might require code changes.) Increase the coverage in steps.
A code review can also make wonders.
Purchase a detection tool if your budget allows it.
|
|
|
|
|
yes, i checked my project. all new keyword have delete and ...
an infinite loop there is in my project. in this loop, i new and delete several pointer.
is it useful , the calling SetProcessWorkingSetSize , in first or end of loop?
Zo.Naderi-Iran
|
|
|
|
|
You have a serious problem in your code, and SetProcessWorkingSetSize will unfortunatly not save you.
Try and remove the new/delete in your loop if possible. Are you sure you don't have any condtional deletes? (whithin if/else block?) Does all branches clean up as expected?
I didn't ask, but how is the leak showing? Can you spot it from the task manager while executing, or does visual studio inform you when you exit?
|
|
|
|
|
the memory value, in task manager , is increscent.
Zo.Naderi-Iran
|
|
|
|
|
Ok, so let's assume the leak really is from within the loop.
Do you maybe have any exception / exception handling where the new/delete pair breaks?
like:
try {
int *p = new int;
if (bNowAndThen)
throw "Exception";
delete p;
}
catch (const char* e)
{
}
If not, you need to start inspecting the functions you call from the loop and see if any of them is causing this. Do this by removing as much as you can, recompile and run. If it looks ok try adding a few calls until the error occurs again.
|
|
|
|