ReactOS 0.4.16-dev-197-g92996da
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

INT_PTR CALLBACK 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 8 of file kbdlayout.c.

Function Documentation

◆ FormatBox()

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

Definition at line 106 of file kbdlayout.c.

107{
108 WCHAR buf[255];
109 va_list argptr;
110 va_start(argptr, Format);
111 _vsnwprintf(buf, sizeof(buf)-1, Format, argptr);
112 MessageBox(hWnd, buf, Caption, Flags);
113 va_end(argptr);
114}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
HWND hWnd
Definition: settings.c:17
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
#define MessageBox
Definition: winuser.h:5834
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by MainDialogProc().

◆ FormatMsg()

void FormatMsg ( WCHAR format,
  ... 
)

Definition at line 96 of file kbdlayout.c.

97{
98 WCHAR buf[255];
99 va_list argptr;
100 va_start(argptr, format);
101 _vsnwprintf(buf, sizeof(buf)-1, format, argptr);
102 MessageBox(0, buf, L"msg", 0);
103 va_end(argptr);
104}
#define L(x)
Definition: ntvdm.h:50
Definition: format.c:58

Referenced by MainDialogProc(), and WndSubclassProc().

◆ FreeKlList()

void FreeKlList ( HKL list)

Definition at line 62 of file kbdlayout.c.

63{
65}
Definition: list.h:37
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by UpdateData().

◆ GetActivateFlags()

DWORD GetActivateFlags ( HWND  hDlg)

Definition at line 144 of file kbdlayout.c.

145{
146 DWORD ret = 0;
147
149 ret |= KLF_REORDER;
150
152 ret |= KLF_RESET;
153
155 ret |= KLF_SHIFTLOCK;
156
159
160 return ret;
161}
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_KLF_SHIFTLOCK
Definition: resource.h:17
#define IDC_KLF_RESET
Definition: resource.h:15
#define IDC_KLF_SETFORPROCESS
Definition: resource.h:16
#define IDC_KLF_REORDER
Definition: resource.h:14
int ret
#define KLF_SETFORPROCESS
Definition: winuser.h:117
#define KLF_REORDER
Definition: winuser.h:114
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)

Referenced by MainDialogProc().

◆ GetActivateHandle()

HKL GetActivateHandle ( HWND  hDlg)

Definition at line 210 of file kbdlayout.c.

211{
213 return GetSelectedLayout(hDlg);
214 else if(IsDlgButtonChecked(hDlg, IDC_HKL_NEXT))
215 return (HKL)HKL_NEXT;
216
217 return (HKL)HKL_PREV;
218}
HKL GetSelectedLayout(HWND hDlg)
Definition: kbdlayout.c:200
#define IDC_HKL_NEXT
Definition: resource.h:19
#define IDC_FROMLIST
Definition: resource.h:18
UINT_PTR HKL
Definition: msctf.idl:143
#define HKL_PREV
Definition: winuser.h:110
#define HKL_NEXT
Definition: winuser.h:109

Referenced by MainDialogProc().

◆ GetDelayMilliseconds()

UINT GetDelayMilliseconds ( HWND  hDlg)

Definition at line 188 of file kbdlayout.c.

189{
190 WCHAR Buf[255];
191 UINT ret;
192
193 GetWindowText(GetDlgItem(hDlg, IDC_DELAY), Buf, sizeof(Buf));
194
195 swscanf(Buf, L"%d", &ret);
196
197 return ret*1000;
198}
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
#define IDC_DELAY
Definition: resource.h:11
unsigned int UINT
Definition: ndis.h:50
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define GetWindowText
Definition: winuser.h:5810

Referenced by MainDialogProc().

◆ GetKlList()

int GetKlList ( HKL **  list)

Definition at line 50 of file kbdlayout.c.

51{
52 HKL *ret;
53 int n;
54
56 ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HKL)*n);
58 *list = ret;
59 return n;
60}
#define NULL
Definition: types.h:112
#define HeapAlloc
Definition: compat.h:733
GLdouble n
Definition: glext.h:7729
UINT WINAPI GetKeyboardLayoutList(_In_ int nBuff, _Out_writes_to_opt_(nBuff, return) HKL FAR *lpList)

Referenced by UpdateData().

◆ GetLoadFlags()

