ReactOS  0.4.15-dev-2993-g14fbe80
kbdlayout.c File Reference
#include <wchar.h>
#include <windows.h>
#include "resource.h"
Include dependency graph for kbdlayout.c:

Go to the source code of this file.

Classes

struct  WND_DATA
 

Macros

#define UNICODE
 

Functions

LRESULT MainDialogProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 
DWORD WINAPI ThreadProc (LPVOID lpParam)
 
INT WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 
int GetKlList (HKL **list)
 
void FreeKlList (HKL *list)
 
void UpdateData (HWND hDlg)
 
void FormatMsg (WCHAR *format,...)
 
void FormatBox (HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format,...)
 
LRESULT CALLBACK WndSubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void SubclassWnd (HWND hWnd, WCHAR *Name)
 
DWORD GetActivateFlags (HWND hDlg)
 
DWORD GetLoadFlags (HWND hDlg)
 
UINT GetDelayMilliseconds (HWND hDlg)
 
HKL GetSelectedLayout (HWND hDlg)
 
HKL GetActivateHandle (HWND hDlg)
 

Variables

HINSTANCE hInst
 
HWND hMainDlg
 

Macro Definition Documentation

◆ UNICODE

Definition at line 9 of file kbdlayout.c.

Function Documentation

◆ FormatBox()

void FormatBox ( HWND  hWnd,
DWORD  Flags,
WCHAR Caption,
WCHAR Format,
  ... 
)

Definition at line 112 of file kbdlayout.c.

113 {
114  WCHAR buf[255];
115  va_list argptr;
116  va_start(argptr, Format);
117  _vsnwprintf(buf, sizeof(buf)-1, Format, argptr);
118  MessageBox(hWnd, buf, Caption, Flags);
119  va_end(argptr);
120 }
HWND hWnd
Definition: settings.c:17
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180
va_start(ap, x)
#define MessageBox
Definition: winuser.h:5797
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)

Referenced by MainDialogProc().

◆ FormatMsg()

void FormatMsg ( WCHAR format,
  ... 
)

Definition at line 102 of file kbdlayout.c.

103 {
104  WCHAR buf[255];
105  va_list argptr;
106  va_start(argptr, format);
107  _vsnwprintf(buf, sizeof(buf)-1, format, argptr);
108  MessageBox(0, buf, L"msg", 0);
109  va_end(argptr);
110 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
__wchar_t WCHAR
Definition: xmlstorage.h:180
va_start(ap, x)
static const WCHAR L[]
Definition: oid.c:1250
#define MessageBox
Definition: winuser.h:5797
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)

Referenced by MainDialogProc(), and WndSubclassProc().

◆ FreeKlList()

void FreeKlList ( HKL list)

Definition at line 67 of file kbdlayout.c.

68 {
70 }
#define GetProcessHeap()
Definition: compat.h:595
Definition: _list.h:228
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by UpdateData().

◆ GetActivateFlags()

DWORD GetActivateFlags ( HWND  hDlg)

Definition at line 152 of file kbdlayout.c.

153 {
154  DWORD ret = 0;
155 
157  ret |= KLF_REORDER;
158 
160  ret |= KLF_RESET;
161 
163  ret |= KLF_SHIFTLOCK;
164 
167 
168  return ret;
169 
170 }
#define KLF_REORDER
Definition: winuser.h:114
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define IDC_KLF_SHIFTLOCK
Definition: resource.h:17
#define IDC_KLF_SETFORPROCESS
Definition: resource.h:16
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_KLF_RESET
Definition: resource.h:15
#define IDC_KLF_REORDER
Definition: resource.h:14
int ret
#define KLF_SETFORPROCESS
Definition: winuser.h:117

Referenced by MainDialogProc().

◆ GetActivateHandle()

HKL GetActivateHandle ( HWND  hDlg)

Definition at line 219 of file kbdlayout.c.

220 {
221 
223  return GetSelectedLayout(hDlg);
224  else if(IsDlgButtonChecked(hDlg, IDC_HKL_NEXT))
225  return (HKL)HKL_NEXT;
226 
227  return (HKL)HKL_PREV;
228 
229 }
HKL GetSelectedLayout(HWND hDlg)
Definition: kbdlayout.c:209
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
UINT_PTR HKL
Definition: msctf.idl:101
#define IDC_FROMLIST
Definition: resource.h:18
#define IDC_HKL_NEXT
Definition: resource.h:19
#define HKL_NEXT
Definition: winuser.h:109
#define HKL_PREV
Definition: winuser.h:110

