OneDrive download file automatically when right click file

Jojo Tang 86 Reputation points
2020-12-15T08:56:32.777+00:00

Hi,
I use OneDrive or Cloud Mirror sample code on a specify NB.
When right click file, file will be downloaded automatically.
How can i check which app trigger this action or how to prevent this download action??

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,680 questions
{count} votes

1 answer

Sort by: Most helpful
  1. wangfu 1 Reputation point
    2021-01-29T09:45:50.34+00:00

    Probably because some third-party context menu handler is trying to read the file when you right click it, thus triggering the download.

    How can i check which app trigger this action or how to prevent this download action??

    In
    OnFetchData
    callback, the
    callbackInfo->ProcessInfo->ImagePath
    will give you the full path of the app that triggers the download, see:
    https://github.com/microsoft/Windows-classic-samples/blob/master/Samples/CloudMirror/CloudMirror/FileCopierWithProgress.cpp#L279

    In
    OnFetchData
    , set
    CF_OPERATION_PARAMETERS.TransferData.CompletionStatus
    to a non-success status like
    STATUS_UNSUCCESSFUL
    will prevent the download, see:
    https://github.com/microsoft/Windows-classic-samples/blob/master/Samples/CloudMirror/CloudMirror/FileCopierWithProgress.cpp#L84

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.