Jump to content

Recommended Posts

Posted

Hello,

I have a windowless application with integrated UniGui and I need it to close from one of its threads.
Without UniGUI I didn't use Application.run, didn't handle messages and instead of it I used a special thread which checked globally defined variable ApplicationTerminated that could be set out of everywhere.

 

Now with UniGUI I need to stop Application.run from another thread. All the ways mentioned from this topic are not working:

Application.Terminate (no result);
UniApplication.Terminate (access violation);
MainModule.UniMainModule.Terminate (access violation)

 

Is there another way of proper closing the application?

Posted

Hi;

 

An UniGUI application can be closed from only its events like onclick, not other threads events. That's the reason why you are getting access violation error.

  • 1 year later...
Posted

try this

 

UniApplication.Terminate('GoodBye');  // to put the app in a closed state in the browser

PostThreadMessage(MainThreadID,wm_quit,0,0);  // will tell the main application to terminate 
 
Use only for testing though... or users will be able to terminate the server.exe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...