Re: Caps Lock setting

Tech-Archive recommends: Fix windows errors by optimizing your registry



On 12 Jul 2006 08:46:24 -0700, "Ajay Kalra" <ajaykalra@xxxxxxxxx>
wrote:

How do I find out if Caps Lock is on when a document is opened? It's
easy if the key is pressed when the document has been opened but how
do I check if the Caps Lock key has already been set on before the
document is opened and even before the application is loaded?

GetKeyState(VK_CAPITAL) should do what you want. Heres more:


That's what I am doing now in InitDocument. I would expect the most
significant bit to be set when the Caps Lock is on but
GetKeyState(VK_CAPITAL) always returns zero. When the document is open
the same code in OnKeyDown works OK but I need to know the state of
the Caps Key before the document is opened.

--
Steve Wolstenholme Neural Planner Software

EasyNN-plus. The easy way to build neural networks.
http://www.easynn.com
.



Relevant Pages

  • Re: Caps Lock setting
    ... significant bit to be set when the Caps Lock is on but ... GetKeyStatealways returns zero. ... GetKeyStatereflects the key states as of the last message pumped (I ... What you want is GetAsyncKeyState() which reflect the key states at ...
    (microsoft.public.vc.mfc)
  • Re: Caps Lock setting
    ... Look a GetAsyncKeyState ... do I check if the Caps Lock key has already been set on before the ... the same code in OnKeyDown works OK but I need to know the state of ...
    (microsoft.public.vc.mfc)