Skip to content

Commit

Permalink
fix: 窗口排序优化,同名进程放一起
Browse files Browse the repository at this point in the history
  • Loading branch information
snomiao committed Dec 13, 2021
1 parent a1e1201 commit 7c6afcf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Modules/03.1-插件-窗口增强.ahk
Expand Up @@ -160,7 +160,9 @@ WindowsListOfMonitorFast(arrangeFlags, MonitorIndex := 0){
continue
}
}
windowsMatches .= "ahk_pid " this_pid " ahk_id " hWnd "`n" ; . "`t" . this_title . "`n"
WinGet, this_exe, ProcessName, ahk_id %hWnd%
windowsMatches .= "ahk_exe " this_exe " ahk_id " hWnd "`n" ; . "`t" . this_title . "`n"
; windowsMatches .= "ahk_pid " this_pid " ahk_id " hWnd "`n" ; . "`t" . this_title . "`n"
}
return windowsMatches
}
Expand Down Expand Up @@ -233,7 +235,10 @@ WindowsListOfMonitor(arrangeFlags, MonitorIndex := 0){
if ( this_class == "ApplicationFrameWindow") {
Continue
}
windowsMatches .= "ahk_pid " this_pid " ahk_id " hWnd "`n" ; . "`t" . this_title . "`n"

WinGet, this_exe, ProcessName, ahk_id %hWnd%
windowsMatches .= "ahk_exe " this_exe " ahk_id " hWnd "`n" ; . "`t" . this_title . "`n"
; windowsMatches .= "ahk_pid " this_pid " ahk_id " hWnd "`n" ; . "`t" . this_title . "`n"
}
return windowsMatches
}
Expand Down Expand Up @@ -312,7 +317,7 @@ ArrangeWindows(arrangeFlags = "0"){
loop %MonitorCount% {
MonitorIndex := A_Index
listOfWindow_%MonitorIndex% := WindowsListOfMonitor(arrangeFlags, MonitorIndex)
Sort listOfWindow_%MonitorIndex%
Sort listOfWindow_%MonitorIndex%, R
}
; 位置调整
loop %MonitorCount% {
Expand Down

0 comments on commit 7c6afcf

Please sign in to comment.