Windows: Open image with LC EXE

Paul Dupuis paul at researchware.com
Wed Mar 6 12:13:17 EST 2019


If you select an LC standalone as the app t open an image with, the name 
and path to the image will be sent to the EXE as a command line 
parameter. See the dictionary/documentation on handling command line 
parameters in a standalone

To tell Windows that your APP (standalone/EXE) can open and deal with 
jpg images, you must register that file type (.jpg) in the registry for 
your application. This is tricky on modern versions of Windows, because 
to use setRegistry to set a registry key, the application (process) 
calling setRegistry (an LC statement) must be a privileged process (i.e. 
have admin privs).

Our app ships with a separate helper app (another LC standalone/EXE) 
that receives instructions from the main app via interprocess 
communications and makes all the setRegistry and getRegistry calls. That 
way, our main APP can start the helper app as a priviledged process and 
tell it to set the registry. This is to work around that a process (the 
main LC app/EXE) can not elevate its own privileges, so it can not ask 
to be given admin privs, but it can start another process that requests 
admin privs.


On 3/6/2019 11:40 AM, Klaus major-k via use-livecode wrote:
> Hi friends,
>
> this came up in the german LC forum:
> If you right-click an image file (Jpg) on the desktop
> you will get a list of applications that can handle a Jpg image.
>
> This list is provided by the "Windows Explorer" (I think, I'm a Mac guy).
>
> Now if your LC exe happens to be in that list and we select our app,
> what message, if at all, does our EXE receive when the "Explorer" "sends"
> that image to our application whivh MAY be open already.
>
> I mean how can we get to know what image file the user wants to open
> with our EXE, so we can load it into an image object in our EXE?
>
> Know what I mean?
> Thanks for any hint!
>
>
> Best
>
> Klaus
> --
> Klaus Major
> http://www.major-k.de
> klaus at major-k.de
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>





More information about the use-livecode mailing list