![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Programmer
Join Date: Mar 2005
Location: Lubbock, TX
Posts: 30
Rep Power: 0
![]() |
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;
}Thanks in advance, --David |
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |