Solved

Getting VK_SCROLL state in WinME

Posted on 2002-03-06
4
710 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
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

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

Author Comment

by:daitt
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now