I often forget to do reality checks while on the computer, so I decided to write a program that does the remembering for me. Every hour it will display a message box which asks if you are dreaming, which is your cue to do a check. Simple, but enough to remind you.
If anyone else is interested, I have posted the C source code below and have attached the exe too. Because the board is a pain and won't let me upload files that contain ".exe", I renamed it to "reality_checker.txt" so it would upload. Once you download it rename it back to "reality_checker.exe" and run it as normal.
Also there is no need to open it more than once. It will stay running until you either restart/turn off your computer or kill it from the "Processes" tab in the Taskmanager.
If you aren't into software development and still want to give a try at compiling it then I can walk you through it, just post here.
If you have any suggestions on how to make this better or more useable, then tell me and I will try to get to adding it when I have some time.
Screenshot: http://img77.imageshack.us/my.php?image=reminderxx4.png (the background is my desktop background, it will show yours instead of the one in the picture).
Code:
//Program is free to use or modify for any purpose.
//to compile:
//gcc reality_checker.c -o reality_checker -s -mwindows
#include <windows.h>
#include <stdio.h>
int main(){
****HDESK blank_desktop = 0; //our blank desktop
****HDESK normal_desktop = 0; //normal desktop
****SYSTEMTIME current_time; //current system time
****char status_message[512]; //error message/alert message
****int previous_hour = -1; //last hour message was displayed
****
****
****blank_desktop = CreateDesktop("blankdesktop", 0, 0, 0, GENERIC_ALL, 0); //create the desktop
****normal_desktop = GetThreadDesktop(GetCurrentThreadId()); //current
********
****if(!blank_desktop || !normal_desktop){ //check errors
********sprintf(status_message, "Failed to create blank desktop, with error code: %i", (int)GetLastError());
********MessageBox(0, status_message, 0, MB_ICONSTOP);
********return 0;
****}
****
****
****while(1){ //loop and check time
********//check time
********GetSystemTime(¤t_time);
********if(previous_hour != current_time.wHour){ //show message
************SwitchDesktop(blank_desktop);
************SetThreadDesktop(blank_desktop);
************sprintf(status_message, "The current time is %i:%i (GMT) of %i/%i/%i", current_time.wHour, current_time.wMinute,
************************current_time.wYear, current_time.wMonth, current_time.wDay);
************MessageBox(0, status_message, " ", MB_ICONINFORMATION);
************sprintf(status_message, "Are you really awake?");
************if(MessageBox(0, status_message, " ", MB_ICONQUESTION | MB_YESNO) == IDNO){
****************sprintf(status_message, "Hmmm, maybe you are correct. Just don't do anything you will regret;-)");
****************MessageBox(0, status_message, " ", MB_ICONINFORMATION);
************}else{
****************sprintf(status_message, "Maybe so, although don't always assume this!");
****************MessageBox(0, status_message, " ", MB_ICONINFORMATION);
************}
************SwitchDesktop(normal_desktop);
************SetThreadDesktop(normal_desktop);
************previous_hour = current_time.wHour;
********}
********Sleep(180000); //pause for 180,000 milliseconds (3 minutes)
****}
}
Enjoy!
|
|
Bookmarks