From: Sa3Q on
===================
i try to use this code but it appear only 000000 code

while(1){
HWND hWndFW = GetForegroundWindow();
DWORD dwThreadId = GetWindowThreadProcessId(hWndFW, NULL);
HKL h = GetKeyboardLayout(dwThreadId);
LANGID langid = LANGID(LOWORD(HandleToLong(h)));

cout <<h;
cout << "\n";
Sleep(2000);
}

=====
LANGID not defined and the output only 000000
please what is this problem
From: Sa3Q on
On 12 نوفمبر, 20:17, Sa3Q <s3qs...(a)gmail.com> wrote:
> ===================
> i try to  use this code but it appear only 000000 code
>
>    while(1){
> HWND hWndFW = GetForegroundWindow();
> DWORD dwThreadId = GetWindowThreadProcessId(hWndFW, NULL);
> HKL h = GetKeyboardLayout(dwThreadId);
> LANGID langid = LANGID(LOWORD(HandleToLong(h)));
>
>                 cout <<h;
>                 cout << "\n";
>         Sleep(2000);
>         }
>
> =====
> LANGID not defined  and the output only 000000
> please what is this problem

-----------------------------------------------------------------------------------------------------------------------
please help meeeeeeeeeeeeeeeeeeeeeee
From: Alain on
"Sa3Q" <s3qsa3q(a)gmail.com> a �crit dans le message de news:
74f0e9d3-cc6d-4ca1-81ad-f774dc338f35(a)c3g2000yqd.googlegroups.com...
On 12 ??????, 20:17, Sa3Q <s3qs...(a)gmail.com> wrote:
> ===================
> i try to use this code but it appear only 000000 code
>
> while(1){
> HWND hWndFW = GetForegroundWindow();
> DWORD dwThreadId = GetWindowThreadProcessId(hWndFW, NULL);
> HKL h = GetKeyboardLayout(dwThreadId);
> LANGID langid = LANGID(LOWORD(HandleToLong(h)));
>
> cout <<h;
> cout << "\n";
> Sleep(2000);
> }

Which OS are you using ?
It works on XP : if you switch Notepad to English, you get "04090409"


From: Sa3Q on
On 14 نوفمبر, 17:46, "Alain" <al...(a)distrib.fr> wrote:
> "Sa3Q" <s3qs...(a)gmail.com> a écrit dans le message de news:
> 74f0e9d3-cc6d-4ca1-81ad-f774dc338...(a)c3g2000yqd.googlegroups.com...
> On 12 ??????, 20:17, Sa3Q <s3qs...(a)gmail.com> wrote:
>
> > ===================
> > i try to use this code but it appear only 000000 code
>
> > while(1){
> > HWND hWndFW = GetForegroundWindow();
> > DWORD dwThreadId = GetWindowThreadProcessId(hWndFW, NULL);
> > HKL h = GetKeyboardLayout(dwThreadId);
> > LANGID langid = LANGID(LOWORD(HandleToLong(h)));
>
> > cout <<h;
> > cout << "\n";
> > Sleep(2000);
> > }
>
> Which OS are you using ?
> It works on XP  : if you switch Notepad to English, you get "04090409"

thank you alain that's right
my windows7

it run perfect when the cursor on any place for write
thank you all
From: Sa3Q on
i have an erroe in the code
{{{{{{{{{{{{{
error C2065: 'HandleToLong' : undeclared identifier
}}}}}}}}}}}}}


how can i fix it thank you
i use visual c++ 6