I believe in respecting a users choice of PDF editor. PDF editors might be changed now and then and there'll always be the odd user who uses something else as what's assumed.
Therefore personally I use the ShellExectute() API command to open a PDF file with whichever "default" has been configured in windows for viewing:
Local External function declaration:
Function long ShellExecute( long hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, integer nShowCmd) Library "shell32.dll" alias for "ShellExecuteW"
Call to open a (pdf) file:
setnull(ls_null)
ll_handle = Handle(Parent)// setnull(ll_handle) //
ShellExecute( ll_handle, 'Open', ls_filename, ls_null, ls_applicationDir, 1)
In previous example, "Handle(parent)" is the handle to the "window".
The last parameter determines how to open the associated application: last used, maximized, etc.
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutew
To obtain information about the application that is launched as a result of calling ShellExecute, use ShellExecuteEx.
regards
This code works great for Windows10!
The default browser opens, not IE.
Function long ShellExecute( long hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, integer nShowCmd) Library "shell32.dll" alias for "ShellExecuteW"
String ls_null
setnull(ls_null)
Long ll_handle
ll_handle = Handle(Parent) // ll_handle = Handle(mdiframe) // setnull(ll_handle)
ShellExecute( ll_handle, "Open", "https://...", ls_null, "", 1)
ShellExecute( ll_handle, 'Open', 'https://...', ls_null, '', 1)
Please have a look at: https://community.appeon.com/index.php/qna/q-a/shellexecutew
Sometimes 'Open' is not the correct parameter. I have image files associated to ms-paint and for that one, I have to pass 'Edit'. If neither 'Open' nor 'Edit' works, pass in a null value. It should work with either of these 3 possible values. The API returns a value, so you can check on that.
regards.