Search:
Namespaces
Discussions
.NET v1.1
Feedback
Detecting PC inactivity
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.framework.windowsforms
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
Ben (VIP)
Hi All,
I need to detect when the PC has been inactive for a set period of time.
This solution has to work on Windows 98 and up. I was looking for a way to
hook into global mouse and keyboard events, but I haven't found a way to do
it.
The
IMessageFilter
appears to only work at the Application level. Similarly
using SetWindowsHookEx with WH_MOUSE only listens at the application level,
and WH_MOUSE_LL isn't supported by Windows 98/ME.
Anyone have a solution to this?
Thanks,
Ben
Reply to this message...
Imran Koradia (VIP)
take a look at these:
http://www.codeproject.com/csharp/GlobalSystemHook.asp
http://www.codeproject.com/csharp/globalhook.asp
hope that helps..
Imran.
"Ben" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
Reply to this message...
Herfried K. Wagner [MVP] (VIP)
* "Imran Koradia" <
Click here to reveal e-mail address
> scripsit:
[Original message clipped]
In addition to that:
Managing Low-Level Keyboard Hooks in VB .NET
<URL:http://www.developer.com/net/net/article.php/11087_2193301_1/>
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Reply to this message...
Ben (VIP)
The first link (
http://www.codeproject.com/csharp/GlobalSystemHook.asp
)
proposes a solution that requires a c++ implementation to be called into c#,
and maybe this is the only way to do it, but it would be much nicer if there
was an entirely c# implementation.
The other links propose solutions that requires hooking
WH_KEYBOARD_LL/WH_MOUSE_LL, which microsoft
(
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp
) indicates are only available on NT/2000/XP.
Does anyone else have a c# solution that will work on 98, ME, 2000, and XP?
--Ben
"Herfried K. Wagner [MVP]" wrote:
[Original message clipped]
Reply to this message...
Imran Koradia (VIP)
As per this message:
http://tinyurl.com/6syna
I don't think you can have a completely managed solution to implementing
hooks that would work on windows 98/ME as well. You would most likely have
to resort to a language that allows you to create standard dlls (which would
exclude VB6 as well) such as C, C++, etc
Sorry - I know this isn't what you were expecting. Anyway, hope this helps a
bit..
Imran.
"Ben" <
Click here to reveal e-mail address
> wrote in message
news:
Click here to reveal e-mail address
...
[Original message clipped]
i/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindow
shookex.asp) indicates are only available on NT/2000/XP.
[Original message clipped]
Reply to this message...
Ben (VIP)
Thank you very much for your help Imran.
Writing a custom unmanaged dll was the only I had found to do it in my
googling, but I was hoping against hope that someone on the boards had a nice
way of doing it.
Thanks again,
--Ben
"Imran Koradia" wrote:
[Original message clipped]
Reply to this message...
System.Windows.Forms.IMessageFilter
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com