DWORD GetLoadFlags ( HWND  hDlg)

Definition at line 163 of file kbdlayout.c.

164{
165 DWORD ret = 0;
166
168 ret |= KLF_ACTIVATE;
169
172
174 ret |= KLF_REORDER;
175
178
181
184
185 return ret;
186}
#define IDL_KLF_REORDER
Definition: resource.h:24
#define IDL_KLF_SUBSTITUTE_OK
Definition: resource.h:26
#define IDL_KLF_NOTELLSHELL
Definition: resource.h:22
#define IDL_KLF_REPLACELANG
Definition: resource.h:25
#define IDL_KLF_ACTIVATE
Definition: resource.h:21
#define IDL_KLF_SETFORPROCESS
Definition: resource.h:27
#define KLF_REPLACELANG
Definition: winuser.h:115
#define KLF_ACTIVATE
Definition: winuser.h:111
#define KLF_SUBSTITUTE_OK
Definition: winuser.h:112
#define KLF_NOTELLSHELL
Definition: winuser.h:116

Referenced by MainDialogProc().

◆ GetSelectedLayout()

HKL GetSelectedLayout ( HWND  hDlg)

Definition at line 200 of file kbdlayout.c.

201{
202 int n;
203 HWND hList;
204 hList = GetDlgItem(hDlg, IDC_LIST);
205 if((n = SendMessage(hList, LB_GETCURSEL, 0, 0)) != LB_ERR)
206 return (HKL) SendMessage(hList, LB_GETITEMDATA, n, 0);
207 else return INVALID_HANDLE_VALUE;
208}
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
HWND hList
Definition: livecd.c:10
#define IDC_LIST
Definition: resource.h:93
#define LB_ERR
Definition: winuser.h:2435
#define LB_GETITEMDATA
Definition: winuser.h:2044
#define SendMessage
Definition: winuser.h:5855
#define LB_GETCURSEL
Definition: winuser.h:2042

Referenced by GetActivateHandle(), and MainDialogProc().

◆ MainDialogProc()

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

Definition at line 220 of file kbdlayout.c.

