?
Solved

Getting VK_SCROLL state in WinME

Posted on 2002-03-06
4
Medium Priority
?
731 Views
Last Modified: 2013-12-03
I have a non-window app that keeps checking Scroll lock state every second. I use GetKeyState(VK_SCROLL) in WindowsXP and it returns 1 if scroll lock is on. But in WinME, GetKeyState only works if the dialog of my app got the focus. I changed to GetAsyncKeyState but it only reports the state (pushed or released), not on/off of the toggle button.
How would I know the state (on/off) of scroll lock?
daitt
0
Comment
Question by:daitt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:cookre
ID: 6846231
Have you tried GetKeyboardState() to see if it has a similar undesirable behavior under ME?
0
 
LVL 3

Author Comment

by:daitt
ID: 6846256
I don't have winME here to test, but yesterday I tested it and GetKeyboardState() didn't return the on/off state (as I remember it returns the same result as GetKeyState).
I don't want to use hooks because my program is very small I want it to be an alone exe file (use hook I will need a dll file).
It's hard to believe that such a simple task is impossible.
0
 
LVL 22

Accepted Solution

by:
cookre earned 200 total points
ID: 6846363
Alas, it would appear to be so.  You may also have found:

http://www.delphifaq.com/fq/q2050.shtml

part of which states:

GetKeyState and GetAsyncKeyState only work with Win95, Win98, NT4, Terminal Server and Windows 2000. But on WinME it always returns zero. These two functions are simply skipped by Millenium Edition!

Official explanation from Microsoft:

Intentionally disabled.
It didn't work all that well on some newer hardware, and worked less well with the passage of time, so it was fully disabled in ME.

0
 
LVL 3

Author Comment

by:daitt
ID: 6846574
Thanks for the info. Microsoft document made me crazy for a while (it doesn't mention about that anywhere in my MSDN).
Now I scan keystate of VK_SCROLL all the time and calculate the state myself. The timer interval I set tok 10ms. It works ok now :)
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question