Solved

Window handle valid

Posted on 2002-03-05
3
653 Views
Last Modified: 2008-03-10
I have obtained a handle to another window, if I after sometime wants to know if the window is still alive, how do I achieve that ?

Is there some IsHandleValid API ?
0
Comment
Question by:bnz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Expert Comment

by:CrazyOne
ID: 6841841
Just make a recall of how you retrieved the handle in the first place. If the Window was closed and then reopened it will have a new handle anyway. I my opinion a Window handle should be used as soon as you get the handle and not using it at a later time because things can happen quickly that the handle you have may of expired, at least for that window.
0
 

Accepted Solution

by:
ms99 earned 100 total points
ID: 6841848
Try isWindow:

if isWindow(Handle) then begin
  // the window still exists
end;

0
 
LVL 20

Expert Comment

by:Madshi
ID: 6846754
IsWindow is correct.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question