문제

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