224{
225 HKL hKl;
226
227 switch (Msg)
228 {
229 case WM_INITDIALOG:
230 {
231 WCHAR Buf[255];
232 UpdateData(hDlg);
233 hMainDlg = hDlg;
234
235 SubclassWnd(GetDlgItem(hDlg, IDC_LIST), L"List");
236 SubclassWnd(GetDlgItem(hDlg, IDC_EDIT1), L"Edit1");
237 SubclassWnd(GetDlgItem(hDlg, IDC_KLID), L"Klid");
238 SubclassWnd(GetDlgItem(hDlg, ID_CANCEL), L"CancelB");
239 SubclassWnd(GetDlgItem(hDlg, IDC_ACTIVATE), L"ActivateB");
240 SubclassWnd(GetDlgItem(hDlg, IDC_REFRESH), L"RefreshB");
241 SubclassWnd(GetDlgItem(hDlg, IDC_UNLOAD), L"UnloadB");
242 SubclassWnd(GetDlgItem(hDlg, IDC_LOAD), L"LoadB");
243
245 SetWindowText(GetDlgItem(hDlg, IDC_KLID), L"00000419");
246
247 swprintf(Buf, L"Current thread id: %d", GetCurrentThreadId());
249
251
252 return 0;
253 } /* WM_INITDIALOG */
254
255 case WM_COMMAND:
256 {
257 switch(LOWORD(wParam))
258 {
259 case ID_CANCEL:
260 {
262 break;
263 }
264
265 case IDC_ACTIVATE:
266 {
267 if((hKl = GetActivateHandle(hDlg)) != INVALID_HANDLE_VALUE)
268 {
270 if(!(hKl = ActivateKeyboardLayout(hKl, GetActivateFlags(hDlg))))
271 FormatBox(hDlg, MB_ICONERROR, L"Error",
272 L"ActivateKeyboardLayout() failed. %d", GetLastError());
273 else UpdateData(hDlg);
274 //FormatBox(hDlg, 0, L"Activated", L"Prev - %x, err - %d.", hKl,
275 // GetLastError());
276 }
277 else MessageBox(hDlg, L"No item selected", L"Error", MB_ICONERROR);
278 break;
279 }
280
281 case IDC_UNLOAD:
282 {
283 if((hKl = GetSelectedLayout(hDlg)) != INVALID_HANDLE_VALUE)
284 {
286 if(!UnloadKeyboardLayout(hKl))
287 FormatBox(hDlg, MB_ICONERROR, L"Error",
288 L"UnloadKeyboardLayout() failed. %d",
289 GetLastError());
290 else UpdateData(hDlg);
291 }
292 else MessageBox(hDlg, L"No item selected", L"Error", MB_ICONERROR);
293 break;
294 }
295
296 case IDC_LOAD:
297 {
298 WCHAR buf[255];
299 GetWindowText(GetDlgItem(hDlg, IDC_KLID), buf, sizeof(buf));
302 FormatBox(hDlg, MB_ICONERROR, L"Error",
303 L"LoadKeyboardLayout() failed. %d",
304 GetLastError());
305 else UpdateData(hDlg);
306 break;
307 }
308
309 case IDC_REFRESH:
310 {
311 UpdateData(hDlg);
312 break;
313 }
314
315 case IDC_NEWTHREAD:
316 {
317 if(!CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL))
318 {
319 FormatBox(hDlg, MB_ICONERROR, L"Error!",
320 L"Can not create thread (%d).", GetLastError());
321 }
322 }
323
324 case IDC_LIST:
325 {
327 {
328 WCHAR buf[25];
329 if((hKl = GetSelectedLayout(hDlg)) != NULL)
330 {
331 swprintf(buf, L"%x", hKl);
333 }
334 }
335 break;
336 }
337 }
338
339 return TRUE;
340 } /* WM_COMMAND */
341
342 case WM_INPUTLANGCHANGE:
343 {
344 FormatMsg(L"dlg WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", lParam, wParam);
345 return FALSE;
346 }
347
348 case WM_INPUTLANGCHANGEREQUEST:
349 {
350 FormatMsg(L"dlg WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", lParam, wParam);
351 UpdateData(hDlg);
352 return FALSE;
353 }
354
355 case WM_CLOSE:
356 {
358 return TRUE;
359 } /* WM_CLOSE */
360
361 default:
362 return FALSE;
363 }
364}
struct @1636 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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:137
#define swprintf
Definition: precomp.h:40
void SubclassWnd(HWND hWnd, WCHAR *Name)
Definition: kbdlayout.c:136
void UpdateData(HWND hDlg)
Definition: kbdlayout.c:67
void FormatMsg(WCHAR *format,...)
Definition: kbdlayout.c:96
DWORD WINAPI ThreadProc(LPVOID lpParam)
Definition: kbdlayout.c:27
void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format,...)
Definition: kbdlayout.c:106
DWORD GetLoadFlags(HWND hDlg)
Definition: kbdlayout.c:163
HWND hMainDlg
Definition: kbdlayout.c:19
DWORD GetActivateFlags(HWND hDlg)
Definition: kbdlayout.c:144
HKL GetActivateHandle(HWND hDlg)
Definition: kbdlayout.c:210
UINT GetDelayMilliseconds(HWND hDlg)
Definition: kbdlayout.c:188
#define IDC_LOAD
Definition: resource.h:30
#define IDC_CURTHREAD
Definition: resource.h:33
#define IDC_HANDLE
Definition: resource.h:32
#define IDC_KLID
Definition: resource.h:23
#define IDC_UNLOAD
Definition: resource.h:12
#define IDC_ACTIVATE
Definition: resource.h:13
#define IDC_FROMEDIT
Definition: resource.h:29
#define ID_CANCEL
Definition: resource.h:6
#define IDC_REFRESH
Definition: resource.h:31
#define IDC_EDIT1
Definition: resource.h:7
#define IDC_NEWTHREAD
Definition: resource.h:34
#define LOWORD(l)
Definition: pedump.c:82
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
#define HIWORD(l)
Definition: typedefs.h:247
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
#define ERROR_CANCELLED
Definition: winerror.h:726
#define WM_CLOSE
Definition: winuser.h:1624
BOOL WINAPI UnloadKeyboardLayout(_In_ HKL)
#define WM_COMMAND
Definition: winuser.h:1743
#define LoadKeyboardLayout
Definition: winuser.h:5828
#define WM_INITDIALOG
Definition: winuser.h:1742
#define MB_ICONERROR
Definition: winuser.h:790
#define LBN_SELCHANGE
Definition: winuser.h:2078
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define SetWindowText
Definition: winuser.h:5869
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by ThreadProc().

