[Mono-list] problems with Wnck-sharp
leonel.florin at cfg.jovenclub.cu
leonel.florin at cfg.jovenclub.cu
Tue Mar 6 16:10:02 UTC 2012
Hi everyone:
I'm using the Wnck library in a program of monitoring, to extract the opened windows
on the Gnome desktop, the goals of this programs is to control the application that
my students open in the computer class.
I obtain the opened window with this example
using Wnck;
using Gdk;
using System.Diagnostics;
using System.IO;
using System.Threading;
namespace GetWindowsListFromC
{
class MainClass
{
public static void Main (string[] args)
{
Gdk.Global.InitCheck (ref args);
Wnck.Screen.Default.ForceUpdate ();
Wnck.Screen.Default.ForceUpdate ();
while (true) {
foreach (Wnck.Window item in Wnck.Screen.Default.Windows) {
Console.WriteLine ("Window Name = " + item.Application.Name);
}
Wnck.Screen.Default.ForceUpdate ();
Thread.Sleep (2000);
}
}
}
}
all this work good, but, when pass tow second I retrieved the same list of opened
windows even if open an other windows or close one of the previews opened windows.
Is anyone knows work with Wnck-sharp and could help me, please I will wait.
More information about the Mono-list
mailing list