패키지된 앱에 대한 레거시 상황에 맞는 메뉴 지원

상황에 맞는 메뉴는 가장 인기 있고 유용한 셸 확장 중 하나입니다. 이미 파일 탐색기 또는 데스크톱에 있는 경우 별도의 앱을 여는 것과 비교하여 파일 작업을 완료하는 단계 수가 크게 줄어듭니다.

데스크톱 앱이 상황에 맞는 메뉴 처리기 또는 끌어서 놓기 처리기와 같은 셸 확장에 대한 레거시 IContextMenu 인터페이스를 구현하는 경우 앱을 패키지한 후 셸 확장이 작동하지 않을 수 있습니다. 셸이 확장을 인식하고 등록하려면 패키지 매니페스트 파일을 수정해야 합니다. (이 기능은 현재 사용 가능한 Windows 11 빌드 22000 이상에서 사용할 수 있습니다 .Windows 참가자 빌드)

  • shellex dll에 대한 com 네임스페이스 및 windows.comServer 확장 추가

    xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"

    다음은 코드 조각 예제입니다.

    <com:Extension Category="windows.comServer">
        <com:ComServer>
            <com:SurrogateServer DisplayName="<display-name-for-the-com-server>">
                <com:Class Id="<GUID-for-the-com-server>" Path="<path-to-the-com-server-or-dll>" ThreadingModel="STA" />
            </com:SurrogateServer>
        </com:ComServer>
    </com:Extension>
    
  • desktop9 네임스페이스 및 windows.fileExplorerClassicContextMenuHandler 또는 windows.fileExplorerClassicDragDropContextMenuHandler 확장 추가

    xmlns:desktop9="http://schemas.microsoft.com/appx/manifest/desktop/windows10/9"

    다음은 코드 조각 예제입니다.

    <desktop9:Extension Category="windows.fileExplorerClassicContextMenuHandler">
        <desktop9:FileExplorerClassicContextMenuHandler>
            <desktop9:ExtensionHandler Type="*" Clsid="<GUID-for-the-com-server>" />
            <desktop9:ExtensionHandler Type=".txt" Clsid="<GUID-for-the-com-server>" />
            <desktop9:ExtensionHandler Type="Directory" Clsid="<GUID-for-the-com-server>" />
        </desktop9:FileExplorerClassicContextMenuHandler>
    </desktop9:Extension>
    
    <desktop9:Extension Category="windows.fileExplorerClassicDragDropContextMenuHandler">
        <desktop9:FileExplorerClassicDragDropContextMenuHandler>
            <desktop9:ExtensionHandler Type="Directory" Clsid="<GUID-for-the-com-server>" />
            <desktop9:ExtensionHandler Type="Drive" Clsid="<GUID-for-the-com-server>" />
        </desktop9:FileExplorerClassicDragDropContextMenuHandler>
    </desktop9:Extension>
    
  • MaxVersionTested를 10.0.21300.0보다 크게 변경

    다음은 코드 조각 예제입니다.

    <Dependencies>
        <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.21301.0" />
    </Dependencies>
    

참고 항목

레거시 IContextMenu 구현으로 기존 데스크톱 앱을 패키징하는 대신 셸 확장을 구현하는 경우 IExplorerCommand 인터페이스를 구현하고 desktop4:FileExplorerContextMenus를 대신 사용하는 것이 좋습니다. 자세한 내용은 여기를 참조하세요.