Referenced by MainDialogProc().

◆ GetDelayMilliseconds()

UINT GetDelayMilliseconds ( HWND  hDlg)

Definition at line 197 of file kbdlayout.c.

198 {
199  WCHAR Buf[255];
200  UINT ret;
201 
202  GetWindowText(GetDlgItem(hDlg, IDC_DELAY), Buf, sizeof(Buf));
203 
204  swscanf(Buf, L"%d", &ret);
205 
206  return ret*1000;
207 }
#define GetWindowText
Definition: winuser.h:5773
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IDC_DELAY
Definition: resource.h:11
int ret
static const WCHAR L[]
Definition: oid.c:1250
unsigned int UINT
Definition: ndis.h:50
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)

Referenced by MainDialogProc().

◆ GetKlList()

int GetKlList ( HKL **  list)

Definition at line 55 of file kbdlayout.c.

56 {
57  HKL *ret;
58  int n;
59 
61  ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HKL)*n);
63  *list = ret;
64  return n;
65 }
GLdouble n
Definition: glext.h:7729
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)
int ret
Definition: _list.h:228
UINT_PTR HKL
Definition: msctf.idl:101
#define NULL
Definition: types.h:112

Referenced by UpdateData().

◆ GetLoadFlags()

DWORD GetLoadFlags ( HWND  hDlg)

Definition at line 172 of file kbdlayout.c.

173 {
174  DWORD ret = 0;
175 
177  ret |= KLF_ACTIVATE;
178 
180  ret |= KLF_NOTELLSHELL;
181 
183  ret |= KLF_REORDER;
184 
186  ret |= KLF_REPLACELANG;
187 
190 
193 
194  return ret;
195 }
#define KLF_REORDER
Definition: winuser.h:114
#define KLF_ACTIVATE
Definition: winuser.h:111
#define IDL_KLF_SUBSTITUTE_OK
Definition: resource.h:26
#define KLF_NOTELLSHELL
Definition: winuser.h:116
#define IDL_KLF_NOTELLSHELL
Definition: resource.h:22
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
#define KLF_SUBSTITUTE_OK
Definition: winuser.h:112
#define IDL_KLF_REORDER
Definition: resource.h:24
#define IDL_KLF_SETFORPROCESS
Definition: resource.h:27
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define IDL_KLF_REPLACELANG
Definition: resource.h:25
#define KLF_REPLACELANG
Definition: winuser.h:115
#define IDL_KLF_ACTIVATE
Definition: resource.h:21
#define KLF_SETFORPROCESS
Definition: winuser.h:117

Referenced by MainDialogProc().

◆ GetSelectedLayout()

HKL GetSelectedLayout ( HWND  hDlg)

Definition at line 209 of file kbdlayout.c.

210 {
211  int n;
212  HWND hList;
213  hList = GetDlgItem(hDlg, IDC_LIST);
214  if((n = SendMessage(hList, LB_GETCURSEL, 0, 0)) != LB_ERR)
215  return (HKL) SendMessage(hList, LB_GETITEMDATA, n, 0);
216  else return INVALID_HANDLE_VALUE;
217 }
#define LB_GETITEMDATA
Definition: winuser.h:2023
GLdouble n
Definition: glext.h:7729
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
#define LB_ERR
Definition: winuser.h:2407
#define IDC_LIST
Definition: resource.h:93
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR HKL
Definition: msctf.idl:101
HWND hList
Definition: livecd.c:10
#define LB_GETCURSEL
Definition: winuser.h:2021
#define SendMessage
Definition: winuser.h:5818

Referenced by GetActivateHandle(), and MainDialogProc().

◆ MainDialogProc()

