Link to home
Start Free TrialLog in
Avatar of daitt
daittFlag for Viet Nam

asked on

Getting VK_SCROLL state in WinME

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
Avatar of cookre
cookre
Flag of United States of America image

Have you tried GetKeyboardState() to see if it has a similar undesirable behavior under ME?
Avatar of daitt

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of cookre
cookre
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of daitt

ASKER

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 :)