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. Visual Basic
  4. Getting File Name of an application with handle

Getting File Name of an application with handle

Scheduled Pinned Locked Moved Visual Basic
helpquestionjson
2 Posts 2 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.
  • B Offline
    B Offline
    bjwoodburn
    wrote on last edited by
    #1

    Hi, Problem: Does anyone know of a way to retrieve the full path and file name of an application with just the handle to the window? I have called the API function "FindWindow" to retrieve the handle: Dim lngRet as Long lngRet = FindWindow(vbNullString, "MyTitle") But how can I obtain further from this? Help Please!!! :confused: Brian Woodburn

    K 1 Reply Last reply
    0
    • B bjwoodburn

      Hi, Problem: Does anyone know of a way to retrieve the full path and file name of an application with just the handle to the window? I have called the API function "FindWindow" to retrieve the handle: Dim lngRet as Long lngRet = FindWindow(vbNullString, "MyTitle") But how can I obtain further from this? Help Please!!! :confused: Brian Woodburn

      K Offline
      K Offline
      Konstantin Vasserman
      wrote on last edited by
      #2

      Given a window handle you should be able to use GetWindowModuleFileName API. However, it does not appear to work on Win95, only 98 or later.

      UINT GetWindowModuleFileName(
      HWND hwnd, // handle to window
      LPTSTR lpszFileName, // file name buffer
      UINT cchFileNameMax // max size of file name buffer
      );

      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