LRESULT MainDialogProc ( HWND  hDlg,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 236 of file kbdlayout.c.

240 {
241  HKL hKl;
242 
243  switch (Msg)
244  {
245  case WM_INITDIALOG:
246  {
247  WCHAR Buf[255];
248  UpdateData(hDlg);
249  hMainDlg = hDlg;
250 
251  SubclassWnd(GetDlgItem(hDlg, IDC_LIST), L"List");
252  SubclassWnd(GetDlgItem(hDlg, IDC_EDIT1), L"Edit1");
253  SubclassWnd(GetDlgItem(hDlg, IDC_KLID), L"Klid");
254  SubclassWnd(GetDlgItem(hDlg, ID_CANCEL), L"CancelB");
255  SubclassWnd(GetDlgItem(hDlg, IDC_ACTIVATE), L"ActivateB");
256  SubclassWnd(GetDlgItem(hDlg, IDC_REFRESH), L"RefreshB");
257  SubclassWnd(GetDlgItem(hDlg, IDC_UNLOAD), L"UnloadB");
258  SubclassWnd(GetDlgItem(hDlg, IDC_LOAD), L"LoadB");
259 
261  SetWindowText(GetDlgItem(hDlg, IDC_KLID), L"00000419");
262 
263  swprintf(Buf, L"Current thread id: %d", GetCurrentThreadId());
265 
266  SetWindowText(GetDlgItem(hDlg, IDC_DELAY), L"0");
267 
268  return 0;
269  } /* WM_INITDIALOG */
270 
271  case WM_COMMAND:
272  {
273  switch(LOWORD(wParam))
274  {
275  case ID_CANCEL:
276  {
277  EndDialog(hDlg, ERROR_CANCELLED);
278  break;
279  }
280 
281  case IDC_ACTIVATE:
282  {
283  if((hKl = GetActivateHandle(hDlg)) != INVALID_HANDLE_VALUE)
284  {
286  if(!(hKl = ActivateKeyboardLayout(hKl, GetActivateFlags(hDlg))))
287  FormatBox(hDlg, MB_ICONERROR, L"Error",
288  L"ActivateKeyboardLayout() failed. %d", GetLastError());
289  else UpdateData(hDlg);
290  //FormatBox(hDlg, 0, L"Activated", L"Prev - %x, err - %d.", hKl,
291  // GetLastError());
292  }
293  else MessageBox(hDlg, L"No item selected", L"Error", MB_ICONERROR);
294  break;
295  }
296 
297  case IDC_UNLOAD:
298  {
299  if((hKl = GetSelectedLayout(hDlg)) != INVALID_HANDLE_VALUE)
300  {
302  if(!UnloadKeyboardLayout(hKl))
303  FormatBox(hDlg, MB_ICONERROR, L"Error",
304  L"UnloadKeyboardLayout() failed. %d",
305  GetLastError());
306  else UpdateData(hDlg);
307  }
308  else MessageBox(hDlg, L"No item selected", L"Error", MB_ICONERROR);
309  break;
310  }
311 
312  case IDC_LOAD:
313  {
314  WCHAR buf[255];
315  GetWindowText(GetDlgItem(hDlg, IDC_KLID), buf, sizeof(buf));
317  if(!LoadKeyboardLayout(buf, GetLoadFlags(hDlg)))
318  FormatBox(hDlg, MB_ICONERROR, L"Error",
319  L"LoadKeyboardLayout() failed. %d",
320  GetLastError());
321  else UpdateData(hDlg);
322  break;
323  }
324 
325  case IDC_REFRESH:
326  {
327  UpdateData(hDlg);
328  break;
329  }
330 
331  case IDC_NEWTHREAD:
332  {
333  if(!CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL))
334  {
335  FormatBox(hDlg, MB_ICONERROR, L"Error!",
336  L"Can not create thread (%d).", GetLastError());
337  }
338  }
339 
340  case IDC_LIST:
341  {
342  if(HIWORD(wParam) == LBN_SELCHANGE)
343  {
344  WCHAR buf[25];
345  if((hKl = GetSelectedLayout(hDlg)) != NULL)
346  {
347  swprintf(buf, L"%x", hKl);
349  }
350  }
351  break;
352  }
353 
354  }
355 
356  return TRUE;
357  } /* WM_COMMAND */
358 
359 
360  case WM_INPUTLANGCHANGE:
361  {
362  FormatMsg(L"dlg WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", lParam, wParam);
363  return FALSE;
364  }
365 
366  case WM_INPUTLANGCHANGEREQUEST:
367  {
368  FormatMsg(L"dlg WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", lParam, wParam);
369  UpdateData(hDlg);
370  return FALSE;
371  }
372 
373  case WM_CLOSE:
374  {
375  EndDialog(hDlg, ERROR_CANCELLED);
376  return TRUE;
377  } /* WM_CLOSE */
378 
379  default:
380  return FALSE;
381  }
382 
383 }
HKL GetSelectedLayout(HWND hDlg)
Definition: kbdlayout.c:209
DWORD GetLoadFlags(HWND hDlg)
Definition: kbdlayout.c:172
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)
void SubclassWnd(HWND hWnd, WCHAR *Name)
Definition: kbdlayout.c:143
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define TRUE
Definition: types.h:120
DWORD GetActivateFlags(HWND hDlg)
Definition: kbdlayout.c:152
#define IDC_REFRESH
Definition: resource.h:31
#define INVALID_HANDLE_VALUE
Definition: compat.h:590
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
HKL GetActivateHandle(HWND hDlg)
Definition: kbdlayout.c:219
#define IDC_HANDLE
Definition: resource.h:32
#define swprintf
Definition: precomp.h:40
#define LBN_SELCHANGE
Definition: winuser.h:2057
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define IDC_ACTIVATE
Definition: resource.h:13
#define IDC_LOAD
Definition: resource.h:30
#define GetWindowText
Definition: winuser.h:5773
#define LoadKeyboardLayout
Definition: winuser.h:5791
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define FALSE
Definition: types.h:117
#define ID_CANCEL
Definition: resource.h:6
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
#define IDC_LIST
Definition: resource.h:93
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
#define IDC_EDIT1
Definition: resource.h:7
#define WM_CLOSE
Definition: winuser.h:1603
void UpdateData(HWND hDlg)
Definition: kbdlayout.c:73
void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format,...)
Definition: kbdlayout.c:112
#define IDC_UNLOAD
Definition: resource.h:12
#define IDC_KLID
Definition: resource.h:23
#define IDC_DELAY
Definition: resource.h:11
static const WCHAR L[]
Definition: oid.c:1250
#define MB_ICONERROR
Definition: winuser.h:781
#define IDC_NEWTHREAD
Definition: resource.h:34
#define MessageBox
Definition: winuser.h:5797
#define WM_COMMAND
Definition: winuser.h:1722
UINT_PTR HKL
Definition: msctf.idl:101
#define IDC_FROMLIST
Definition: resource.h:18
UINT GetDelayMilliseconds(HWND hDlg)
Definition: kbdlayout.c:197
#define ERROR_CANCELLED
Definition: winerror.h:726
struct @1599 Msg[]
#define SetWindowText
Definition: winuser.h:5832
#define NULL
Definition: types.h:112
#define IDC_FROMEDIT
Definition: resource.h:29
#define HIWORD(l)
Definition: typedefs.h:247
#define IDC_CURTHREAD
Definition: resource.h:33
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
void FormatMsg(WCHAR *format,...)
Definition: kbdlayout.c:102
#define WM_INITDIALOG
Definition: winuser.h:1721
DWORD WINAPI ThreadProc(LPVOID lpParam)
Definition: kbdlayout.c:28
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
HWND hMainDlg
Definition: kbdlayout.c:20

