Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
6
Erster Beitrag:
vor 4 Jahren, 5 Monaten
Letzter Beitrag:
vor 4 Jahren, 5 Monaten
Beteiligte Autoren:
Peter Zhou, Peter Holemans, Al, PETER ZHOU

How to enable inactivity mode in WINDEV

Startbeitrag von PETER ZHOU am 12.08.2013 09:58

Hi,

Is there a way to detect no activity ( no mouse or keyboard event detected ) in windev ( for example after 10 mins ), just go back to the MAIN screen ( first window ) ?

Regards,

PETER ZHOU

Antworten:

Hi Peter,

There is... I remember having seen such an example in WD5.5b.
Not sure but I believe it ran based on either (most likely nr 2):
1) a windows API
2) a combination of a windev timer and event capturing using the Event() function...
Something like:
Event(MyCaptureInputProcedure, "*.*", WM_MOUSEMOVE) //mouse movements
Event(MyCaptureInputProcedure, "*.*", WM_LBUTTONDOWN) //for left mouse button clicked
Event(MyCaptureInputProcedure, "*.*", WM_KEYDOWN) //for keyboard pressed
...

I think the second route is the easiest to follow. Check this page as a starter:
http://doc.pcsoft.fr/en-US/?3014007&name=toucheenfoncee_fonction

Cheers,

Peter H.

von Peter Holemans - am 12.08.2013 10:27
Hi Peter,

Thank you for the reply.

It does look complicated..

Any easier method ?


Quote
Peter H.
Hi Peter,

There is... I remember having seen such an example in WD5.5b.
Not sure but I believe it ran based on either (most likely nr 2):
1) a windows API
2) a combination of a windev timer and event capturing using the Event() function...
Something like:
Event(MyCaptureInputProcedure, "*.*", WM_MOUSEMOVE) //mouse movements
Event(MyCaptureInputProcedure, "*.*", WM_LBUTTONDOWN) //for left mouse button clicked
Event(MyCaptureInputProcedure, "*.*", WM_KEYDOWN) //for keyboard pressed
...

I think the second route is the easiest to follow. Check this page as a starter:
http://doc.pcsoft.fr/en-US/?3014007&name=toucheenfoncee_fonction

Cheers,

Peter H.


von Peter Zhou - am 13.08.2013 09:00
Hello Peter

There is an automatic close option on windows and also timers are available on buttons so they may offer a solution. There is a timer example and an alarm example that show some code for timers.

Regards
Al

von Al - am 13.08.2013 09:16
Quote
Peter Zhou
Hi Peter,

Thank you for the reply.

It does look complicated..

Any easier method ?

Hi Peter,

Complicated?
A maximum of 10 lines of code in the project init code and a procedure that closes the open windows and leaves the main window open (About another 20 lines I guess)...
That doesn't sound too complicated, does it?

Just my 2 cents...

Cheers,

Peter H.

von Peter Holemans - am 13.08.2013 10:08
Hi Peter,

I found ways to do it ( thanks to both of you - Al and yourself ).

Yes, the EVENT will reset the timer procedure.

Quote
Peter H.
Quote
Peter Zhou
Hi Peter,

Thank you for the reply.

It does look complicated..

Any easier method ?

Hi Peter,

Complicated?
A maximum of 10 lines of code in the project init code and a procedure that closes the open windows and leaves the main window open (About another 20 lines I guess)...
That doesn't sound too complicated, does it?

Just my 2 cents...

Cheers,

Peter H.


von Peter Zhou - am 13.08.2013 13:25
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.