如何获得其它的运行程序的全路径?GetWindowModuleFileName?
问题点数:20、回复次数:7Top
1 楼SecretGarden(天堂鸟)回复于 2002-01-22 09:35:42 得分 0
自己都知道了,还问?Top
2 楼hugos(疯狂老鼠)回复于 2002-01-22 09:38:15 得分 0
GetWindowModuleFileName不好用!!
MSDN是这样说的:
If all this new HWND-related information wasn’t enough, there’s even more miscellaneous new APIs that retrieve information for a given HWND. GetWindowModuleFileName returns the name of a EXE or DLL that created a window. Be forewarned though; this API only works on HWNDs created by the process that called the API. This means it’s only of use for windows that your program created or within a systemwide hook procedure.
Top
3 楼lhj(努力加油)回复于 2002-01-22 09:38:29 得分 20
是的
但是你需要先EnumProcesses,列举出系统中的进程
再OpenProcess得到句柄
再EnumProcessModules,得到进程调用的模块
再GetWindowModuleFileName、GetWindowModuleFileNameEX得到模块的全路径名Top
4 楼masterz(www.fruitfruit.com)回复于 2002-01-22 09:38:30 得分 0
GetWindowModuleFileName这个函数只能获得本进程的窗口路径,不能获得其他进程窗口的路径。Top
5 楼hugos(疯狂老鼠)回复于 2002-01-22 09:43:31 得分 0
lhj(努力加油) 你说的应该是:GetModuleFileName、GetModuleFileNameEX吧 不是GetWindowModuleFileName、GetWindowModuleFileNameEXTop
6 楼hugos(疯狂老鼠)回复于 2002-01-22 10:05:06 得分 0
kao, 还是不行!!! 什么世道嘛Top
7 楼hugos(疯狂老鼠)回复于 2002-01-22 11:58:05 得分 0
GOT ITTop