Referenced by ThreadProc().

◆ SubclassWnd()

void SubclassWnd ( HWND  hWnd,
WCHAR Name 
)

Definition at line 143 of file kbdlayout.c.

144 {
145  WND_DATA *data = HeapAlloc(GetProcessHeap(), 0, sizeof(WND_DATA));
147  wcsncpy(data->WndName, Name, 25);
149  return;
150 }
HWND hWnd
Definition: settings.c:17
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
LRESULT CALLBACK WndSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: kbdlayout.c:123
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define GWLP_WNDPROC
Definition: treelist.c:66
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276

Referenced by MainDialogProc().

◆ ThreadProc()

DWORD WINAPI ThreadProc ( LPVOID  lpParam)

Definition at line 28 of file kbdlayout.c.

29 {
30 
33  NULL,
35  (LPARAM)NULL);
36 
37  return 0;
38 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
HINSTANCE hInst
Definition: kbdlayout.c:19
#define IDD_MAINDIALOG
Definition: resource.h:5
LONG_PTR LPARAM
Definition: windef.h:208
#define DialogBoxParam
Definition: winuser.h:5739
INT_PTR(CALLBACK * DLGPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2871
LRESULT MainDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: kbdlayout.c:236
#define NULL
Definition: types.h:112

Referenced by MainDialogProc(), and WinMain().

◆ UpdateData()

void UpdateData ( HWND  hDlg)

Definition at line 73 of file kbdlayout.c.

74 {
76  WCHAR buf2[512];
77 
78  HWND hList;
79  HKL *klList, hKl;
80  int n, i,j;
81 
83  swprintf(buf2, L"Active: %s (%x)", buf, GetKeyboardLayout(0));
84  SetWindowText(GetDlgItem(hDlg, IDC_ACTIVE), buf2);
85 
86  hList = GetDlgItem(hDlg, IDC_LIST);
88 
89  n = GetKlList(&klList);
90  hKl = GetKeyboardLayout(0);
91  for(i = 0; i < n; i++)
92  {
93  swprintf(buf, L"%x", klList[i] );
95  SendMessage(hList, LB_SETITEMDATA, j, (LPARAM) klList[i]);
96  if(klList[i] == hKl) SendMessage(hList, LB_SETCURSEL, j, 0);
97  }
98 
99  FreeKlList(klList);
100 }
#define LB_SETCURSEL
Definition: winuser.h:2045
void FreeKlList(HKL *list)
Definition: kbdlayout.c:67
#define KL_NAMELENGTH
Definition: winuser.h:122
#define LB_ADDSTRING
Definition: winuser.h:2013
#define GetKeyboardLayoutName
Definition: winuser.h:5761
GLdouble n
Definition: glext.h:7729
#define swprintf
Definition: precomp.h:40
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define LB_RESETCONTENT
Definition: winuser.h:2037
#define IDC_LIST
Definition: resource.h:93
LONG_PTR LPARAM
Definition: windef.h:208
int GetKlList(HKL **list)
Definition: kbdlayout.c:55
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define LB_SETITEMDATA
Definition: winuser.h:2047
static const WCHAR L[]
Definition: oid.c:1250
UINT_PTR HKL
Definition: msctf.idl:101
HWND hList
Definition: livecd.c:10
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define SetWindowText
Definition: winuser.h:5832
#define SendMessage
Definition: winuser.h:5818
#define IDC_ACTIVE
Definition: resource.h:9

Referenced by MainDialogProc(), and WndSubclassProc().

◆ WinMain()

INT WINAPI WinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPSTR  lpCmdLine,
int  nCmdShow 
)

