hi, it is possible to open a http page in a default browser (chrome)?
szAction CSTRING('open')
szUrl CSTRING(LEN(CLIP(url))+1), AUTO
CODE
szUrl = CLIP(url)
ShellExecute(0, szAction, szUrl, 0, 0, SW_SHOWNORMAL)
4 Likes
Hi, Think you for syour support, i have a error when compiling in Shellexecute
hi, shellexecute if a clarion fonction?
Maybe look at this Topic for more details:
Try this one …
I was thinking of starting the default web browser when I start a locally run nettalk web server.
BUT I wanted to launch using the -app= option and I couldn’t figure out how to do that with shellexecute.
So, this codes gets the default web browser command line and then adds the -app= into the mix and executes it. (Uses WinEvent and StringTheory)
! Get the default Browser Command Line
ProgID = ds_getReg(WE::WM_HKEY_CURRENT_USER,'Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice','ProgId')
LaunchCmd = ds_getReg(WE::WM_HKEY_CLASSES_ROOT,clip(ProgID) & '\shell\open\command','')
! Build CommandLine and Run
! Launch command contains the path to the EXE in Quotes
stc.setvalue(LaunchCmd)
! Trim off First Character which is a "
stc.Crop(2,0)
! Get value from Start to the end "
commandLine = stc.Before('"',,,0)
Parameters = command(1) ! Second Element - I was passing my URL for testing
! Test: Parameters = 'https://www.clarionhub.com'
if lower(left(Parameters,4)) = 'http' THEN
! we need to add -app=
Parameters = '-app=' & clip(Parameters)
END
commandLine = clip(commandLine) & ' ' & clip(Parameters)
run(clip(commandLine))
1 Like