|
Problem using SetKeyboardState API call on Windows XP Pro
Author |
Message |
Alex K. Angelopoulo #1 / 4
|
 Problem using SetKeyboardState API call on Windows XP Pro
I've been using GetKeyState, GetKeyboardState, and SetKeyboardState to attempt to check and change states of the CapsLock, NumLock, and ScrollLock keys on Windows XP - without any success. After thinking a bit and noting that they are all called from user32, it occurred to me that I might be successfully toggling key state *for the app* but not in the user's environment. Are there any known issues with using these API calls on NT/2000/XP? And if so, is there a reasonable alternative? If possible, I would prefer complete Win32 support, although NT4/2000/XP would be acceptable and I am even willing to settle for 2000/XP... Any comments appreciated.
|
Fri, 10 Sep 2004 23:19:51 GMT |
|
 |
Alex K. Angelopoulo #2 / 4
|
 Problem using SetKeyboardState API call on Windows XP Pro
Found it. Could not confirm that the older APIs caused the problem, but Randy Birch's VBNet site had an API call to user32 which works fine... The link to the location is http://www.mvps.org/vbnet
I've been using GetKeyState, GetKeyboardState, and SetKeyboardState to attempt to check and change states of the CapsLock, NumLock, and ScrollLock keys on Windows XP - without any success. After thinking a bit and noting that they are all called from user32, it occurred to me that I might be successfully toggling key state *for the app* but not in the user's environment. Are there any known issues with using these API calls on NT/2000/XP? And if so, is there a reasonable alternative? If possible, I would prefer complete Win32 support, although NT4/2000/XP would be acceptable and I am even willing to settle for 2000/XP... Any comments appreciated.
|
Sat, 11 Sep 2004 04:38:06 GMT |
|
 |
Mark_Pryo #3 / 4
|
 Problem using SetKeyboardState API call on Windows XP Pro
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q177674 hth, Mark Pryor
I've been using GetKeyState, GetKeyboardState, and SetKeyboardState to attempt to check and change states of the CapsLock, NumLock, and ScrollLock keys on Windows XP - without any success. After thinking a bit and noting that they are all called from user32, it occurred to me that I might be successfully toggling key state *for the app* but not in the user's environment. Are there any known issues with using these API calls on NT/2000/XP? And if so, is there a reasonable alternative? If possible, I would prefer complete Win32 support, although NT4/2000/XP would be acceptable and I am even willing to settle for 2000/XP... Any comments appreciated.
|
Sat, 11 Sep 2004 04:40:24 GMT |
|
 |
Alex K. Angelopoulo #4 / 4
|
 Problem using SetKeyboardState API call on Windows XP Pro
LOL - yes. It says exactly that I should use keybd_event, which is what my second test method did. Quote:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q177674 > hth, > Mark Pryor
> I've been using GetKeyState, GetKeyboardState, and SetKeyboardState to attempt > to check and change states of the CapsLock, NumLock, and ScrollLock keys on > Windows XP - without any success. > After thinking a bit and noting that they are all called from user32, it > occurred to me that I might be successfully toggling key state *for the app* but > not in the user's environment. > Are there any known issues with using these API calls on NT/2000/XP? And if so, > is there a reasonable alternative? If possible, I would prefer complete Win32 > support, although NT4/2000/XP would be acceptable and I am even willing to > settle for 2000/XP... > Any comments appreciated.
|
Sat, 11 Sep 2004 06:52:41 GMT |
|
|
|