Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GetWindowModuleFileName function

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 [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

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

 

 

Show:
© 2017 Microsoft