Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   C++ (http://www.programmingforums.org/forum15.html)
-   -   Simulate user activity (http://www.programmingforums.org/showthread.php?t=15012)

davidguygc Jan 23rd, 2008 11:53 PM

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

Salem Jan 24th, 2008 3:14 AM

Re: Simulate user activity
 
Have you considered why the "auto logoff" feature is really there?

Having understood that, what if you forget to turn off your magic program when you finally leave the building? If it's there for your security, then someone else will have free access to your account in a public building.

Also consider that what you're trying to do could be considered by some harsh regimes as computer misuse (writing a program to circumvent a policy decision of the management). Getting bumped off your course is not what you want.

Fall Back Son Jan 24th, 2008 4:23 AM

Re: Simulate user activity
 
Ok, mommy... ^^^

Anyway, I'm just taking a guess here (learning like you are) but I think your program doesn't work because it simulates computer activity, not user activity. Opening a window every x seconds is more similar to a system process than anything... what you probably want is to simulate an event, such as the user clicking a button or moving the mouse. The logoff feature probably checks to see if an event occured (like mouse movement or key clicks).

peaceofpi Jan 24th, 2008 6:09 AM

Re: Simulate user activity
 
It's not C++ source, but this is what I've used for a long time.

http://www.softpedia.com/get/Securit...Caffe1ne.shtml


All times are GMT -5. The time now is 4:00 AM.

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