0 out of 2 rated this helpful - Rate this topic

GetWindowModuleFileName function

Applies to: desktop apps only

Retrieves the full path and file name of the module associated with the specified window handle.

Syntax

UINT WINAPI GetWindowModuleFileName(
  __in   HWND hwnd,
  __out  LPTSTR lpszFileName,
  __in   UINT cchFileNameMax
);

Parameters

hwnd [in]

Type: HWND

A handle to the window whose module file name is to be retrieved.

lpszFileName [out]

Type: LPTSTR

The path and file name.

cchFileNameMax [in]

Type: UINT

The maximum number of characters that can be copied into the lpszFileName buffer.

Return value

Type:

Type: UINT

The return value is the total number of characters copied into the buffer.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

Unicode and ANSI names

GetWindowModuleFileNameW (Unicode) and GetWindowModuleFileNameA (ANSI)

See also

Windows Overview

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
more info.
here more info about this function http://msdn.microsoft.com/en-us/library/ms683197%28v=vs.85%29.aspx
GetWindowModuleFileName & GetModuleFileName Work Only with the Calling Process
It doesn't work for other processeses on Windows 2000, XP and Vista. See http://support.microsoft.com/?id=228469.