The body is the capital of the revolution, the eyes are the money of the programmer
The best way to protect your vision is to distinguish from the display. For those who need a long time to work in the monitor, as long as you keep an appropriate distance, don't always stare at the screen, you will take a look at the distance, you can protect it. Good your eyes!
If you leave the screen? Do a timed reminder of the gadget! However, reminding is a matter, can you actively implement another thing, how to enforce it? The best way is to create another desktop and switch this desktop to the front, let yourself unable to handle anything, have to see the distance; wait for a while, destroy the desktop, and then return the computer to the user.
The following is the source code, it is very simple, it will not explain it.
Void Callback TimerapcProc (LPVOID LPARGTOCOMPLETINE, DWORD DWTIMERLOWVALUE, DWORD DWTIMERHIGHVALUE) {static hdesk hdesk = NULL; if (hdesk) {return;
SystemTime St; GetSystemTime (& ST);
IF (st.wminute == 0 && st.wsecond == 0) {HDESK = CreateDesktop ("Protect Eye", NULL, NULL, 0, Generic_all, null; if (null == hdesk) {dword dwerr = getLastError ); return;} SwitchDesktop (hDesk); HANDLE hTimer = CreateWaitableTimer (NULL, TRUE, NULL); LARGE_INTEGER liDueTime; liDueTime.QuadPart = -300000000; SetWaitableTimer (hTimer, & liDueTime, 0, NULL, NULL, 0); WaitForSingleObject (hTimer , Infinite; closehandle (htimer); Closedesktop (HDESK); hdesk = null;}}
Int apientry Winmain (Hinstance Hinstance, LPSTANCE HPREVINSTANCE, LPSTR LPCMDLINE, INT NCMDSHOW) {Handle Htimer = CreateWaitableTimer (null, false, null); if (! htimer) {return 0;}
Large_integer liutc = {0}; Bool Bsuccess = SetWaitabletimer (HTIMER, & LIUTC, 800, TIMERAPCPROC, NULL, FALSE);
IF (bsuccess) {while (1) {Sleepex (Infinite, True);}}
CloseHandle (HTIMER);
Return 1;}