Jump to content

Problem with Web Browser opening URL via ShellExecute

Recommended Posts

I created an application to catch keyboard programmed keys.  Some of the keys open URL's via ShellExecute and then they open in the default browser.

The problem I am having is that when the browser is opened in this manner 3rd party applications such as Logitech Setpoint for Logitech mouse and keyboards and programs like auto password form filling stop working with the browser.  In the mouse specific situation the Cruise Up and Cruise Down buttons, normally back and forward, do not work. If I open the browser manually via the browsers icon and then press the keyboard buttons to open the web page everything works normally.

I have two questions:

1:  Why does 


when the browser is not open and then is launched, via the above line, cause third party apps to not be able to interface with the browser?

2:  What is a better way to launch URL's if not via ShellExecute?

The application is NOT using #RequireAdmin and is not 64bit.

Link to comment
Share on other sites

I ended up changing the ShellExecute line to include the actual browser executable, this no longer opens the default browser and instead whatever executable I call directly but it fixes the issue with third party apps accessing the browser.

I do not understand why just entering the URL by itself without an executable causes this problem.

Link to comment
Share on other sites

Sorry, I can't answer your questions. However, you can open the link in your default browser by using _RunDos and windows URI:

#include <Process.au3>
_RunDos("start www.google.com")

Sometimes, you can use Windows URI to open URL(s) in specific browsers by:

;For Internet Explorer
_RunDos("start iexplore google.com ")
_RunDos("start iexplore google.com bing.com")

;For Firefox
_RunDos("start firefox google.com")
_RunDos("start firefox google.com bing.com")

;For Chrome with normal & incognito mode
_RunDos('start chrome google.com bing.com')
_RunDos('start chrome google.com bing.com google.com')
_RunDos('start chrome google.com bing.com --incognito "google.com"')
_RunDos('start chrome --new-window --incognito "google.com"')

I think this is just another way of ShellExecute, the difference is you type the whole dos command instead of filling them into parameters of ShellExecute function.

I haven't tried for Edge, since my computer is running Windows 7 🤣

Edited by LukeLe
edit URI for chrome browser
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...