The correct way to quit a Windows standalone

JJS jjs at krutt.org
Sat May 18 03:29:58 EDT 2019


i use this which works ok on windows but hangs on Macos(when clicking 
the red x, it works when going to quit via the menu, i don't know why)

if the environment is "standalone application" then
       if the platform is "Win32" then
          --added /T and /F, /T Terminates process and any child 
processes started by it, /F Forcefully Terminate process
          put "taskkill.exe" & space & "/F" & space & "/T" & space & 
"/IM" & space & "yoursplshstack.exe" into tCommandToExec
          put shell  (tCommandToExec)
       else
          if the platform is "MacOS" then
             put "osascript -e 'quit app" & quote & "yoursplashstack" & 
quote & "'" into tCommandToExec
             -- of pkill MFS-VendorStart
             put shell (tCommandToExec)
          else
             if the platform is "Linux" then
                put shell("killall yoursplashstack")
             end if
          end if
       end if

the above part is in the on closestack handler of the stack that has 
been opened by the splashstack. something similair i have in the splash 
stack. so it would work whichever stack is closed by the user. i iconify 
the splashstack after a few seconds

Op 18-5-2019 om 01:26 schreef Bob Sneidar via use-livecode:
> NVM Apparently I am supposed to use lock messages to force a quit. There may be something in my code that is halting the quit process, but I don't really need to do any housekeeping, so this works.
>
> Bob S
>
>
>> On May 17, 2019, at 13:37 , Richmond via use-livecode <use-livecode at lists.runrev.com> wrote:
>>
>> As your splash stack is, presumably,either a substack of your main standalone, or the main stack itself
>> I don't think you can exit it without the whole standalone exiting.
>>
>> So, I suspect, you'll have to find another way of getting the splash stack out of the way.
>>
>> Personally I'd make the splash stack invisible:
>>
>> on openStack
>>    set the vis of stack "mySplash" to false
>> end openStack
>>
>> or move it off-screen:
>>
>> on openStack
>>    set the bottom of stack "mySplash" to -100
>> end openStack
>>
>> Richmond.
>>
>>
>> On 17.05.19 23:27, Bob Sneidar via use-livecode wrote:
>>> Hi all.
>>>
>>> I have a splash stach in a Windows Standalone. When I close (or otherwise quit) the stack which the splash stack opens (the actual application) I get a runtime error, and the Splash process continues to run.
>>>
>>> What is the proper way to cleanly exit an app of this nature?
>>>
>>> Bob S
>>>
>>>
>>> _______________________________________________
>>> 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
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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