How to run power toy in hidden window?

Yen Dang 20 Reputation points

Dim p = New Process()

p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden

p.StartInfo.CreateNoWindow = True

p.Start("C:\Program Files\PowerToys\WinUI3Apps\PowerToys.Settings.exe")

After running this code, the setup window still appears.

Is there a way to run program quiet without using Find then ShowWindow(SW_HIDE)?

I want to avoid window flickering.

Thanks you!

Microsoft Technologies based on the .NET software framework.
3,605 questions
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,659 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 83,101 Reputation points

    The main executable is PowerToys.exe, in *C:\Program Files\PowerToys*

    It is launched as icon in System Tray (only displays the Settings dlg if already running)

    (at least with the last 0.81.1 version)

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 28,941 Reputation points Microsoft Vendor

    Hi @Yen Dang ,

    If the UseShellExecute property is true or the UserName and Password properties are not null, the CreateNoWindow property value is ignored and a new window is created.

    So you need to set p.StartInfo.UseShellExecute = False

    Best Regards.

    Jiachen Li

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments