[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Getting VK_SCROLL state in WinME

Posted on 2002-03-06
4
Medium Priority
?
734 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

650 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