X11 - IsWindow ? lazarus / 32-Linux ---------------------------------------------------------------------- Dibo · 2010-08-26 15:39 Hi, On windows, if I have handle to window (HWND), I can check if it exists calling function: IsWindow(window: HWND): Boolean Is there a similar function in X11? I'm looking in xlib, xutil units but I don't see anything interesting. I have some TWindow and I want check if it still exists. Now I'm calling some XEvent and checking for BadWindow X11 error code Regards and sorry for English ---------------------------------------------------------------------- theo · 2010-08-26 15:47 I wrote some code to list and activate top-level windows: http://www.theo.ch/lazarus/winlist.zip Maybe it helps. ---------------------------------------------------------------------- Dibo · 2010-08-26 18:03 I have not found exactly such a function but I use XGetWindowAttributes from your sources instead of checking events. At the end I'm Checking for BadWindow. It's good for me. Thanks ---------------------------------------------------------------------- theo · 2010-08-26 22:56 It should be easy. You get a list of all toplevel windows. This should be enough to check if a XID (HWND) exists: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Function IsWindow(XID:Cardinal):Boolean;var xwl:TXWindowList;beginxwl:=TXWindow List.Create;xwl.UpdateWindowList;Result:=xwl.WindowList.IndexOf(XID)>- 1;xwl.free;end; You can also check by window name. ---------------------------------------------------------------------- Dibo · 2010-08-27 08:17 Thanks!