Another possibility with "xprop" and DesktopWindows class.
It need to activate gb.desktop.

***************************

Private i As Integer


Public Sub Form_Open()  
 
Dim pr As Process  
Dim ss, x As New String[]  
Dim s, y As String  
Dim j As Byte  
 
 pr = Shell "xprop | grep -i window" For Read  
  
 
 While Not Eof(pr)  
   Input #pr, s  
   If s < Chr(40) Then Continue  
   ss.Add(s)  
 Wend  
 
 
For j = 0 To ss.Max  
    
  If ss[j] = "_NET_WM_USER_TIME_WINDOW(WINDOW):" Then  

    x = Split(ss[j + 3], "x")  
    y = Right(ss[j + 7], 2)  

    i = Val("&" & x[1]) - Val("&" & y)  
  Endif  
    
Next  
 
End
 
 
Public Sub Button1_Click()  
 
Dim dw As DesktopWindow  
 
 
  dw = New DesktopWindow(i)  
 
' it closes the windows:
   dw.Close
 
End

******************************++


It works for me !

bye
vuott






> > It seems to me the problem was: e.g. I have 3 running
> gambas program:
> >
> > a.gambas
> > b.gambas
> > c.gambas
> >
> > Their process name in (/proc/pid_num/comm) is same. But
> I can identify
> > them via "/proc/pid_num/cmdline" and so identify easly
> the PID.
> >
> >
> > BUT if the case is:
> >
> > a.gambas
> > a.gambas
> > a.gambas
> >
> > ....this is - in my opinion - another problem:
> difficult.
> >
> > bye
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't let slow site performance ruin your business.
> Deploy New Relic APM
> > Deploy New Relic app performance management and know
> exactly
> > what is happening inside your Ruby, Python, PHP, Java,
> and .NET app
> > Try New Relic at no cost today and get our sweet Data
> Nerd shirt too!
> > http://p.sf.net/sfu/newrelic-dev2dev
> > _______________________________________________
> > Gambas-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy
> New Relic APM
> Deploy New Relic app performance management and know
> exactly
> what is happening inside your Ruby, Python, PHP, Java, and
> .NET app
> Try New Relic at no cost today and get our sweet Data Nerd
> shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Gambas-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> 

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to