03-23-2022 03:26 AM
Using this Vi...
03-23-2022 05:13 AM
This uses .NET to open the text file with the default text editor.
Actually, the verb "Print" makes it print. If you make it empty, the file will open.
This works for any file (pdf, doc, VI, etc.).
03-23-2022 05:21 AM
Nice, Implemented something like that using the command line for other file types but this is much cleaner 🙂
Forgot to add to my implementation (can't find a way to edit my post), tries to open with notepad++ and falls back to notepad.exe.
Just wondering.. I assume the .net implementation use the file extension to determine application? In that case it will only work when the extension & type have been registered?
03-23-2022 06:18 AM
@beuvink wrote:Just wondering.. I assume the .net implementation use the file extension to determine application? In that case it will only work when the extension & type have been registered?
Yes, it uses the registered application for the extension.
This can be good or bad, depending on what you want of course...
There's also an API call for it, but .NET is often a lot easier...
03-23-2022 08:11 AM - edited 03-23-2022 08:13 AM
The API call is ShellExecute()
The Windows Shell32 is in fact a layer on top of the actual Win32 API and is for a large part simply all combined functionality from Explorer and old style IE Explorer collected together. Most of the actual functionality is internally build around COM classes with exported function wrappers to the most common functions that an application could use. To get access to the full functionality however it is pretty unavoidable to use the COM interfaces.
Explorer itself is just a really thin executable shell around that layer as all the actual functionality sits in Shell32. LabVIEW almost exclusively interfaces to the low level Win32 API and does very little with the shell layer at all.
03-23-2022 10:50 AM
Try this.