FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Shutdown parameters
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Shutdown parameters
Posted: Mon May 29, 2017 09: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 ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Shutdown parameters
Posted: Mon May 29, 2017 10:29 AM
Code (fw): Select all Collapse
#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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Shutdown parameters
Posted: 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.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Shutdown parameters
Posted: Mon May 29, 2017 11:02 AM

What message appear ?

Please post a screenshot

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Shutdown parameters
Posted: Mon May 29, 2017 02: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 ?

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Shutdown parameters
Posted: 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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Shutdown parameters
Posted: 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
Posts: 1392
Joined: Mon May 14, 2007 09:49 AM
Re: Shutdown parameters
Posted: Tue May 30, 2017 06:24 AM

Antonio, thanks for Your help !

Continue the discussion