[Gambas-user] R: My programm name of process - "xprop"
Ru Vuott
vuott at ...325...
Sat Oct 6 00:24:27 CEST 2012
By using "xprop", you can choose the window of program via mouse !
> 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
>
More information about the User
mailing list