[kde-linux] KDE Question

Tony Bloomfield tonyb.lx at btinternet.com
Thu Apr 20 08:49:29 UTC 2006


On Wednesday 19 April 2006 15:36, Washington, ML Marvin @ IS wrote:
> All,
>
> Does anyone know of a KDE method for getting/searching all the windows on a
> desktop and access to the window ID and/or window title?
>

I use the following; don't know if it'll do what you want.

#include <kwin.h>
#include <kwinmodule.h>
#include <qvaluelist.h>

void init() {
  KWinModule kw(0);
  QValueList<WId> wl = kw.windows();
  for (int i = 0; i < wl.count(); i++) {
    KWin::WindowInfo winf = KWin::windowInfo(wl[i]);
    qDebug ("Window id %d, name %s", (int)wl[i], winf.visibleName().latin1());
  }
}

-- 

Cheers,
TonyB



More information about the kde-linux mailing list