Getting File Name of an application with handle
-
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
-
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
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
);