473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Terminate a user request once it reached timeout (again)

Environment: C, C++, Dev-C++ using WinBGim ( this i can change to any window support flavour).

< Read the place for keyboard interrupts ?? how>
store last interrupt from keyboard.
store current time
while ( ! keyboard interrupt)
{
while ( (current time - stored time) < timeout);
<kill application ?? how to abort window/console application?? SYSTEM(EXIT??)>

}

can anybody help me with references to look, example code for suitable calls please.. Even if i try to open another thread, i am not sure how to read the interrupts.. Did this in RTOS, by using RTOS calls.. it worked without i understanding it.. lol Can someone help me please ....
Nov 6 '08 #1
9 1963
JosAH
11,448 Expert 8TB
I have moved your post to its own thread; hijacking another thread is considered
rude; don't do that anymore.

Jos (moderator)
Nov 6 '08 #2
Banfa
9,065 Expert Mod 8TB
Windows is not like an RTOS, in an RTOS you typically have direct access to all the platform hardware. In Windows you do not the programmer is separated from the hardware by the HAL (hardware abstraction layer). You can not (as far as I am aware) directly intercept an keyboard interrupts in Windows.
Nov 6 '08 #3
Sir,

I see your point, but aren't there so many games and programs written to support windows to 1. To monitor the idle time, 2. To self destruct the application
I am doing pretty simple application and i am seeing a failure as i not able to get this logic working. Tried with half heart to implement with delay() and exit but i have to leave this thought process after i realize that once function it will be executed unless i control with another action which is monitor keyboard.. Your alternate solution will be really help me to break the impass to proceed further... Many thanks in advance.
Nov 7 '08 #4
arnaudk
424 256MB
You can monitor the keyboard key states by periodically calling the GetAsyncKeyState() function in windows.
Nov 7 '08 #5
Banfa
9,065 Expert Mod 8TB
I see I think you may be able todowant ou want using the function SetWindowsHookEx (look it up on MSDN) to install a (or some) hook procedures to monitor keyboard/mouse activity, that couple with a timer (SetTimer or CreateWaitableTimer) should enable you to do what you want.
Nov 7 '08 #6
You can monitor the keyboard key states by periodically calling the GetAsyncKeyState() function in windows.
Thank you .. but unfortunately it checks for the key given as input.
which is short GetAsyncKeyState( int KEY) it is time consuming to collect all the key codes and put a for or while loop as my program will be messy.
Instead looking for function which returns if any key is pressed ...
Any help will be really good. Also idea to terminate the window application or console through software on timer expiry Thanks a lot ...
Nov 9 '08 #7
Banfa
9,065 Expert Mod 8TB
Try reading post #6 again
Nov 10 '08 #8
Try reading post #6 again
Sir i read that, I will surely look to that issue and please accept my extreme gratitude for helping me. Unfortunately/Fortunately i am using Dev-C++ and i will let you know how it goes .. any other ideas i can try.

Regards
BL
Nov 10 '08 #9
arnaudk
424 256MB
Dev-C++ hasn't been updated in 3 years. You might save yourself lots of trouble by using a more up-do-date compiler such as Visual C++ Express which is free and specifically designed for windows.
Nov 10 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Maddman | last post by:
Newbie here. I've got my database set up in SQL 2000, and have started an Access adp for a front end. I have 10 licenses, and at the moment the only accesses are the server through Remote...
7
by: jsale | last post by:
I'm currently using ASP.NET with VS2003 and SQL Server 2003. The ASP.NET app i have made is running on IIS v6 and consists of a number of pages that allow the user to read information from the...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
1
by: sri6412 | last post by:
I am trying to get the user details from the database, the request handler is in execution, but mean while i would like to verify the timeout value. Once request processing reached timeout value,...
2
by: Keith G Hicks | last post by:
asp.net 2.0 I have set my web.config as follows: <forms timeout="30"/(I know that's the default but I may chang it so the line's in there) I also have a few cookies I'm setting on my login...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.