I want to find handle of a window whose title may be of type *.log where *.log could be temp.log, dummy.log etc.

I dont know the title but i know the extension of log type.

I know FindWindow API is used for finding the handle of the window but there we need to know the title name. So if i dont know anything about the window only knows the extension then how to retrieve the handle for the same using c++?

有帮助吗?

解决方案

You can use EnumWindows for top-level windows and and GetWindowText to retrieve the title.

PathMatchSpec should work for your pattern matching.

GetWindowText makes sure you don't "stall" if the process you are asking is not responding.

其他提示

Haven't use the WinAPI for years, but if memory serves me, there is an EnumWindows function that you use in such a case.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top