ReactOS  0.4.13-dev-92-gf251225
main.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS On-Screen Keyboard
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PURPOSE: On-screen keyboard.
5  * COPYRIGHT: Denis ROBERT
6  * Copyright 2019 BiČ™oc George (fraizeraust99 at gmail dot com)
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include "osk.h"
12 #include "settings.h"
13 
14 /* GLOBALS ********************************************************************/
15 
17 
18 /* Functions */
19 int OSK_SetImage(int IdDlgItem, int IdResource);
20 int OSK_DlgInitDialog(HWND hDlg);
21 int OSK_DlgClose(void);
22 int OSK_DlgTimer(void);
23 BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl);
25 
28 
29 /* FUNCTIONS ******************************************************************/
30 
31 /***********************************************************************
32  *
33  * OSK_SetImage
34  *
35  * Set an image on a button
36  */
37 int OSK_SetImage(int IdDlgItem, int IdResource)
38 {
39  HICON hIcon;
40  HWND hWndItem;
41 
43  IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
44  if (hIcon == NULL)
45  return FALSE;
46 
47  hWndItem = GetDlgItem(Globals.hMainWnd, IdDlgItem);
48  if (hWndItem == NULL)
49  {
51  return FALSE;
52  }
53 
55 
56  /* The system automatically deletes these resources when the process that created them terminates (MSDN) */
57 
58  return TRUE;
59 }
60 
61 /***********************************************************************
62  *
63  * OSK_WarningProc
64  *
65  * Function handler for the warning dialog box on startup
66  */
68 {
70 
71  switch (Msg)
72  {
73  case WM_INITDIALOG:
74  {
75  return TRUE;
76  }
77 
78  case WM_COMMAND:
79  {
80  switch (LOWORD(wParam))
81  {
83  {
84  Globals.bShowWarning = !IsDlgButtonChecked(hDlg, IDC_SHOWWARNINGCHECK);
85  return TRUE;
86  }
87 
88  case IDOK:
89  case IDCANCEL:
90  {
91  EndDialog(hDlg, LOWORD(wParam));
92  return TRUE;
93  }
94  }
95  break;
96  }
97  }
98 
99  return FALSE;
100 }
101 
102 /***********************************************************************
103  *
104  * OSK_About
105  *
106  * Initializes the "About" dialog box
107  */
109 {
111  WCHAR szAuthors[MAX_BUFF];
112  HICON OSKIcon;
113 
114  /* Load the icon */
116 
117  /* Load the strings into the "About" dialog */
119  LoadStringW(Globals.hInstance, STRING_AUTHORS, szAuthors, countof(szAuthors));
120 
121  /* Finally, execute the "About" dialog by using the Shell routine */
122  ShellAboutW(Globals.hMainWnd, szTitle, szAuthors, OSKIcon);
123 
124  /* Once done, destroy the icon */
125  DestroyIcon(OSKIcon);
126 }
127 
128 
129 /***********************************************************************
130  *
131  * OSK_DlgInitDialog
132  *
133  * Handling of WM_INITDIALOG
134  */
136 {
138  HMONITOR monitor;
140  POINT Pt;
141  RECT rcWindow, rcDlgIntersect;
142 
143  /* Save handle */
144  Globals.hMainWnd = hDlg;
145 
146  /* Check the checked menu item before displaying the modal box */
147  if (Globals.bIsEnhancedKeyboard)
148  {
149  /* Enhanced keyboard dialog chosen, set the respective menu item as checked */
152  }
153  else
154  {
155  /* Standard keyboard dialog chosen, set the respective menu item as checked */
158  }
159 
160  /* Check if the "Click Sound" option was chosen before (and if so, then tick the menu item) */
161  if (Globals.bSoundClick)
162  {
164  }
165 
166  /* Set the application's icon */
169  if (hIcon || hIconSm)
170  {
171  /* Set the window icons (they are deleted when the process terminates) */
174  }
175 
176  /* Get screen info */
177  memset(&Pt, 0, sizeof(Pt));
178  monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
179  info.cbSize = sizeof(info);
180  GetMonitorInfoW(monitor, &info);
181  GetWindowRect(hDlg, &rcWindow);
182 
183  /*
184  If the coordination values are default then re-initialize using the specific formulas
185  to move the dialog at the bottom of the screen.
186  */
187  if (Globals.PosX == CW_USEDEFAULT && Globals.PosY == CW_USEDEFAULT)
188  {
189  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
190  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
191  }
192 
193  /*
194  Calculate the intersection of two rectangle sources (dialog and work desktop area).
195  If such sources do not intersect, then the dialog is deemed as "off screen".
196  */
197  if (IntersectRect(&rcDlgIntersect, &rcWindow, &info.rcWork) == 0)
198  {
199  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
200  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
201  }
202  else
203  {
204  /*
205  There's still some intersection but we're not for sure if it is sufficient (the dialog could also be partially hidden).
206  Therefore, check the remaining intersection if it's enough.
207  */
208  if (rcWindow.top < info.rcWork.top || rcWindow.left < info.rcWork.left || rcWindow.right > info.rcWork.right || rcWindow.bottom > info.rcWork.bottom)
209  {
210  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
211  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
212  }
213  }
214 
215  /* Move the dialog according to the placement coordination */
216  SetWindowPos(hDlg, HWND_TOP, Globals.PosX, Globals.PosY, 0, 0, SWP_NOSIZE);
217 
218  /* Set icon on visual buttons */
235 
236  /* Create a green brush for leds */
237  Globals.hBrushGreenLed = CreateSolidBrush(RGB(0, 255, 0));
238 
239  /* Set a timer for periodics tasks */
240  Globals.iTimer = SetTimer(hDlg, 0, 200, NULL);
241 
242  return TRUE;
243 }
244 
245 /***********************************************************************
246  *
247  * OSK_DlgClose
248  *
249  * Handling of WM_CLOSE
250  */
251 int OSK_DlgClose(void)
252 {
254 
255  /* Release Ctrl, Shift, Alt keys */
256  OSK_ReleaseKey(SCAN_CODE_44); // Left shift
257  OSK_ReleaseKey(SCAN_CODE_57); // Right shift
258  OSK_ReleaseKey(SCAN_CODE_58); // Left ctrl
259  OSK_ReleaseKey(SCAN_CODE_60); // Left alt
260  OSK_ReleaseKey(SCAN_CODE_62); // Right alt
261  OSK_ReleaseKey(SCAN_CODE_64); // Right ctrl
262 
263  /* delete GDI objects */
264  if (Globals.hBrushGreenLed) DeleteObject(Globals.hBrushGreenLed);
265 
266  /* Save the settings to the registry hive */
268 
269  return TRUE;
270 }
271 
272 /***********************************************************************
273  *
274  * OSK_DlgTimer
275  *
276  * Handling of WM_TIMER
277  */
278 int OSK_DlgTimer(void)
279 {
280  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
281  HWND hWndActiveWindow;
282 
283  hWndActiveWindow = GetForegroundWindow();
284  if (hWndActiveWindow != NULL && hWndActiveWindow != Globals.hMainWnd)
285  {
286  Globals.hActiveWnd = hWndActiveWindow;
287  }
288 
289  /* Always redraw leds because it can be changed by the real keyboard) */
293 
294  return TRUE;
295 }
296 
297 /***********************************************************************
298  *
299  * OSK_DlgCommand
300  *
301  * All handling of dialog command
302  */
303 BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl)
304 {
305  WORD ScanCode;
306  INPUT Input;
307  BOOL bExtendedKey;
308  BOOL bKeyDown;
309  BOOL bKeyUp;
310  LONG WindowStyle;
311 
312  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
313  if (Globals.hActiveWnd)
314  {
315  MSG msg;
316 
317  SetForegroundWindow(Globals.hActiveWnd);
318  while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
319  {
322  }
323  }
324 
325  /* KeyDown and/or KeyUp ? */
326  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
327  if ((WindowStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX)
328  {
329  /* 2-states key like Shift, Alt, Ctrl, ... */
330  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
331  {
332  bKeyDown = TRUE;
333  bKeyUp = FALSE;
334  }
335  else
336  {
337  bKeyDown = FALSE;
338  bKeyUp = TRUE;
339  }
340  }
341  else
342  {
343  /* Other key */
344  bKeyDown = TRUE;
345  bKeyUp = TRUE;
346  }
347 
348  /* Extended key ? */
349  ScanCode = wCommand;
350  if (ScanCode & 0x0200)
351  bExtendedKey = TRUE;
352  else
353  bExtendedKey = FALSE;
354  ScanCode &= 0xFF;
355 
356  /* Press and release the key */
357  if (bKeyDown)
358  {
359  Input.type = INPUT_KEYBOARD;
360  Input.ki.wVk = 0;
361  Input.ki.wScan = ScanCode;
362  Input.ki.time = GetTickCount();
363  Input.ki.dwExtraInfo = GetMessageExtraInfo();
364  Input.ki.dwFlags = KEYEVENTF_SCANCODE;
365  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
366  SendInput(1, &Input, sizeof(Input));
367  }
368 
369  if (bKeyUp)
370  {
371  Input.type = INPUT_KEYBOARD;
372  Input.ki.wVk = 0;
373  Input.ki.wScan = ScanCode;
374  Input.ki.time = GetTickCount();
375  Input.ki.dwExtraInfo = GetMessageExtraInfo();
376  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
377  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
378  SendInput(1, &Input, sizeof(Input));
379  }
380 
381  /* Play the sound during clicking event (only if "Use Click Sound" menu option is ticked) */
382  if (Globals.bSoundClick)
383  {
385  }
386 
387  return TRUE;
388 }
389 
390 /***********************************************************************
391  *
392  * OSK_ReleaseKey
393  *
394  * Release the key of ID wCommand
395  */
397 {
398  INPUT Input;
399  BOOL bExtendedKey;
400  LONG WindowStyle;
401  HWND hWndControl;
402 
403  /* Is it a 2-states key ? */
404  hWndControl = GetDlgItem(Globals.hMainWnd, ScanCode);
405  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
406  if ((WindowStyle & BS_AUTOCHECKBOX) != BS_AUTOCHECKBOX) return FALSE;
407 
408  /* Is the key down ? */
409  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) != BST_CHECKED) return TRUE;
410 
411  /* Extended key ? */
412  if (ScanCode & 0x0200)
413  bExtendedKey = TRUE;
414  else
415  bExtendedKey = FALSE;
416  ScanCode &= 0xFF;
417 
418  /* Release the key */
419  Input.type = INPUT_KEYBOARD;
420  Input.ki.wVk = 0;
421  Input.ki.wScan = ScanCode;
422  Input.ki.time = GetTickCount();
423  Input.ki.dwExtraInfo = GetMessageExtraInfo();
424  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
425  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
426  SendInput(1, &Input, sizeof(Input));
427 
428  return TRUE;
429 }
430 
431 /***********************************************************************
432  *
433  * OSK_DlgProc
434  */
436 {
437  switch (msg)
438  {
439  case WM_INITDIALOG:
440  OSK_DlgInitDialog(hDlg);
441  return TRUE;
442 
443  case WM_TIMER:
444  OSK_DlgTimer();
445  return TRUE;
446 
447  case WM_CTLCOLORSTATIC:
448  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_NUM))
449  {
450  if (GetKeyState(VK_NUMLOCK) & 0x0001)
451  return (INT_PTR)Globals.hBrushGreenLed;
452  else
454  }
455  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_CAPS))
456  {
457  if (GetKeyState(VK_CAPITAL) & 0x0001)
458  return (INT_PTR)Globals.hBrushGreenLed;
459  else
461  }
462  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_SCROLL))
463  {
464  if (GetKeyState(VK_SCROLL) & 0x0001)
465  return (INT_PTR)Globals.hBrushGreenLed;
466  else
468  }
469  break;
470 
471  case WM_COMMAND:
472  switch (LOWORD(wParam))
473  {
474  case IDCANCEL:
475  {
476  EndDialog(hDlg, FALSE);
477  break;
478  }
479 
480  case IDM_EXIT:
481  {
482  EndDialog(hDlg, FALSE);
483  break;
484  }
485 
486  case IDM_ENHANCED_KB:
487  {
488  if (!Globals.bIsEnhancedKeyboard)
489  {
490  /*
491  The user attempted to switch to enhanced keyboard dialog type.
492  Set the member value as TRUE, destroy the dialog and save the data configuration into the registry.
493  */
494  Globals.bIsEnhancedKeyboard = TRUE;
495  EndDialog(hDlg, FALSE);
497 
498  /* Change the condition of enhanced keyboard item menu to checked */
501 
502  /* Finally, display the dialog modal box with the enhanced keyboard dialog */
506  OSK_DlgProc);
507  }
508 
509  break;
510  }
511 
512  case IDM_STANDARD_KB:
513  {
514  if (Globals.bIsEnhancedKeyboard)
515  {
516  /*
517  The user attempted to switch to standard keyboard dialog type.
518  Set the member value as FALSE, destroy the dialog and save the data configuration into the registry.
519  */
520  Globals.bIsEnhancedKeyboard = FALSE;
521  EndDialog(hDlg, FALSE);
523 
524  /* Change the condition of standard keyboard item menu to checked */
527 
528  /* Finally, display the dialog modal box with the standard keyboard dialog */
532  OSK_DlgProc);
533  }
534 
535  break;
536  }
537 
538  case IDM_CLICK_SOUND:
539  {
540  /*
541  This case is triggered when the user attempts to click on the menu item. Before doing anything,
542  we must check the condition state of such menu item so that we can tick/untick the menu item accordingly.
543  */
544  if (!Globals.bSoundClick)
545  {
546  Globals.bSoundClick = TRUE;
548  }
549  else
550  {
551  Globals.bSoundClick = FALSE;
553  }
554 
555  break;
556  }
557 
558  case IDM_ABOUT:
559  {
560  OSK_About();
561  break;
562  }
563 
564  default:
566  break;
567  }
568  break;
569 
570  case WM_CLOSE:
571  OSK_DlgClose();
572  break;
573  }
574 
575  return 0;
576 }
577 
578 /***********************************************************************
579  *
580  * WinMain
581  */
583  HINSTANCE prev,
584  LPWSTR cmdline,
585  int show)
586 {
587  HANDLE hMutex;
588  DWORD dwError;
589  INT LayoutResource;
590  INITCOMMONCONTROLSEX iccex;
591 
595 
596  /*
597  Obtain a mutex for the program. This will ensure that
598  the program is launched only once.
599  */
600  hMutex = CreateMutexW(NULL, FALSE, L"OSKRunning");
601 
602  if (hMutex)
603  {
604  /* Check if there's already a mutex for the program */
605  dwError = GetLastError();
606 
607  if (dwError == ERROR_ALREADY_EXISTS)
608  {
609  /*
610  A mutex with the object name has been created previously.
611  Therefore, another instance is already running.
612  */
613  DPRINT("wWinMain(): Failed to create a mutex! The program instance is already running.\n");
615  return 0;
616  }
617  }
618 
619  /* Load the common controls */
620  iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
622  InitCommonControlsEx(&iccex);
623 
624  ZeroMemory(&Globals, sizeof(Globals));
626 
627  /* Load the settings from the registry hive */
629 
630  /* If the member of the struct (bShowWarning) is set then display the dialog box */
631  if (Globals.bShowWarning)
632  {
634  }
635 
636  /* Before initializing the dialog execution, check if the chosen keyboard type is standard or enhanced */
637  if (Globals.bIsEnhancedKeyboard)
638  {
639  LayoutResource = MAIN_DIALOG_ENHANCED_KB;
640  }
641  else
642  {
643  LayoutResource = MAIN_DIALOG_STANDARD_KB;
644  }
645 
646  /* Create the modal box based on the configuration registry */
648  MAKEINTRESOURCEW(LayoutResource),
650  OSK_DlgProc);
651 
652  /* Delete the mutex */
653  if (hMutex)
654  {
656  }
657 
658  return 0;
659 }
660 
661 /* EOF */
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define SCAN_CODE_30
Definition: osk_res.h:91
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
INT_PTR APIENTRY OSK_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:435
int OSK_DlgClose(void)
Definition: main.c:251
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define SCAN_CODE_60
Definition: osk_res.h:119
#define IDOK
Definition: winuser.h:824
#define CloseHandle
Definition: compat.h:398
NOTEPAD_GLOBALS Globals
Definition: main.c:29
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
ULONG ScanCode
Definition: api.c:39
#define MF_BYCOMMAND
Definition: winuser.h:202
#define STRING_OSK
Definition: osk_res.h:53
#define IDM_ABOUT
Definition: resource.h:29
#define SCAN_CODE_128
Definition: osk_res.h:168
#define KEYEVENTF_KEYUP
Definition: winuser.h:1092
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDI_PG_UP
Definition: osk_res.h:28
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1748
#define MAIN_DIALOG_STANDARD_KB
Definition: osk_res.h:10
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define CALLBACK
Definition: compat.h:27
#define IDI_OSK
Definition: osk_res.h:19
WCHAR szTitle[MAX_LOADSTRING]
Definition: main.c:38
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
Definition: arc.h:84
LONG top
Definition: windef.h:292
#define IDI_RIGHT
Definition: osk_res.h:32
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SCAN_CODE_64
Definition: osk_res.h:122
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define HWND_TOP
Definition: winuser.h:1193
#define SM_CYSMICON
Definition: winuser.h:1003
#define IDC_SHOWWARNINGCHECK
Definition: resource.h:25
#define SCAN_CODE_62
Definition: osk_res.h:121
struct @1567 Msg[]
#define SCAN_CODE_79
Definition: osk_res.h:125
#define IDI_TOP
Definition: osk_res.h:31
UINT_PTR WPARAM
Definition: windef.h:207
#define IDI_TAB
Definition: osk_res.h:21
TCHAR * cmdline
Definition: stretchblt.cpp:32
LONG left
Definition: windef.h:291
int32_t INT_PTR
Definition: typedefs.h:62
LONG right
Definition: windef.h:293
#define IDI_SHIFT
Definition: osk_res.h:24
#define BM_SETIMAGE
Definition: winuser.h:1883
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
int32_t INT
Definition: typedefs.h:56
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
#define ICON_SMALL
Definition: tnclass.cpp:48
struct _test_info info[]
Definition: SetCursorPos.c:19
HINSTANCE hInstance
Definition: main.h:55
int OSK_DlgInitDialog(HWND hDlg)
Definition: main.c:135
#define SCAN_CODE_80
Definition: osk_res.h:126
#define IDC_LED_CAPS
Definition: osk_res.h:15
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
#define INPUT_KEYBOARD
Definition: winable.h:10
#define SCAN_CODE_16
Definition: osk_res.h:77
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDI_LEFT
Definition: osk_res.h:30
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
long LONG
Definition: pedump.c:60
int OSK_SetImage(int IdDlgItem, int IdResource)
Definition: main.c:37
#define countof(x)
Definition: main.h:37
#define IDI_BACK
Definition: osk_res.h:20
#define SCAN_CODE_57
Definition: osk_res.h:117
#define STRING_AUTHORS
Definition: osk_res.h:54
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define IDI_MENU
Definition: osk_res.h:26
#define CW_USEDEFAULT
Definition: winuser.h:225
#define IDI_HOME
Definition: osk_res.h:27
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SCAN_CODE_86
Definition: osk_res.h:131
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
LPARAM WINAPI GetMessageExtraInfo(void)
Definition: message.c:1339
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
#define SCAN_CODE_58
Definition: osk_res.h:118
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define BM_GETCHECK
Definition: winuser.h:1879
HANDLE hMutex
Definition: mutex.c:11
BOOL LoadDataFromRegistry()
Definition: settings.c:15
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4268
#define IDI_CAPS_LOCK
Definition: osk_res.h:22
SHORT WINAPI GetKeyState(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:895
#define MAX_BUFF
Definition: main.h:38
#define IDM_STANDARD_KB
Definition: osk_res.h:37
#define MF_CHECKED
Definition: winuser.h:132
BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl)
Definition: main.c:303
#define IDM_ENHANCED_KB
Definition: osk_res.h:38
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define WM_TIMER
Definition: winuser.h:1718
#define WM_CLOSE
Definition: winuser.h:1603
#define RGB(r, g, b)
Definition: wingdi.h:2918
#define WINAPI
Definition: msvc.h:8
int OSK_DlgTimer(void)
Definition: main.c:278
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned short WORD
Definition: ntddk_ex.h:93
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SND_ASYNC
Definition: mmsystem.h:154
HINSTANCE hInstance
Definition: main.c:36
#define IDC_LED_SCROLL
Definition: osk_res.h:16
#define SND_RESOURCE
Definition: mmsystem.h:163
#define SM_CXSMICON
Definition: winuser.h:1002
BOOL SaveDataToRegistry()
Definition: settings.c:138
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDI_REACTOS
Definition: osk_res.h:25
static const WCHAR L[]
Definition: oid.c:1250
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define SCAN_CODE_89
Definition: osk_res.h:132
#define WM_COMMAND
Definition: winuser.h:1716
INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:67
#define MF_UNCHECKED
Definition: winuser.h:204
#define SCAN_CODE_15
Definition: osk_res.h:76
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define IDI_RETURN
Definition: osk_res.h:23
#define SWP_NOSIZE
Definition: winuser.h:1230
#define GWL_STYLE
Definition: winuser.h:846
#define IDI_SOUNDCLICK
Definition: osk_res.h:12
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1089
#define GetModuleHandle
Definition: winbase.h:3641
#define SCAN_CODE_127
Definition: osk_res.h:167
VOID OSK_About(VOID)
Definition: main.c:108
#define VK_SCROLL
Definition: winuser.h:2234
#define VK_NUMLOCK
Definition: winuser.h:2233
#define MAIN_DIALOG_ENHANCED_KB
Definition: osk_res.h:9
HICON hIcon
Definition: msconfig.c:44
#define SCAN_CODE_84
Definition: osk_res.h:129
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CAPITAL
Definition: winuser.h:2160
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:522
#define IDI_BOTTOM
Definition: osk_res.h:33
#define SCAN_CODE_43
Definition: osk_res.h:104
unsigned int UINT
Definition: ndis.h:50
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
#define IDM_EXIT
Definition: resource.h:27
#define KEYEVENTF_EXTENDEDKEY
Definition: winuser.h:1091
#define BST_CHECKED
Definition: winuser.h:197
#define msg(x)
Definition: auth_time.c:54
#define IDD_WARNINGDIALOG_OSK
Definition: osk_res.h:51
HICON hIconSm
Definition: msconfig.c:44
BOOL WINAPI SetForegroundWindow(_In_ HWND)
LONG bottom
Definition: windef.h:294
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
Definition: main.c:420
BOOL OSK_ReleaseKey(WORD ScanCode)
Definition: main.c:396
#define ICC_STANDARD_CLASSES
Definition: commctrl.h:73
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define SCAN_CODE_85
Definition: osk_res.h:130
#define PM_REMOVE
Definition: winuser.h:1182
#define SCAN_CODE_44
Definition: osk_res.h:105
#define IDC_LED_NUM
Definition: osk_res.h:14
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define SCAN_CODE_83
Definition: osk_res.h:128
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define memset(x, y, z)
Definition: compat.h:39
HMENU WINAPI GetMenu(_In_ HWND)
HWND hMainWnd
Definition: main.h:56
#define WM_INITDIALOG
Definition: winuser.h:1715
#define IDI_PG_DOWN
Definition: osk_res.h:29
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
UINT WINAPI SendInput(UINT, LPINPUT, int)
Definition: ntwrapper.h:344
#define APIENTRY
Definition: api.h:79
#define IDM_CLICK_SOUND
Definition: osk_res.h:45
#define ICON_BIG
Definition: tnclass.cpp:51
#define SCAN_CODE_129
Definition: osk_res.h:169
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:531