Advertisement Jump to content
Sign in to follow this  
stroma

program's directory

This topic is 4967 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi guys, i am making a screen saver and i know that data files that the program uses should be in "windows" directory. so i want to make the paths with the exe's directory at the beginning of the program. i mean i want to use "path+data/abc.bmp" so that path will be the exe's directory and no need to add files to windows directory. get it? how can i get the running program's folder? can i make something else for a screen saver in windows? thank you..

Share this post


Link to post
Share on other sites
Advertisement
Use GetModuleFileName and remove the exe-filename. That's 100% always the path your exe is in.

BTW, it'd probably be nice for the user if you don't put your resources in the windows folder too, but in a separate place.

Share this post


Link to post
Share on other sites
Quote:
Original post by stromahow can i get the running program's folder?


_getcwd but since you are using Windows API for sure, I'd go with Endurion's suggestion.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!