WindowsVirtualDesktopHelper icon indicating copy to clipboard operation
WindowsVirtualDesktopHelper copied to clipboard

[Bug]: WVDH Window Appears In Alt+Tab

Open ptoshkov opened this issue 5 months ago • 6 comments

What happened?

Hello! Thanks for making the wonderful WVDH. I use it a lot.

I have noticed that when using WVDH 2.0, a window called "Windows Virtual Desktop Manager" appears when alt+tab is pressed.

Image

Additional information: the issue does not occur when using WVDH 1.7.

WVDH Version

2.0

Windows Version

Windows 11 Pro 24H2 build 26100.4351

Relevant log output


ptoshkov avatar Jun 29 '25 11:06 ptoshkov

Windows 10, same problem. Have to close this window manually

NSurtsev avatar Jul 22 '25 09:07 NSurtsev

Windows 11 Pro 24H2 (26100.4770) - same inconvenience

Evialroot avatar Jul 25 '25 02:07 Evialroot

Same here

Image

Windows 11

Sh00Fly avatar Aug 05 '25 12:08 Sh00Fly

Came to check if this was hopefully fixed but unfortunately it still happens.

I created this small AutoHotKey launcher script to launch the program and hide it from Alt + Tab /. Win + Tab

Run, "C:\Program Files (x86)\Windows Virtual Desktop Helper\WindowsVirtualDesktopHelper.exe"
Sleep, 2000 ; Waits 2 seconds for the program to fully start
WinHide, Windows Virtual Desktop Manager
ExitApp ; Exits the script after hiding the window

I placed the AHK script in my startup folder so it runs on startup.

Veri7ion avatar Aug 05 '25 14:08 Veri7ion

Thanks for this - I noticed this popped up as well recently. Don't know what windows changed but I am sure I can fix it...

dankrusi avatar Aug 06 '25 07:08 dankrusi

Came to check if this was hopefully fixed but unfortunately it still happens.

I created this small AutoHotKey launcher script to launch the program and hide it from Alt + Tab /. Win + Tab

Run, "C:\Program Files (x86)\Windows Virtual Desktop Helper\WindowsVirtualDesktopHelper.exe"
Sleep, 2000 ; Waits 2 seconds for the program to fully start
WinHide, Windows Virtual Desktop Manager
ExitApp ; Exits the script after hiding the window

I placed the AHK script in my startup folder so it runs on startup.

を参考に ps1スクリプトも置いておきます。

# launch_and_hide.ps1
# Windows Virtual Desktop Helperを起動してウィンドウを非表示にする

# 管理者権限で実行されているかチェック
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
    [Security.Principal.WindowsBuiltInRole] "Administrator")) {
    Write-Host "管理者権限が必要です。管理者権限で再実行します..." -ForegroundColor Yellow

    # PowerShell Coreが利用可能かチェック
    $pwshPath = (Get-Command pwsh -ErrorAction SilentlyContinue).Source
    $powershellExe = if ($pwshPath) { "pwsh" } else { "powershell" }

    Start-Process $powershellExe -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`""
    exit
}

Write-Host "Windows Virtual Desktop Helperを起動中..." -ForegroundColor Cyan

# Win32 APIの定義
if (-not ([System.Management.Automation.PSTypeName]'WinAPI').Type) {
    Add-Type @"
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Text;

public class WindowInfo {
    public IntPtr Handle;
    public string Title;
    public uint ProcessId;
    public bool Visible;
}

public class WinAPI {
    [DllImport("user32.dll")]
    public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    [DllImport("user32.dll")]
    public static extern bool EnumWindows(EnumWindowsProc proc, IntPtr lParam);
    [DllImport("user32.dll")]
    public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId);
    [DllImport("user32.dll")]
    public static extern bool IsWindowVisible(IntPtr hWnd);
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount);
    public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);

    private static List<WindowInfo> windows = new List<WindowInfo>();

    public static List<WindowInfo> GetWindowsByProcessId(uint processId) {
        windows.Clear();
        EnumWindows(delegate(IntPtr hWnd, IntPtr lParam) {
            uint pid;
            GetWindowThreadProcessId(hWnd, out pid);
            if (pid == processId) {
                StringBuilder title = new StringBuilder(256);
                GetWindowText(hWnd, title, 256);
                windows.Add(new WindowInfo {
                    Handle = hWnd,
                    Title = title.ToString(),
                    ProcessId = pid,
                    Visible = IsWindowVisible(hWnd)
                });
            }
            return true;
        }, IntPtr.Zero);
        return windows;
    }
}
"@
}

# プログラムを起動
Start-Process "C:\Program Files (x86)\Windows Virtual Desktop Helper\WindowsVirtualDesktopHelper.exe"

# ウィンドウが見つかるまで待機
Write-Host "ウィンドウの起動を待機中..." -ForegroundColor Yellow
Start-Sleep -Seconds 2

for ($i = 1; $i -le 10; $i++) {
    $proc = Get-Process -Name "WindowsVirtualDesktopHelper" -ErrorAction SilentlyContinue | Select-Object -First 1
    if ($proc) {
        $windows = [WinAPI]::GetWindowsByProcessId($proc.Id)

        # Virtual Desktopを含むウィンドウまたは表示可能なウィンドウを探す
        $target = $windows | Where-Object { $_.Title -like "*Virtual Desktop*" } | Select-Object -First 1
        if (-not $target) {
            $target = $windows | Where-Object { $_.Visible } | Select-Object -First 1
        }

        if ($target) {
            [WinAPI]::ShowWindow($target.Handle, 0) | Out-Null
            Write-Host "ウィンドウを非表示にしました: '$($target.Title)'" -ForegroundColor Green
            exit 0
        }
    }
    Start-Sleep -Milliseconds 500
}

Write-Host "ウィンドウが見つかりませんでした" -ForegroundColor Red

kailowbi avatar Nov 28 '25 02:11 kailowbi