记事本和Word,如何根据当前的窗口获取该窗口打开的文件句柄?
最近在写API Hook,已经钩取了关闭窗口时所调用的DestroyWindow系统调用。系统调用DestroyWindow时会传入当前待关闭窗口的句柄,所以我想根据该句柄获取其打开的文件句柄,但不知怎么写,求大神指点,感激不尽!!
[解决办法]
FindWindow
The FindWindow function retrieves a handle to the top-level window whose class name and window name match the specified strings. This function does not search child windows. This function does not perform a case-sensitive search.
To search child windows, beginning with a specified child window, use the FindWindowEx function.
HWND FindWindow(
LPCTSTR lpClassName, // class name
LPCTSTR lpWindowName // window name
);
Parameters
[解决办法]