How to get the method signatures for DShellFolderViewEvents

自闭症网瘾萝莉.ら 提交于 2021-01-29 21:56:09

问题


I'm trying to sink DShellFolderViewEvents using the ATL, and the only method I've been able to successfully subscribe to is DISPID_SELECTIONCHANGED. There appear to be many other events listed in the header shdispid.h, but I can't get them to fire. Not sure what I'm doing wrong (it might be ATL-related), but I thought perhaps I'm implementing event-handler functions with the wrong signatures (currently I'm just trying void functions with no arguments). The problem is that there doesn't appear to be documentation describing the DShellFolderViewEvents methods. Anyone know how to figure those out?


回答1:


You can look at the type library for shell32.dll to get the interface declaration. I used oleview.exe which comes with Visual Studio to open the DLL. The interface looks something like this:

 [
  uuid(62112AA2-EBE4-11CF-A5FB-0020AFE7292D),
  helpstring("Event interface for ShellFolderView")
]
dispinterface DShellFolderViewEvents {
    properties:
    methods:
        [id(0x000000c8), helpstring("The Selection in the view changed.")]
        void SelectionChanged();
        [id(0x000000c9), helpstring("The folder has finished enumerating (flashlight is gone).")]
        void EnumDone();
        [id(0x000000ca), helpstring("A verb was invoked on an items in the view (return false to cancel).")]
        VARIANT_BOOL VerbInvoked();
        [id(0x000000cb), helpstring("the default verb (double click) was invoked on an items in the view (return false to cancel).")]
        VARIANT_BOOL DefaultVerbInvoked();
        [id(0x000000cc), helpstring("user started to drag an item (return false to cancel).")]
        VARIANT_BOOL BeginDrag();
};


来源:https://stackoverflow.com/questions/59565282/how-to-get-the-method-signatures-for-dshellfolderviewevents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!