Jump to content


Photo

Shutdown the standalone server by code


  • Please log in to reply
5 replies to this topic

#1 hoomanra

hoomanra

    Newbie

  • uniGUI Subscriber
  • Pip
  • 6 posts
  • LocationSydney

Posted 21 January 2016 - 02:53 AM

Good Day All,

 

Is there a way to shutdown the standalone unigui server by code (unigui function)? I can kill the app using windows api but I was wondering if there is a function somewhere in UniGUI framework that would do this.

 

Thanks,

 

 


  • 0

#2 adragan

adragan

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 165 posts

Posted 21 January 2016 - 08:10 AM

  UniApplication.Terminate;
 


  • 0

#3 hoomanra

hoomanra

    Newbie

  • uniGUI Subscriber
  • Pip
  • 6 posts
  • LocationSydney

Posted 21 January 2016 - 09:17 AM

As mentioned in my question, I want the standalone webserver to shutdown, not the webapplication (i.e. the web session).

 

Uniapplication.terminate just terminates the active session and not the web server.


  • 0

#4 xuyb19870303

xuyb19870303

    Member

  • Members
  • PipPip
  • 18 posts

Posted 21 January 2016 - 02:38 PM

ExitProcess(0);

 

this method will work well.


  • 0

#5 xuyb19870303

xuyb19870303

    Member

  • Members
  • PipPip
  • 18 posts

Posted 22 January 2016 - 12:37 AM

to shutdown the computer?

 

ExitWindowsEx(EWX_FORCE+EWX_SHUTDOWN,0);


  • 0

#6 Daryl McMurray

Daryl McMurray

    Member

  • uniGUI Subscriber
  • PipPip
  • 29 posts
  • LocationOntario, Canada

Posted 13 February 2018 - 06:20 PM

There is a much cleaner way to do this...

 

ExitProcess(0);  will terminate the application without proper shutdown...

 

Use:

 

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

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users