Programming Forums
User Name Password Register
 

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

Closed Thread
 
Thread Tools Display Modes
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  
Old Jan 24th, 2008, 2:14 AM   #2
Salem
Programmer
 
Join Date: Nov 2007
Posts: 33
Rep Power: 0 Salem is on a distinguished road
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.
__________________
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Salem is offline  
Old Jan 24th, 2008, 3:23 AM   #3
Fall Back Son
Hobbyist Programmer
 
Join Date: Oct 2006
Posts: 204
Rep Power: 2 Fall Back Son is on a distinguished road
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).
Fall Back Son is offline  
Old Jan 24th, 2008, 5:09 AM   #4
peaceofpi
hi: for(;;) goto hi;
 
peaceofpi's Avatar
 
Join Date: Jun 2006
Posts: 87
Rep Power: 3 peaceofpi is on a distinguished road
Send a message via AIM to peaceofpi Send a message via MSN to peaceofpi
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
__________________
How do you play Religious Roulette?
Stand around in a circle and blaspheme till someone gets struck by lightning.
peaceofpi is offline  
Closed Thread

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 3:32 AM.

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