Click here to Skip to main content
16,022,255 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to open a YouTube page with incognito mode
It opens but the code ignores the ProcessWindowStyle.Maximized
Will post code in What I have tried

What I have tried:

Using process As New Process()
    process.StartInfo.FileName = "chrome.exe"
    process.StartInfo.Arguments = webPAGE & " --incognito"
    process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
    process.Start()
End Using

chrome.exe lives here
'C:\Program Files\Google\Chrome\Application
Posted
Comments
Pete O'Hanlon 9-Jul-24 2:12am    
Are you trying to maximize it as in pressing F11 (Full Screen) maximize, or does Chrome start minimized?
Choroid 9-Jul-24 12:30pm    
Chrome starts in a size window that is NOT maximized
NOT really minimized SO thanks for the comment
See Richard Deeming Solution working with command line switches
whole new syntax. I guess it is like another language

1 solution

Try adding --start-maximized to the arguments.

You can find an exhaustive list of command-line switches for Chromium here:
List of Chromium Command Line Switches « Peter Beverloo[^]
 
Share this answer
 
Comments
Choroid 9-Jul-24 12:24pm    
Richard thanks so much this solved the issue
The sad thing is I did see that site you suggested but it is overwhelming my bad
The code structure is interesting double -- at the start and one - for subsequent commands here is my fix
Process.Start("chrome.exe", "-maximized --incognito " & webPAGE)
The Using process code was removed Great now only one line of code
Thanks one more time Richard

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900