title: can't get current keyboard layout
body: <p>I have tried <strong>GetKeyboardLayoutName()</strong> and <strong>GetKeyboardLayout()</strong> for getting the current keyboard layout, but they both give me the default layout and changing the layout doesn't affect the output!</p>
  
  <pre><code>while(1)
  {
      Sleep(5);
      for(int i = 8; i &lt; 191; i++)
      {
          if(GetAsyncKeyState(i)&amp;1 ==1)
          {
              TCHAR szKeyboard[KL_NAMELENGTH];
              GetKeyboardLayoutName(szKeyboard);
  
              if(GetAsyncKeyState(i)&amp;1 ==1)
              {
                  TCHAR szKeyboard[KL_NAMELENGTH];
                  GetKeyboardLayoutName(szKeyboard);
                  cout &lt;&lt; szKeyboard &lt;&lt; endl ;
              }
          }
      }
  }
  </code></pre>
  
  <p>It always gives me "00000409" when the default layout is set to English, while I expect it to be "00000429" when I change the layout to Farsi.</p>
  
  <p>My first question here, I used to find all my answers by just searching. But right now I'm driving crazy after hours of searching around and getting nothing...</p>