How to get the Executable name of a window

前端 未结 5 2111
闹比i
闹比i 2020-12-30 02:19

I try to get the name of executable name of all of my launched windows and my problem is that:

I use the method

UINT GetWindowModuleFileName(      
H         


        
5条回答
  •  忘掉有多难
    2020-12-30 02:55

    Aaah. I read the MSDN page at the bottom.

    From http://support.microsoft.com/?id=228469

    GetWindowModuleFileName and GetModuleFileName correctly retrieve information ab... GetWindowModuleFileName and GetModuleFileName correctly retrieve information about windows and modules in the calling process. In Windows 95 and 98, they return information about windows and modules in other processes. However, in Windows NT 4.0 and Windows 2000, since module handles are no longer shared by all processes as they were on Windows 95 and 98, these APIs do not return information about windows and modules in other processes.

    To get more information on Windows 2000, use the Process Status Helper set of APIs (known as PSAPI, see Psapi.h include file), available since Windows NT 4.0. APIs such as GetModuleFileNameEx and GetModuleBaseName offer equivalent functionality.

    Try using GetModuleFileNameEx instead.

提交回复
热议问题