Get the handle of a window with not fully known title. (C#)

后端 未结 3 1596
太阳男子
太阳男子 2021-01-01 02:57

The title is partially static with an variable suffix. For example \"Window Title {- user_id}\".

How can I get the handle without knowing the exact title?

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 03:07

    This CodeProject article describes how to enumerate Top level windows (Based on Win32 API EnumWindows). You can easily modify it to filter on a partial window title: Modify EnumWindowsCallBack.

    HTH.

提交回复
热议问题