Nice change to Windows 7...
-
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave KreskowiakI don't like hooks. Particularly the really small fiddly ones that end up getting stuck in your finger. Maybe that why I didn't do a lot of fishing as a youngster. :rolleyes:
Dave Find Me On: Web|Facebook|Twitter|LinkedIn
Latest Article: Data Historians! You Bought It, Use It! Real World Example
-
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
First they create a PC that is not owned by the user anymore, now it is even not owned by the programmers... Can anybody write a descent OS?
-
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave KreskowiakSetWindowsHookEx, I remember the days... Well, I can see the defensive side, by trashing every api call that *could* create perfomance issues.
-
First they create a PC that is not owned by the user anymore, now it is even not owned by the programmers... Can anybody write a descent OS?
-
Rozis wrote:
Can anybody write a descent OS?
Have you just laid the bait for all the Apple and Linux fan-boys to coming shouting?
Dave Find Me On: Web|Facebook|Twitter|LinkedIn
Latest Article: Data Historians! You Bought It, Use It! Real World Example
DaveAuld wrote:
Apple and Linux
LOL! as if!
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
-
DaveAuld wrote:
Apple and Linux
LOL! as if!
"If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams
-
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave KreskowiakAt least they do provide a workaround with that Raw Input thing.
The difficult we do right away... ...the impossible takes slightly longer.
-
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave KreskowiakGood to know, thanks for posting this! And, about time... LL hooks can stall input processing. If your hook gets removed because it times out 10 times, that's 3 seconds of lag it introduced into the Windows UI. Not your program's UI, the entire desktop. That's unacceptable! You shouldn't be doing any serious processing in a hook routine; check a flag, post a message, and return - if this consistently chews up more than 300ms per call, something is very, very wrong. And you won't even get the blame for it. User notices all their apps are laggy, they blame Windows, not some program that doesn't even have input focus. Maybe eventually they figure it out, after re-installing Windows and finding that helps right up 'til they get around to running your software again... But probably not. I suspect they realized this was causing problems and rather than simply reducing the default timeout value (which might have caused problems for software that has a legitimate need to eat certain input events), they decided to just go after software that consistently hurt performance.
-
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave KreskowiakArguably a reasonable change for Windows 7, but a high risk item to introduce in RTM! Anyway, bookmarket as "Why you shouldn't use hooks unless you really need to". I've seen to many people using hooks "because it's easy", when there was a less intrusive solution. [edit] Proof that it works: My customer got rid of the hooks and used Raw Input instead with success. I hope this helps you too.
FILETIME to time_t
| FoldWithUs! | sighist | WhoIncludes - Analyzing C++ include file hierarchy -
This little "feature"[^] was added to Windows 7, not before or during the Beta, but RIGHT WHEN IT WENT TO RTM!! Who the hell gets away with these decisions?! I love how Windows 7 will now VERY silently disconnect your global hooks for you. Talk about a royal PITA to diagnose!
A guide to posting questions on CodeProject[^]
Dave KreskowiakDave, it has just occurred to me that maybe this should be a Tip/Trick as I'm sure that it will catch somebody out sooner or later.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus!
-
I don't like hooks. Particularly the really small fiddly ones that end up getting stuck in your finger. Maybe that why I didn't do a lot of fishing as a youngster. :rolleyes:
Dave Find Me On: Web|Facebook|Twitter|LinkedIn
Latest Article: Data Historians! You Bought It, Use It! Real World Example
Well, the point wasn't the hooks themselves, but MS's change to how the code behaves AFTER it's out of Beta and immediately before the code went Gold. Making a last minute change like that, especially one that changes the behavior of a well-known API, is scary at best.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Good to know, thanks for posting this! And, about time... LL hooks can stall input processing. If your hook gets removed because it times out 10 times, that's 3 seconds of lag it introduced into the Windows UI. Not your program's UI, the entire desktop. That's unacceptable! You shouldn't be doing any serious processing in a hook routine; check a flag, post a message, and return - if this consistently chews up more than 300ms per call, something is very, very wrong. And you won't even get the blame for it. User notices all their apps are laggy, they blame Windows, not some program that doesn't even have input focus. Maybe eventually they figure it out, after re-installing Windows and finding that helps right up 'til they get around to running your software again... But probably not. I suspect they realized this was causing problems and rather than simply reducing the default timeout value (which might have caused problems for software that has a legitimate need to eat certain input events), they decided to just go after software that consistently hurt performance.
I agree it had to be changed. I have a problem with how they did it. Dropping that little fix in at the last second, just before the code went Gold is a mistake IMHO. What if they totally screwed the pooch and the timeout was "documented" at 300ms, but the code timedout at 30ms?? Not good. Plus, it gave nobody any time to test their code against the new behavior.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Dave, it has just occurred to me that maybe this should be a Tip/Trick as I'm sure that it will catch somebody out sooner or later.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus!
I think your right. I'll drop it in Tips/Tricks even though it's just a link. Thanks!
A guide to posting questions on CodeProject[^]
Dave Kreskowiak