How do you obtain Current Window Handle Count and Window Handle Limit in .NET?

前端 未结 3 1076
时光说笑
时光说笑 2021-02-08 14:46

I want to obtain the current number of window handles and the system-wide window handle limit in C#. How do I go about this?

3条回答
  •  余生分开走
    2021-02-08 15:40

    As Raymond Chen put it some time ago, if you're thinking about window handle limits, you're probably doing something wrong :)

    Anyway, I bet there's no special C# way to do it, because it's very system-specific. You can use the same functions that you would use in a C++ application. Call the functions using P/Invoke. To learn how to write the imports, go to pinvoke.net.

    Edit: As I understand your question, I assume you already know how to do that in a Win32 application.

提交回复
热议问题