Shutdown parameters

Shutdown parameters

Postby Natter » Mon May 29, 2017 9:29 am

Hi all !

I need to get/change the shutdown parameters for the currently calling process.
How can I do this using functions SetProcessShutdownParameters and GetProcessShutdownParameters ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Shutdown parameters

Postby Antonio Linares » Mon May 29, 2017 10:29 am

Code: Select all  Expand view
#pragma BEGINDUMP

#include <windows.h>
#include <hbapi.h>

HB_FUNC( SETPROCESSSHUTDOWNPARAMETERS )
{
   hb_retl( SetProcessShutdownParameters( hb_parnl( 1 ), hb_parnl( 2 ) ) );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Shutdown parameters

Postby Natter » Mon May 29, 2017 10:48 am

Thank You, Antonio !
I wanted that when you shutdown the computer is not a message of forced close my app. In your application make Setprocessshutdownparameters(1, 1), but the message still appears forced.
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Shutdown parameters

Postby Antonio Linares » Mon May 29, 2017 11:02 am

What message appear ?

Please post a screenshot
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Shutdown parameters

Postby Natter » Mon May 29, 2017 2:14 pm

Understood, it is necessary to process messages WM_QUERYENDSESSION / WM_ENDSESSION which are sent open applications when you restart the computer. How can I intercept these messages ?
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am

Re: Shutdown parameters

Postby Antonio Linares » Mon May 29, 2017 10:05 pm

Please inherit a new Class from TWindow and redefine the Method HandleEvent()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Shutdown parameters

Postby Antonio Linares » Mon May 29, 2017 10:07 pm

Here you have an example from Daniel:

viewtopic.php?p=96677#p96677
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Shutdown parameters

Postby Natter » Tue May 30, 2017 6:24 am

Antonio, thanks for Your help !
Natter
 
Posts: 1215
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 117 guests