Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Bestimmt die Eigenschaften aller ofener Fenster
- Func crys_cmini_info()
- $aWL = WinList()
- $anzahl = 14
- ;dim $liste[$aWL[0][0]][$anzahl]
- dim $liste[1][$anzahl]
- ;_ArrayDisplay($aWL, "WinList()")
- ;exit
- $liste[0][0] = "Fenstertitel"
- $liste[0][1] = "Fenster-ID"
- $liste[0][2] = "Pos-x"
- $liste[0][3] = "Pos-y"
- $liste[0][4] = "Breite"
- $liste[0][5] = "Höhe"
- $liste[0][6] = "existiert"
- $liste[0][7] = "sichtbar"
- $liste[0][8] = "freigegeben"
- $liste[0][9] = "aktiv"
- $liste[0][10] = "minimiert"
- $liste[0][11] = "maximiert"
- $liste[0][12] = "Monitor 1"
- $liste[0][13] = "Monitor 2"
- ;if $debug = 1 then _ArrayDisplay(_GetMonitorInfo(), "_GetMonitorInfo()")
- $mon = _GetMonitorInfo()
- dim $monitor[$mon[0][0]+1][4] = [["x-start", "y-start", "x-breite", "y-höhe"]]
- for $x = 1 to $mon[0][0]
- $monitor[$x][0] = $mon[$x][2]
- $monitor[$x][1] = $mon[$x][3]
- $monitor[$x][2] = $mon[$x][0]
- $monitor[$x][3] = $mon[$x][1]
- next
- if $debug = 1 then _ArrayDisplay($monitor, "Bildschirm Abmasse:")
- For $i = 1 To $aWL[0][0]
- $name = $aWL[$i][1]
- $size = WinGetPos($name)
- if IsArray($size) = 0 then
- MsgBox(16, $name, "WinGetPos() ist kein Array!")
- exit
- endif
- ;MsgBox(0, $name, "Die Koordinaten des aktuellen Fensters lauten (x, y, Breite, Höhe):" & @CR & $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])
- $status_id = WinGetState($aWL[$i][1], "")
- $status = ""
- dim $status_wert[6]
- dim $wert[6] = [1,2,4,8,16,32]
- dim $werte[6] = ["existiert", "sichtbar", "freigegeben", "aktiv", "minimiert", "maximiert"]
- for $n=5 to 0 step -1
- if $status_id-$wert[$n] >= 0 then
- $status_id = $status_id-$wert[$n]
- ;$status = $status & " " & $werte[$n]
- $status_wert[$n] = 1
- endif
- next
- ; Fenster muss eine Größe haben und einen Titel
- if ($size[2]*$size[2]) > 0 and $aWL[$i][0] <> "" then
- ; Fenster muss sichtbar sein
- if $status_wert[1] = 1 then
- ; Ausnahmen definieren
- if $aWL[$i][0] <> "Start" and $aWL[$i][0] <> "Program Manager" and $aWL[$i][0] <> "AMD:CCC-AEMCapturingWindow" then
- $y = UBound($liste)
- ReDim $liste[$y+1][$anzahl]
- $liste[$y][0] = $aWL[$i][0]
- $liste[$y][1] = $aWL[$i][1]
- $liste[$y][2] = $size[0]
- $liste[$y][3] = $size[1]
- $liste[$y][4] = $size[2]
- $liste[$y][5] = $size[3]
- $liste[$y][6] = $status_wert[0]
- $liste[$y][7] = $status_wert[1]
- $liste[$y][8] = $status_wert[2]
- $liste[$y][9] = $status_wert[3]
- $liste[$y][10] = $status_wert[4]
- $liste[$y][11] = $status_wert[5]
- $ueberhang = 8 ; Was maximierte Fenster auf den anderen Bildschirm überhängen
- for $x = 1 to $mon[0][0]
- if $size[0] >= $monitor[$x][0]-$ueberhang and $size[0]+$size[2] <= $monitor[$x][0]+$monitor[$x][2]+$ueberhang then
- $liste[$y][11+$x] = 1
- endif
- ;MsgBox(0, "monitor "&$x+1, $size[0] & " >= " & $monitor[$x][0]&" - "&$ueberhang&" and "&$size[0]&" + "&$size[2]&" <= "&$monitor[$x][0]&" + "&$monitor[$x][2]&" + "&$ueberhang )
- next
- endif
- endif
- endif
- Next
- if $debug = 1 then _ArrayDisplay($liste, "Liste der relevanten offenen Programme:")
- return $liste
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement