如何确定窗口句柄何时有效?

Sal*_*dor 16 delphi winapi

我正在编写一个DLL,它在特定窗口上进行一些操作,但有时传递的句柄无效.是否存在任何函数来验证传递的句柄是否有效(属于窗口)?

RRU*_*RUZ 28

尝试使用IsWindow在Windows单元中声明的函数.

function IsWindow(hWnd: HWND): BOOL; stdcall;
Run Code Online (Sandbox Code Playgroud)

  • +1.这是正确的答案.[`IsWindow`](http://msdn.microsoft.com/en-us/library/ms633528(v = vs.85).aspx)是Windows API的一个功能. (3认同)