Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Path and filename to process exefile

This topic is 5455 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

Hello everyone! I have encountered a problem with the WIN API for getting the list of processes in the system! It''s probably something quite obvious, but I can''t see it! In the PROCESSENTRY32 structure there is a member called szExeFile, that is supposed to be filled with path and filname of the process, but as I have discovered, only the filename is stored. I am using the Process32First and Process32Next functions for querying the list! I am hoping that somebody might enlighten me to what I am doing wrong, or if it is impossible(!!!) to get this information! I am running Windows XP, by the way! Thanks for your time! My game: Swift blocks

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
there''s a difference between a path and a fully qualified path.

i use the GetModuleFileNameEx function of the Process Status api (psapi.dll) and that always returns the fully qualified path for the executable, if you have the process''s handle and the exe''s module handle. calling EnumProcessModules and using the first (0th index) handle in the array will get the exe''s module handle. calling OpenProcess gets the process handle for a pid. and if you need to get the pid, GetWindowThreadProcessId will get the pid for an HWND.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!