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. Executable's Name

Executable's Name

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • S Offline
    S Offline
    ShankarPS
    wrote on last edited by
    #1

    Is it possible to get executable's name using it's handle?

    M 1 Reply Last reply
    0
    • S ShankarPS

      Is it possible to get executable's name using it's handle?

      M Offline
      M Offline
      Member 162462
      wrote on last edited by
      #2

      Use This DWORD GetModuleFileNameEx( HANDLE hProcess, // handle to process HMODULE hModule, // handle to module LPTSTR lpFilename, // path buffer DWORD nSize // maximum characters to retrieve ); DWORD GetModuleFileName( HMODULE hModule, // handle to module LPTSTR lpFilename, // file name of module DWORD nSize // size of buffer ); ~Rahuraman.K

      S 1 Reply Last reply
      0
      • M Member 162462

        Use This DWORD GetModuleFileNameEx( HANDLE hProcess, // handle to process HMODULE hModule, // handle to module LPTSTR lpFilename, // path buffer DWORD nSize // maximum characters to retrieve ); DWORD GetModuleFileName( HMODULE hModule, // handle to module LPTSTR lpFilename, // file name of module DWORD nSize // size of buffer ); ~Rahuraman.K

        S Offline
        S Offline
        ShankarPS
        wrote on last edited by
        #3

        Thanks, GetModuleFileNameEx works but again it needs processid.

        B 1 Reply Last reply
        0
        • S ShankarPS

          Thanks, GetModuleFileNameEx works but again it needs processid.

          B Offline
          B Offline
          Blake Miller
          wrote on last edited by
          #4

          Okay, so call GetCurrentProcessId() first.

          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