Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Jan 23rd, 2008, 10:53 PM   #1
davidguygc
Programmer
 
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0 davidguygc is on a distinguished road
Simulate user activity

Hello all,

I am currently up at the university library, and the computers are set to log you off after 3 minutes of being idle. It is very annoying to say the least.

I am currently working on Calculus III homework with the homework site up. The way it works is I write down the problem, work on it, then submit it. This process takes longer than three minutes, so I want to know if I could write a console program that could make the computer think that I just pushed a button every x seconds.

There is Visual Studio 6.0 installed on this computer, so I can compile and run a program right here.

I had already given it one try, writing this program:
#include <ctime>
#include <iostream>

int main()
{
	time_t start, stop;
	start = time(&start);
	system("TITLE ANTI-LOGOUT!");
	while(true)
	{
		stop = time(&stop);
		if(difftime(stop,start) == 60.0)
		{
			start = time(&start);
                        // This opens a minimized prompt every 60 seconds
                        system("cmd /c start /min cmd /c exit"); 
		}
	}
	return 0;
}
As promising as this program seemed, it's not doing the trick. Do y'all know of any other way to get this annoyance taken care of?

Thanks in advance,
--David
davidguygc is offline  
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow user to select a directory MegaArcon HTML / XHTML / CSS 11 Jun 5th, 2006 8:38 AM
problem with user defined class mixed with functions willj729 C++ 4 Oct 9th, 2005 3:26 PM
User Input for Number Format ericelysia1 Java 0 Jul 21st, 2005 3:41 PM
Loading and Destroying web user controls into a panel see07 C# 0 Feb 2nd, 2005 12:38 PM
Show web user control hidden see07 C# 1 Feb 2nd, 2005 10:35 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:31 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC