Problem using SetKeyboardState API call on Windows XP Pro 
Author Message
 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  
 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  
 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  
 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  
 
 [ 4 post ] 

 Relevant Pages 

1. SetKeyboardState API Call

2. Problems with eVB on Windows XP Pro?

3. Windows XP API in Windows 2000

4. DatePicker problem under Windows XP and Office XP

5. cdonts in Windows XP Pro

6. Windows API Calls using VBscript

7. How to broadcast Messages using Windows API Calls?

8. Temporary Filenames using Windows API Calls

9. ASP database connectivity trouble Windows XP Pro

10. MTSTransaction Mode and Windows XP Pro

11. Modal Common Dialog Boxes using Windows API Calls

12. VB5 and Windows XP Pro ???

 

 
Powered by phpBB® Forum Software