Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIntercept drop file operations between two explorers Pin
Nuno Esculcas13-Feb-09 1:20
Nuno Esculcas13-Feb-09 1:20 
AnswerRe: Intercept drop file operations between two explorers Pin
Sarath C13-Feb-09 1:38
Sarath C13-Feb-09 1:38 
GeneralRe: Intercept drop file operations between two explorers Pin
Nuno Esculcas13-Feb-09 7:29
Nuno Esculcas13-Feb-09 7:29 
GeneralRe: Intercept drop file operations between two explorers Pin
Sarath C15-Feb-09 17:12
Sarath C15-Feb-09 17:12 
AnswerRe: Intercept drop file operations between two explorers Pin
Code-o-mat13-Feb-09 2:10
Code-o-mat13-Feb-09 2:10 
GeneralRe: Intercept drop file operations between two explorers Pin
Nuno Esculcas13-Feb-09 7:31
Nuno Esculcas13-Feb-09 7:31 
GeneralRe: Intercept drop file operations between two explorers Pin
Code-o-mat13-Feb-09 8:08
Code-o-mat13-Feb-09 8:08 
GeneralRe: Intercept drop file operations between two explorers Pin
Nuno Esculcas16-Feb-09 9:31
Nuno Esculcas16-Feb-09 9:31 
Hi, thanks for the suggestion, but the DoDragDrop is only called on the begining of the drag and drop process. And i will never known where is the source and if is a move or copy operation.

I tried to hook the SHFileOperationW and i can get all the things that i needed, but the problem is that the FO_DELETE operation allways crash the explorer process, even if i don't have any code inside my hook function implementation:

int MySHFileOperation(LPSHFILEOPSTRUCT lpFileOp)
{
VirtualProtect((LPVOID)pOrigSHFOPAddress, SIZE, myProtect, NULL); //ReadWrite again
memcpy(pOrigSHFOPAddress, oldBytes, SIZE); //Unhook API

int nRes = SHFileOperation(lpFileOp);

memcpy(pOrigSHFOPAddress, JMP, SIZE); //Rehook API
VirtualProtect((LPVOID)pOrigSHFOPAddress, SIZE, oldProtect, NULL); //Normal setts

return nRes;
}

PS: i used the technique described by AlexAbramov in "API Hooking with MS Detours" without the detours Smile | :)

I think i will try another approach for my problem... there are a few problems with the hook approach, one is that the SHFileOperation is deprecated in vista, and another i think that this approach is a little unorthodox..

So i will try to find another way of doing this, if anyone has some better suggestion please feel free to post it Smile | :)
Thanks

Nuno

QuestionDrawing huge Views Pin
baerten13-Feb-09 0:07
baerten13-Feb-09 0:07 
AnswerRe: Drawing huge Views Pin
«_Superman_»13-Feb-09 0:28
professional«_Superman_»13-Feb-09 0:28 
GeneralRe: Drawing huge Views Pin
baerten13-Feb-09 0:35
baerten13-Feb-09 0:35 
GeneralRe: Drawing huge Views Pin
«_Superman_»13-Feb-09 0:38
professional«_Superman_»13-Feb-09 0:38 
QuestionCreateFile Pin
john563213-Feb-09 0:01
john563213-Feb-09 0:01 
AnswerRe: CreateFile Pin
«_Superman_»13-Feb-09 0:24
professional«_Superman_»13-Feb-09 0:24 
QuestionConcatPidls Pin
john563212-Feb-09 22:55
john563212-Feb-09 22:55 
AnswerRe: ConcatPidls Pin
Stuart Dootson12-Feb-09 23:51
professionalStuart Dootson12-Feb-09 23:51 
QuestionActiveX for thermal printer not working Pin
bugsb4u12-Feb-09 22:48
bugsb4u12-Feb-09 22:48 
QuestionConnection with SQL Server 2008 using C++ Pin
PankajB12-Feb-09 20:50
PankajB12-Feb-09 20:50 
AnswerRe: Connection with SQL Server 2008 using C++ Pin
Stuart Dootson12-Feb-09 21:54
professionalStuart Dootson12-Feb-09 21:54 
GeneralRe: Connection with SQL Server 2008 using C++ Pin
PankajB12-Feb-09 22:17
PankajB12-Feb-09 22:17 
GeneralRe: Connection with SQL Server 2008 using C++ Pin
SandipG 12-Feb-09 22:33
SandipG 12-Feb-09 22:33 
GeneralRe: Connection with SQL Server 2008 using C++ Pin
PankajB12-Feb-09 22:44
PankajB12-Feb-09 22:44 
GeneralRe: Connection with SQL Server 2008 using C++ Pin
PankajB12-Feb-09 22:56
PankajB12-Feb-09 22:56 
GeneralRe: Connection with SQL Server 2008 using C++ Pin
SandipG 12-Feb-09 23:08
SandipG 12-Feb-09 23:08 
GeneralRe: Connection with SQL Server 2008 using C++ Pin
Stuart Dootson12-Feb-09 22:52
professionalStuart Dootson12-Feb-09 22:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.