◆ SubclassWnd()

void SubclassWnd ( HWND  hWnd,
WCHAR Name 
)

Definition at line 136 of file kbdlayout.c.

137{
140 wcsncpy(data->WndName, Name, 25);
142}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LRESULT CALLBACK WndSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: kbdlayout.c:116
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_WNDPROC
Definition: treelist.c:66
#define GWLP_USERDATA
Definition: treelist.c:63
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909

Referenced by MainDialogProc().

◆ ThreadProc()

DWORD WINAPI ThreadProc ( LPVOID  lpParam)

Definition at line 27 of file kbdlayout.c.

28{
31 NULL,
33 (LPARAM)NULL);
34
35 return 0;
36}
HINSTANCE hInst
Definition: kbdlayout.c:18
INT_PTR CALLBACK MainDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: kbdlayout.c:220
#define IDD_MAINDIALOG
Definition: resource.h:5
LONG_PTR LPARAM
Definition: windef.h:208
#define DialogBoxParam
Definition: winuser.h:5776
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by MainDialogProc(), and WinMain().

◆ UpdateData()

void UpdateData ( HWND  hDlg)

Definition at line 67 of file kbdlayout.c.

68{
70 WCHAR buf2[512];
71
72 HWND hList;
73 HKL *klList, hKl;
74 int n, i,j;
75
77 swprintf(buf2, L"Active: %s (%x)", buf, GetKeyboardLayout(0));
79
80 hList = GetDlgItem(hDlg, IDC_LIST);
82
83 n = GetKlList(&klList);
84 hKl = GetKeyboardLayout(0);
85 for(i = 0; i < n; i++)
86 {
87 swprintf(buf, L"%x", klList[i] );
90 if(klList[i] == hKl) SendMessage(hList, LB_SETCURSEL, j, 0);
91 }
92
93 FreeKlList(klList);
94}
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
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
void FreeKlList(HKL *list)
Definition: kbdlayout.c:62
int GetKlList(HKL **list)
Definition: kbdlayout.c:50
#define IDC_ACTIVE
Definition: resource.h:9
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
#define KL_NAMELENGTH
Definition: winuser.h:122
#define LB_ADDSTRING
Definition: winuser.h:2034
#define LB_RESETCONTENT
Definition: winuser.h:2058
#define GetKeyboardLayoutName
Definition: winuser.h:5798
#define LB_SETITEMDATA
Definition: winuser.h:2068
#define LB_SETCURSEL
Definition: winuser.h:2066

Referenced by MainDialogProc(), and WndSubclassProc().

◆ WinMain()

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

Definition at line 38 of file kbdlayout.c.

42{
44
45 ThreadProc(0);
46
47 return 0;
48}
HINSTANCE hInstance
Definition: charmap.c:19

◆ WndSubclassProc()

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

Definition at line 116 of file kbdlayout.c.

117{
119
120 if(uMsg == WM_INPUTLANGCHANGE)
121 {
122 FormatMsg(L"%s: WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", data->WndName, lParam, wParam);
124 //Pass message to defwindowproc
125 }
126 else if(uMsg == WM_INPUTLANGCHANGEREQUEST)
127 {
128 FormatMsg(L"%s: WM_INPUTLANGCHANGEREQUEST lParam=%x wParam=%x\n", data->WndName, lParam, wParam);
130 //Pass message to defwindowproc
131 }
132
133 return CallWindowProc(data->OrigProc, hwnd, uMsg, wParam, lParam);
134}
#define GetWindowLongPtr
Definition: treelist.c:73
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define CallWindowProc
Definition: winuser.h:5747

Referenced by SubclassWnd().

Variable Documentation

◆ hInst

HINSTANCE hInst

Definition at line 18 of file kbdlayout.c.

Referenced by ThreadProc(), and WinMain().

◆ hMainDlg

HWND hMainDlg

Definition at line 19 of file kbdlayout.c.

Referenced by MainDialogProc(), and WndSubclassProc().