2

Does anyone know how to get a window icon by PID in Linux? Me interest only examples on C++ with Xlib or on Java with JNA.

PS. Excuse me for my English.

Sworfly
  • 31
  • 4
  • 6
    PIDs don't have window icons, and one process (e.g. pid) may have multiple windows, or none at all - Linux is not a natively graphical system. There will be plenty of PIDs that have absolutely nothing to do with the Xwindow system and have no windows, period. – Marc B Aug 03 '12 at 19:10
  • 2
    Yes, I understand it. And I precisely know that necessary process has a one or more windows. – Sworfly Aug 03 '12 at 19:21
  • 1
    I think what Marc wanted to express was that if PID's aren't necessarily associated with any particular window there probably won't be any standard way to obtain a window icon from a PID. – Cubic Aug 03 '12 at 19:42

1 Answers1

0

You could use GTK, loop through open windows, check their PID and grab the icon from the window:

How to get icon/icon's path of running app in linux/windows?

Community
  • 1
  • 1
Chozabu
  • 1,015
  • 1
  • 10
  • 33