質問

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