Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!uunet!mcsun!ukc!harrier.ukc.ac.uk!rlh2 From: rlh2@ukc.ac.uk (Richard Hesketh) Newsgroups: comp.windows.x Subject: How can I check for a valid Window id? Message-ID: <3103@harrier.ukc.ac.uk> Date: 14 Nov 89 14:32:03 GMT Reply-To: rlh2@ukc.ac.uk (Richard Hesketh) Organization: Computing Lab, University of Kent at Canterbury, UK. Lines: 36 I have a window id. obtained via various means, in most cases from a property on the root window and I wish to check whether that window still exists in the server. Looking at the Xlib manual in Chapter 4 I find: 4.1 Obtaining Window Information [ ... ] Because they are most frequently used by window managers, these functions all return a status to indicate whether the window still exists. -- Ah, ha. Just what I need!? The manual does not explicity say that the following requests can generate BadWindow errors (I want my program to be informed of any bad windows synchronously): XQueryTree() and XGetGeometry(). I would like the status to be set to indicate the window doesn't exist. Unforturnately all these still generate BadWindow errors. From my reading of section 4.1 if a bad Window is passed then it should return a Status of 0 (failure). Should this be happening? Is it dependent on the Server I am connecting to? Do I have to trap the error using an error handler? If I do have to install an error handler how can I re-install the previous error handler if one had been installed (*I* cannot know about previous handlers that may have been installed)? Thanks, Richard Richard Hesketh : rlh2@ukc.ac.uk ..!mcvax!ukc!rlh2 : @nsfnet-relay.ac.uk:rlh2@ukc.ac.uk --- Computing Lab., University of Kent at Canterbury, Canterbury, Kent, CT2 7NF, United Kingdom. Tel: (0227) 764000 ext. 3682