From 20c5615d1317f0ae210247e1bf2189758e7a0cd0 Mon Sep 17 00:00:00 2001 From: kjqwer <2990346238@qq.com> Date: Thu, 26 Feb 2026 06:49:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=92=AD=E6=94=BE=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MediaControl.exe | Bin 35328 -> 35328 bytes MediaControl.ps1 | 3 ++- get_current_window_process.bat | 26 ++++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 get_current_window_process.bat diff --git a/MediaControl.exe b/MediaControl.exe index ae83e28ebc5322e0e67f09f213cefc853c236df0..e9b0633dbe7ea3e07e19ed1ad7114b495e32fdd9 100644 GIT binary patch delta 182 zcmZpe!qhN@X+j6{>FW6tyJZ>UCaw(U;vLKT%lf2sG#73>n0Za}ujMAGY%0+Sr=)=w@Mi#m1q=)`SSBh8PgZ1%XAGI#$XG9E zFdrnrz~BMIObo0H3nmLP2{ZAjO)hNI+8n^-Aj8PDd7@k-$L8N^TV*$|ciC$y@O9Zq z@j7)oj|KZ{>W@r$;(3e+HwVRj(4!bC+eMuW+wjW;JdFbZtuYx>2?6kxwu Lu;V@BL<4pJ(DE@! diff --git a/MediaControl.ps1 b/MediaControl.ps1 index 7540c84..b253532 100644 --- a/MediaControl.ps1 +++ b/MediaControl.ps1 @@ -62,7 +62,8 @@ function Test-MediaPlayerRunning { "QQMusic", "Microsoft.Media.Player", "PotPlayerMini64", - "MusicPlayer" + "MusicPlayer", + "AIMP" ) foreach ($player in $mediaPlayers) { diff --git a/get_current_window_process.bat b/get_current_window_process.bat new file mode 100644 index 0000000..29265ee --- /dev/null +++ b/get_current_window_process.bat @@ -0,0 +1,26 @@ +@echo off +chcp 65001 >nul +echo 正在获取当前活动窗口的进程信息... +echo. + +echo 当前系统中有窗口的所有进程: +echo =============================== +echo. + +REM 显示所有有窗口的进程 +powershell "Get-Process | Where-Object {$_.MainWindowTitle -ne ''} | Select-Object Id,ProcessName,MainWindowTitle,@{Name='Memory(MB)';Expression={[math]::Round($_.WorkingSet64/1MB,2)}} | Format-Table -AutoSize" + +echo. +echo =============================== +echo 提示: 上面列出的是所有有活动窗口的进程 +echo 当前最前端的窗口通常是最近使用的进程 +echo. + +REM 使用简单的PowerShell命令获取进程详细信息 +echo 详细进程信息: +echo =============================== +powershell "Get-Process | Where-Object {$_.MainWindowTitle -ne ''} | ForEach-Object { Write-Host ('进程: ' + $_.ProcessName + ' (ID: ' + $_.Id + ')') -ForegroundColor Green; Write-Host ('窗口: ' + $_.MainWindowTitle) -ForegroundColor Yellow; Write-Host ('路径: ' + $_.Path) -ForegroundColor Cyan; Write-Host '---' }" + +echo. +echo 按任意键继续... +pause >nul \ No newline at end of file