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
Solved

Getting VK_SCROLL state in WinME

Posted on 2002-03-06
4
721 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
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 50 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…

809 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