Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Process Module Name

Process Module Name

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    How can I get the file name of a module having an HWND or ProcessID. I need it in an Win95 application. I can not use GetWindowsModuleFileName() because is not compatible on Win95. Please help !

    L 1 Reply Last reply
    0
    • L Lost User

      How can I get the file name of a module having an HWND or ProcessID. I need it in an Win95 application. I can not use GetWindowsModuleFileName() because is not compatible on Win95. Please help !

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Here's something that may help: Use CreateToolhelp32Snapshot to get a (handle) to a snapshot of the processes etc., then traverse the processes using Process32First and Process32Next (using the handle returned by CreateToolhelp32Snapshot and a PROCESSENTRY32 structure). The PROCESSENTRY32 structure has a member called: szExeFile which will contain the path and filename of the executable file for the process. In your case, if you have a ProcessID, you could compare it to the th32ProcessID member of the PROCESSENTRY32 structure (or th32ParentProcessID) to isolate the process you are after, and then use the szExeFile member. See 'Tool Help Library' in MSDN library, and go to Using the Tool Help Functions --> Taking a Snapshot and Viewing Processes It appears that THL is Win 95/98/NT/2000 compliant. Hope that helps. ================== The original message was: How can I get the file name of a module having an HWND or ProcessID. I need it in an Win95 application.
      I can not use GetWindowsModuleFileName() because is not compatible on Win95.

      Please help !

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups