由一个窗口句柄如何知道该窗口所属的文件!!!!!!!!!!!!!!

guhongye 2003-09-12 05:01:09
不是那个窗口所属的进程名而是那个象*.txt的某个文件名,有哪位高手有过这方面的经验吗,谢谢!
...全文
40 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
GX_NET 2003-12-05
  • 打赏
  • 举报
回复
getwindowthreadprocessid
openprocess
emenupreocessmodules
getmodulefilename


或者
getwindowmodulefilename

高手指点
如何能够通过exe文件名得到主窗口淂句柄呢?????
GX_NET 2003-12-05
  • 打赏
  • 举报
回复
gz
getmodulefilename 可以得到文件名
但是怎样通过窗口句柄来求就是个问题了,请指教
xiaohedou 2003-09-14
  • 打赏
  • 举报
回复
你看看这个:

The GetModuleFileName function retrieves the full path and filename for the executable file containing the specified module.

Windows 95: The GetModuleFilename function will return long filenames when an application抯 version number is greater than or equal to 4.00 and the long filename is available. Otherwise, it returns only 8.3 format filenames.

DWORD GetModuleFileName(

HMODULE hModule, // handle to module to find filename for
LPTSTR lpFilename, // pointer to buffer for module path
DWORD nSize // size of buffer, in characters
);

guhongye 2003-09-14
  • 打赏
  • 举报
回复
GetWindowText得到的是窗口标题名称,而GetModuleFileName得到是进程名,都不是文件名,难道真的没办法得到吗,我觉的不可能,继续好吗
Coold 2003-09-12
  • 打赏
  • 举报
回复
int GetWindowText(
HWND hWnd, // handle to window or control with text
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum number of characters to copy
);
Coold 2003-09-12
  • 打赏
  • 举报
回复
GetWindowText

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