locked
How to get all files in a folder without using getNeighboringFiles API(New in windows 8.1) RRS feed

  • Question

  • Hi all,

    I'm building an image management app now which is similar to Microsoft Photo viewer. I applied the new windows 8.1 api--getNeighboringFiles to get all the files under a specific folder. However, it doesn't work under some situation. For example, when I intended to get all the photos under pictureLibrary using cloud service(drives, dropbox ect.), it can only get one file which I opened, and the neighboring file returned null. I tried the same situation in MS photo, it works fine(can get all the photos in that folder). So, I'm just wondering if there is another way or api to do that. Thanks.

    Monday, April 21, 2014 10:24 AM

Answers

  • In what context are you trying to use it?

    GetNeighboringFiles only works on files the app is launched with when the app is launched by the useropening a file the app is the registered handler for. It isn't needed for files in the pictures library, since an app with that capability can already read the other files there.

    --Rob

    Monday, April 21, 2014 2:46 PM
    Moderator
  • I it's Pictures library then you can get access with the pictures library capability. You don't need neighboring files.

    If you're launching from within another app then that app would need to provide the neighboring files.

    --Rob

    Wednesday, April 23, 2014 10:38 PM
    Moderator

All replies

  • In what context are you trying to use it?

    GetNeighboringFiles only works on files the app is launched with when the app is launched by the useropening a file the app is the registered handler for. It isn't needed for files in the pictures library, since an app with that capability can already read the other files there.

    --Rob

    Monday, April 21, 2014 2:46 PM
    Moderator
  • Thank you Rob,

    Yes, you are absolutely right. My App can read all the files in the Pictures Library in common situation. But when I installed another app such as Dropbox, I could also see all the images of Picture Library using Dropbox, right? What I did is, I click on the image in dropbox which is a local Picture Library image, and then click on the 'Openwith' button to select my own app to view that image. What I want to do is, my app could show all the images in Picture Library. But it only display one. I added breakpoint to see the neighboringFiles, it was null. So, I think that's the reason why it can only show one picture in my app. In this case, I think I should figure out another way to get all the pictures instead of getNeighboringFiles. 

    --Noah

    Wednesday, April 23, 2014 1:10 PM
  • I it's Pictures library then you can get access with the pictures library capability. You don't need neighboring files.

    If you're launching from within another app then that app would need to provide the neighboring files.

    --Rob

    Wednesday, April 23, 2014 10:38 PM
    Moderator