Jump to content

Closing windowless unigui application


Rav

Recommended Posts

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?

Link to comment
Share on other sites

  • 1 year later...

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
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...