8

In Windows, is there a straightforward way to get the full path of a file, given only the file's handle?

I can't use GetFinalPathNameByHandle() because that's Vista+ only and our product has to work on XP. However, something that simple, or close to it, would be best.

0

1 Answer 1

9

Here you go: Obtaining a File Name From a File Handle

3
  • 1
    Thank you. I was aware of that technique (I guess I should have mentioned that - I apologize for the omission) and was hoping for something a little cleaner, but I guess there isn't such a thing. At least now I know that. However, I appreciate you taking the time.
    – Wilson F
    Oct 8, 2009 at 21:35
  • Is there a solution for applications that are supposed to target XP as well? Jan 1, 2013 at 14:34
  • 1
    Did you read the article? It shows how to do it for versions earlier than Vista, which includes XP. Jan 1, 2013 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.