Using SHFileOperation within a Windows service

后端 未结 4 1020
鱼传尺愫
鱼传尺愫 2021-01-21 23:19

It\'s possible, but is it appropriate to use SHFileOperation within a Windows service? All those SHxxx API functions in shell32.dll seem to have been written with user level pr

4条回答
  •  野性不改
    2021-01-21 23:58

    I would say, not it's not appropriate or advisable. Most of the shell32 APIs were written with a basic understanding that they would be used in interactive processes. I don't think there is any way you can guarantee that SHFileOperation will never display a UI component. In fact, if you look at IFileOperation (which is the new Vista interface that replaces SHFileOperation), it clearly states:

    Exposes methods to copy, move, rename, create, and delete Shell items as well as methods to provide progress and error dialogs. This interface replaces the SHFileOperation function.

提交回复
热议问题