Page 1 of 1

Sleepmodus PC and timerevents.

Posted: Thu May 11, 2023 5:55 am
by skiman
Hi,

In our application we have some timers to do different kind of calculations.

When a user don't close our application and the PC comes into sleep modus after some hours this can cause an error.

The timerevent is starting a function which tries to open a dbf file. Because of the sleepmodus of the PC an error returns. In the morning the user hits a key on his keyboard and sees the error.

I can solve this with 'Begin Sequence...' but I was wondering if there is a way to detect if a PC is in sleepmodus? Or if you can 'awake' the PC?

Re: Sleepmodus PC and timerevents.

Posted: Thu May 11, 2023 2:02 pm
by Auge_Ohr
hi Chris,

have you try

Code: Select all

   oDlg:systemPowerStatus := {| nChange, uNIL, oSelf | NoDown(nChange, oSelf) }
   
FUNCTION NoDown(nChange, oSelf)
   TONE(1234)
RETURN XPP_POWERQUERY_DENY   

Re: Sleepmodus PC and timerevents.

Posted: Fri May 12, 2023 12:16 am
by skiman
Hi Jimmy,

Thanks for the answer. I will see if that can solve the problem. Seems as there comes some kind of notification when the system want to go down.

According to the note in the doc it is not always possible to DENY this process. Seems as the documentation is last updated when Vista was the main OS...