GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 23-May-2006, 18:11
ppan ppan is offline
New Member
 
Join Date: May 2006
Posts: 3
ppan is on a distinguished road

Creating Virtual Hardware interrupts


Hello,

I have been looking for a way to mimic a hardware interrupt in software.

For example, how would someone send a mouse click interrupt virtually to a different program without actually clicking the mouse? I have seen ways to handle interrupts, but never a way to generate the interrupt.

Does the OS (linux for example) have a global interrupt array where I can set a hardware interrupt (even though it's probably dangerous to do that)?

I'm sorry I have no code, as this is not for a class nor for any work project. I have been thinking of program automation techniques and this concerpt has been on my mind for quite some time now.

Thanks,
PPAN
  #2  
Old 29-May-2006, 16:07
ubergeek ubergeek is offline
Regular Member
 
Join Date: Jan 2005
Posts: 775
ubergeek is a jewel in the roughubergeek is a jewel in the roughubergeek is a jewel in the rough

Re: Creating Virtual Hardware interrupts


I don't know about Linux, but Windows has concept called "hooks" where the OS calls your callback function when a certain event happens (the event depends on the type of hook -- it can be a mouse click, a keyboard press, a message send, etc).
  #3  
Old 01-Jun-2006, 00:03
ppan ppan is offline
New Member
 
Join Date: May 2006
Posts: 3
ppan is on a distinguished road

Re: Creating Virtual Hardware interrupts


Thanks. I read a little about hooks and they seem pretty neat. I read that they intercept events, so I wonder can I intercept a MOUSECLICK event and then intead call a KEYBOARD event callback function instead
  #4  
Old 01-Jun-2006, 13:58
davis
 
Posts: n/a

Re: Creating Virtual Hardware interrupts


Quote:
Originally Posted by ppan
Hello,

I have been looking for a way to mimic a hardware interrupt in software.

For example, how would someone send a mouse click interrupt virtually to a different program without actually clicking the mouse? I have seen ways to handle interrupts, but never a way to generate the interrupt.

Does the OS (linux for example) have a global interrupt array where I can set a hardware interrupt (even though it's probably dangerous to do that)?

I'm sorry I have no code, as this is not for a class nor for any work project. I have been thinking of program automation techniques and this concerpt has been on my mind for quite some time now.

Thanks,
PPAN

Most modern operating systems are not going to give your userland applications (memory) access to interrupt vector tables. If, by some kernel method, you obtain a pointer to the memory locations, altering them would likely cause kernel faults that could be catastropic.

As noted by UG, the windowing system is probably the preferred way to "send" mouse clicks and other "events" to an application(s). You can easily "hook" these events through your windowing subsystem on both Windows and Linux (X Window system).


:davis:
 
 

Recent GIDBlogToyota - 2008 September Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB 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
Help in Virtual function Janakiraman MS Visual C++ / MFC Forum 1 31-May-2006 00:15
pure virtual function vatsa_mitr C++ Forum 1 12-May-2006 00:41
virtual memory Hood Computer Software Forum - Windows 1 15-Jun-2005 13:17
Online debit card - Virtual debit card - Cachecard pinky123 eCommerce / Merchant Account Forum 0 20-Feb-2005 00:04
Dealing with virtual functions crystalattice C++ Forum 0 16-Nov-2004 22:34

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:38.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.