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.

Wilson F
  • 1,250
  • 1
  • 20
  • 37

1 Answers1

9

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

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 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 08 '09 at 21:35
  • Is there a solution for applications that are supposed to target XP as well? – Sabre Runner Jan 01 '13 at 14:34
  • 1
    Did you read the article? It shows how to do it for versions earlier than Vista, which includes XP. – Remy Lebeau Jan 01 '13 at 17:44