Definition at line 40 of file kbdlayout.c.

44 {
45 
46 
47  hInst = hInstance;
48 
49  ThreadProc(0);
50 
51  return 0;
52 }
HINSTANCE hInst
Definition: kbdlayout.c:19
HINSTANCE hInstance
Definition: charmap.c:20
DWORD WINAPI ThreadProc(LPVOID lpParam)
Definition: kbdlayout.c:28

◆ WndSubclassProc()

LRESULT CALLBACK WndSubclassProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 123 of file kbdlayout.c.

124 {
126 
127  if(uMsg == WM_INPUTLANGCHANGE)
128  {
129  FormatMsg(L"%s: WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", data->WndName, lParam, wParam);
131  //Pass message to defwindowproc
132  }
133  else if(uMsg == WM_INPUTLANGCHANGEREQUEST)
134  {
135  FormatMsg(L"%s: WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", data->WndName, lParam, wParam);
137  //Pass message to defwindowproc
138  }
139 
140  return ( CallWindowProc( data->OrigProc, hwnd, uMsg, wParam, lParam) );
141 }
#define CallWindowProc
Definition: winuser.h:5710
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WPARAM wParam
Definition: combotst.c:138
#define GWLP_USERDATA
Definition: treelist.c:63
void UpdateData(HWND hDlg)
Definition: kbdlayout.c:73
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static const WCHAR L[]
Definition: oid.c:1250
#define GetWindowLongPtr
Definition: treelist.c:73
void FormatMsg(WCHAR *format,...)
Definition: kbdlayout.c:102
LPARAM lParam
Definition: combotst.c:139
HWND hMainDlg
Definition: kbdlayout.c:20

Referenced by SubclassWnd().

Variable Documentation

◆ hInst

HINSTANCE hInst

Definition at line 19 of file kbdlayout.c.

Referenced by AboutDialogWndProc(), OnAbout(), ShowAboutBox(), ThreadProc(), and WinMain().

◆ hMainDlg

HWND hMainDlg

Definition at line 20 of file kbdlayout.c.

Referenced by MainDialogProc(), and WndSubclassProc().