ReactOS  0.4.13-dev-443-g10f00f8
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 
29 
30 /* FUNCTIONS ******************************************************************/
31 
32 /***********************************************************************
33  *
34  * OSK_SetImage
35  *
36  * Set an image on a button
37  */
38 int OSK_SetImage(int IdDlgItem, int IdResource)
39 {
40  HICON hIcon;
41  HWND hWndItem;
42 
44  IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
45  if (hIcon == NULL)
46  return FALSE;
47 
48  hWndItem = GetDlgItem(Globals.hMainWnd, IdDlgItem);
49  if (hWndItem == NULL)
50  {
52  return FALSE;
53  }
54 
56 
57  /* The system automatically deletes these resources when the process that created them terminates (MSDN) */
58 
59  return TRUE;
60 }
61 
62 /***********************************************************************
63  *
64  * OSK_WarningProc
65  *
66  * Function handler for the warning dialog box on startup
67  */
69 {
71 
72  switch (Msg)
73  {
74  case WM_INITDIALOG:
75  {
76  return TRUE;
77  }
78 
79  case WM_COMMAND:
80  {
81  switch (LOWORD(wParam))
82  {
84  {
85  Globals.bShowWarning = !IsDlgButtonChecked(hDlg, IDC_SHOWWARNINGCHECK);
86  return TRUE;
87  }
88 
89  case IDOK:
90  case IDCANCEL:
91  {
92  EndDialog(hDlg, LOWORD(wParam));
93  return TRUE;
94  }
95  }
96  break;
97  }
98  }
99 
100  return FALSE;
101 }
102 
103 /***********************************************************************
104  *
105  * OSK_About
106  *
107  * Initializes the "About" dialog box
108  */
110 {
112  WCHAR szAuthors[MAX_BUFF];
113  HICON OSKIcon;
114 
115  /* Load the icon */
117 
118  /* Load the strings into the "About" dialog */
120  LoadStringW(Globals.hInstance, STRING_AUTHORS, szAuthors, countof(szAuthors));
121 
122  /* Finally, execute the "About" dialog by using the Shell routine */
123  ShellAboutW(Globals.hMainWnd, szTitle, szAuthors, OSKIcon);
124 
125  /* Once done, destroy the icon */
126  DestroyIcon(OSKIcon);
127 }
128 
129 
130 /***********************************************************************
131  *
132  * OSK_DlgInitDialog
133  *
134  * Handling of WM_INITDIALOG
135  */
137 {
139  HMONITOR monitor;
141  POINT Pt;
142  RECT rcWindow, rcDlgIntersect;
143 
144  /* Save handle */
145  Globals.hMainWnd = hDlg;
146 
147  /* Check the checked menu item before displaying the modal box */
148  if (Globals.bIsEnhancedKeyboard)
149  {
150  /* Enhanced keyboard dialog chosen, set the respective menu item as checked */
153  }
154  else
155  {
156  /* Standard keyboard dialog chosen, set the respective menu item as checked */
159  }
160 
161  /* Check if the "Click Sound" option was chosen before (and if so, then tick the menu item) */
162  if (Globals.bSoundClick)
163  {
165  }
166 
167  /* Set the application's icon */
170  if (hIcon || hIconSm)
171  {
172  /* Set the window icons (they are deleted when the process terminates) */
175  }
176 
177  /* Get screen info */
178  memset(&Pt, 0, sizeof(Pt));
179  monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
180  info.cbSize = sizeof(info);
181  GetMonitorInfoW(monitor, &info);
182  GetWindowRect(hDlg, &rcWindow);
183 
184  /*
185  If the coordination values are default then re-initialize using the specific formulas
186  to move the dialog at the bottom of the screen.
187  */
188  if (Globals.PosX == CW_USEDEFAULT && Globals.PosY == CW_USEDEFAULT)
189  {
190  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
191  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
192  }
193 
194  /*
195  Calculate the intersection of two rectangle sources (dialog and work desktop area).
196  If such sources do not intersect, then the dialog is deemed as "off screen".
197  */
198  if (IntersectRect(&rcDlgIntersect, &rcWindow, &info.rcWork) == 0)
199  {
200  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
201  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
202  }
203  else
204  {
205  /*
206  There's still some intersection but we're not for sure if it is sufficient (the dialog could also be partially hidden).
207  Therefore, check the remaining intersection if it's enough.
208  */
209  if (rcWindow.top < info.rcWork.top || rcWindow.left < info.rcWork.left || rcWindow.right > info.rcWork.right || rcWindow.bottom > info.rcWork.bottom)
210  {
211  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
212  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
213  }
214  }
215 
216  /* Move the dialog according to the placement coordination */
217  SetWindowPos(hDlg, HWND_TOP, Globals.PosX, Globals.PosY, 0, 0, SWP_NOSIZE);
218 
219  /* Set icon on visual buttons */
236 
237  /* Create a green brush for leds */
238  Globals.hBrushGreenLed = CreateSolidBrush(RGB(0, 255, 0));
239 
240  /* Set a timer for periodics tasks */
241  Globals.iTimer = SetTimer(hDlg, 0, 200, NULL);
242 
243  return TRUE;
244 }
245 
246 /***********************************************************************
247  *
248  * OSK_DlgClose
249  *
250  * Handling of WM_CLOSE
251  */
252 int OSK_DlgClose(void)
253 {
255 
256  /* Release Ctrl, Shift, Alt keys */
257  OSK_ReleaseKey(SCAN_CODE_44); // Left shift
258  OSK_ReleaseKey(SCAN_CODE_57); // Right shift
259  OSK_ReleaseKey(SCAN_CODE_58); // Left ctrl
260  OSK_ReleaseKey(SCAN_CODE_60); // Left alt
261  OSK_ReleaseKey(SCAN_CODE_62); // Right alt
262  OSK_ReleaseKey(SCAN_CODE_64); // Right ctrl
263 
264  /* delete GDI objects */
265  if (Globals.hBrushGreenLed) DeleteObject(Globals.hBrushGreenLed);
266 
267  /* Save the settings to the registry hive */
269 
270  return TRUE;
271 }
272 
273 /***********************************************************************
274  *
275  * OSK_DlgTimer
276  *
277  * Handling of WM_TIMER
278  */
279 int OSK_DlgTimer(void)
280 {
281  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
282  HWND hWndActiveWindow;
283 
284  hWndActiveWindow = GetForegroundWindow();
285  if (hWndActiveWindow != NULL && hWndActiveWindow != Globals.hMainWnd)
286  {
287  Globals.hActiveWnd = hWndActiveWindow;
288  }
289 
290  /* Always redraw leds because it can be changed by the real keyboard) */
294 
295  return TRUE;
296 }
297 
298 /***********************************************************************
299  *
300  * OSK_DlgCommand
301  *
302  * All handling of dialog command
303  */
304 BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl)
305 {
306  WORD ScanCode;
307  INPUT Input;
308  BOOL bExtendedKey;
309  BOOL bKeyDown;
310  BOOL bKeyUp;
311  LONG WindowStyle;
312 
313  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
314  if (Globals.hActiveWnd)
315  {
316  MSG msg;
317 
318  SetForegroundWindow(Globals.hActiveWnd);
319  while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
320  {
323  }
324  }
325 
326  /* KeyDown and/or KeyUp ? */
327  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
328  if ((WindowStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX)
329  {
330  /* 2-states key like Shift, Alt, Ctrl, ... */
331  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
332  {
333  bKeyDown = TRUE;
334  bKeyUp = FALSE;
335  }
336  else
337  {
338  bKeyDown = FALSE;
339  bKeyUp = TRUE;
340  }
341  }
342  else
343  {
344  /* Other key */
345  bKeyDown = TRUE;
346  bKeyUp = TRUE;
347  }
348 
349  /* Extended key ? */
350  ScanCode = wCommand;
351  if (ScanCode & 0x0200)
352  bExtendedKey = TRUE;
353  else
354  bExtendedKey = FALSE;
355  ScanCode &= 0xFF;
356 
357  /* Press and release the key */
358  if (bKeyDown)
359  {
360  Input.type = INPUT_KEYBOARD;
361  Input.ki.wVk = 0;
362  Input.ki.wScan = ScanCode;
363  Input.ki.time = GetTickCount();
364  Input.ki.dwExtraInfo = GetMessageExtraInfo();
365  Input.ki.dwFlags = KEYEVENTF_SCANCODE;
366  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
367  SendInput(1, &Input, sizeof(Input));
368  }
369 
370  if (bKeyUp)
371  {
372  Input.type = INPUT_KEYBOARD;
373  Input.ki.wVk = 0;
374  Input.ki.wScan = ScanCode;
375  Input.ki.time = GetTickCount();
376  Input.ki.dwExtraInfo = GetMessageExtraInfo();
377  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
378  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
379  SendInput(1, &Input, sizeof(Input));
380  }
381 
382  /* Play the sound during clicking event (only if "Use Click Sound" menu option is ticked) */
383  if (Globals.bSoundClick)
384  {
386  }
387 
388  return TRUE;
389 }
390 
391 /***********************************************************************
392  *
393  * OSK_ReleaseKey
394  *
395  * Release the key of ID wCommand
396  */
398 {
399  INPUT Input;
400  BOOL bExtendedKey;
401  LONG WindowStyle;
402  HWND hWndControl;
403 
404  /* Is it a 2-states key ? */
405  hWndControl = GetDlgItem(Globals.hMainWnd, ScanCode);
406  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
407  if ((WindowStyle & BS_AUTOCHECKBOX) != BS_AUTOCHECKBOX) return FALSE;
408 
409  /* Is the key down ? */
410  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) != BST_CHECKED) return TRUE;
411 
412  /* Extended key ? */
413  if (ScanCode & 0x0200)
414  bExtendedKey = TRUE;
415  else
416  bExtendedKey = FALSE;
417  ScanCode &= 0xFF;
418 
419  /* Release the key */
420  Input.type = INPUT_KEYBOARD;
421  Input.ki.wVk = 0;
422  Input.ki.wScan = ScanCode;
423  Input.ki.time = GetTickCount();
424  Input.ki.dwExtraInfo = GetMessageExtraInfo();
425  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
426  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
427  SendInput(1, &Input, sizeof(Input));
428 
429  return TRUE;
430 }
431 
432 /***********************************************************************
433  *
434  * OSK_ThemeHandler
435  *
436  * Function helper which handles theme drawing of controls
437  */
439 {
440  HTHEME hTheme;
441  HWND hDlgButtonCtrl;
442  LRESULT Ret;
443  INT iState = PBS_NORMAL;
444 
445  /* Retrieve the theme handle for the button controls */
446  hDlgButtonCtrl = pNmDraw->hdr.hwndFrom;
447  hTheme = GetWindowTheme(hDlgButtonCtrl);
448 
449  /*
450  Begin the painting procedures if we retrieved
451  the theme for control buttons of the dialog.
452  */
453  if (hTheme)
454  {
455  /* Obtain CDDS drawing stages */
456  switch (pNmDraw->dwDrawStage)
457  {
458  case CDDS_PREPAINT:
459  {
460  /*
461  The button could be either in normal state or pushed.
462  Retrieve its state and save to a variable.
463  */
464  if (pNmDraw->uItemState & CDIS_DEFAULT)
465  {
466  iState = PBS_DEFAULTED;
467  }
468  else if (pNmDraw->uItemState & CDIS_SELECTED)
469  {
470  iState = PBS_PRESSED;
471  }
472  else if (pNmDraw->uItemState & CDIS_HOT)
473  {
474  iState = PBS_HOT;
475  }
476 
478  {
479  /* Draw the application if the theme is transparent */
480  DrawThemeParentBackground(hDlgButtonCtrl, pNmDraw->hdc, &pNmDraw->rc);
481  }
482 
483  /* Draw it */
484  DrawThemeBackground(hTheme, pNmDraw->hdc, BP_PUSHBUTTON, iState, &pNmDraw->rc, NULL);
485 
486  Ret = CDRF_SKIPDEFAULT;
487  break;
488  }
489 
490  case CDDS_PREERASE:
491  {
492  Ret = CDRF_DODEFAULT;
493  break;
494  }
495 
496  default:
497  Ret = CDRF_SKIPDEFAULT;
498  break;
499  }
500  }
501  else
502  {
503  /* hTheme is NULL so bail right away */
504  Ret = CDRF_DODEFAULT;
505  }
506 
507  return Ret;
508 }
509 
510 /***********************************************************************
511  *
512  * OSK_DlgProc
513  */
515 {
516  switch (msg)
517  {
518  case WM_INITDIALOG:
519  OSK_DlgInitDialog(hDlg);
520  return TRUE;
521 
522  case WM_TIMER:
523  OSK_DlgTimer();
524  return TRUE;
525 
526  case WM_NOTIFY:
527  return OSK_ThemeHandler(hDlg, (LPNMCUSTOMDRAW)lParam);
528 
529  case WM_CTLCOLORSTATIC:
530  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_NUM))
531  {
532  if (GetKeyState(VK_NUMLOCK) & 0x0001)
533  return (INT_PTR)Globals.hBrushGreenLed;
534  else
536  }
537  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_CAPS))
538  {
539  if (GetKeyState(VK_CAPITAL) & 0x0001)
540  return (INT_PTR)Globals.hBrushGreenLed;
541  else
543  }
544  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_SCROLL))
545  {
546  if (GetKeyState(VK_SCROLL) & 0x0001)
547  return (INT_PTR)Globals.hBrushGreenLed;
548  else
550  }
551  break;
552 
553  case WM_COMMAND:
554  switch (LOWORD(wParam))
555  {
556  case IDCANCEL:
557  {
558  EndDialog(hDlg, FALSE);
559  break;
560  }
561 
562  case IDM_EXIT:
563  {
564  EndDialog(hDlg, FALSE);
565  break;
566  }
567 
568  case IDM_ENHANCED_KB:
569  {
570  if (!Globals.bIsEnhancedKeyboard)
571  {
572  /*
573  The user attempted to switch to enhanced keyboard dialog type.
574  Set the member value as TRUE, destroy the dialog and save the data configuration into the registry.
575  */
576  Globals.bIsEnhancedKeyboard = TRUE;
577  EndDialog(hDlg, FALSE);
579 
580  /* Change the condition of enhanced keyboard item menu to checked */
583 
584  /* Finally, display the dialog modal box with the enhanced keyboard dialog */
588  OSK_DlgProc);
589  }
590 
591  break;
592  }
593 
594  case IDM_STANDARD_KB:
595  {
596  if (Globals.bIsEnhancedKeyboard)
597  {
598  /*
599  The user attempted to switch to standard keyboard dialog type.
600  Set the member value as FALSE, destroy the dialog and save the data configuration into the registry.
601  */
602  Globals.bIsEnhancedKeyboard = FALSE;
603  EndDialog(hDlg, FALSE);
605 
606  /* Change the condition of standard keyboard item menu to checked */
609 
610  /* Finally, display the dialog modal box with the standard keyboard dialog */
614  OSK_DlgProc);
615  }
616 
617  break;
618  }
619 
620  case IDM_CLICK_SOUND:
621  {
622  /*
623  This case is triggered when the user attempts to click on the menu item. Before doing anything,
624  we must check the condition state of such menu item so that we can tick/untick the menu item accordingly.
625  */
626  if (!Globals.bSoundClick)
627  {
628  Globals.bSoundClick = TRUE;
630  }
631  else
632  {
633  Globals.bSoundClick = FALSE;
635  }
636 
637  break;
638  }
639 
640  case IDM_ABOUT:
641  {
642  OSK_About();
643  break;
644  }
645 
646  default:
648  break;
649  }
650  break;
651 
652  case WM_THEMECHANGED:
653  /* Redraw the dialog (and its control buttons) using the new theme */
654  InvalidateRect(hDlg, NULL, FALSE);
655  break;
656 
657  case WM_CLOSE:
658  OSK_DlgClose();
659  break;
660  }
661 
662  return 0;
663 }
664 
665 /***********************************************************************
666  *
667  * WinMain
668  */
670  HINSTANCE prev,
671  LPWSTR cmdline,
672  int show)
673 {
674  HANDLE hMutex;
675  DWORD dwError;
676  INT LayoutResource;
677  INITCOMMONCONTROLSEX iccex;
678 
682 
683  /*
684  Obtain a mutex for the program. This will ensure that
685  the program is launched only once.
686  */
687  hMutex = CreateMutexW(NULL, FALSE, L"OSKRunning");
688 
689  if (hMutex)
690  {
691  /* Check if there's already a mutex for the program */
692  dwError = GetLastError();
693 
694  if (dwError == ERROR_ALREADY_EXISTS)
695  {
696  /*
697  A mutex with the object name has been created previously.
698  Therefore, another instance is already running.
699  */
700  DPRINT("wWinMain(): Failed to create a mutex! The program instance is already running.\n");
702  return 0;
703  }
704  }
705 
706  /* Load the common controls */
707  iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
709  InitCommonControlsEx(&iccex);
710 
711  ZeroMemory(&Globals, sizeof(Globals));
713 
714  /* Load the settings from the registry hive */
716 
717  /* If the member of the struct (bShowWarning) is set then display the dialog box */
718  if (Globals.bShowWarning)
719  {
721  }
722 
723  /* Before initializing the dialog execution, check if the chosen keyboard type is standard or enhanced */
724  if (Globals.bIsEnhancedKeyboard)
725  {
726  LayoutResource = MAIN_DIALOG_ENHANCED_KB;
727  }
728  else
729  {
730  LayoutResource = MAIN_DIALOG_STANDARD_KB;
731  }
732 
733  /* Create the modal box based on the configuration registry */
735  MAKEINTRESOURCEW(LayoutResource),
737  OSK_DlgProc);
738 
739  /* Delete the mutex */
740  if (hMutex)
741  {
743  }
744 
745  return 0;
746 }
747 
748 /* 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:514
int OSK_DlgClose(void)
Definition: main.c:252
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
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
#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
#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
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:255
LONG right
Definition: windef.h:293
#define IDI_SHIFT
Definition: osk_res.h:24
#define BM_SETIMAGE
Definition: winuser.h:1883
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
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
struct @1571 Msg[]
#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:136
#define SCAN_CODE_80
Definition: osk_res.h:126
#define IDC_LED_CAPS
Definition: osk_res.h:15
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
Definition: draw.c:1883
#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:38
#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
LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw)
Definition: main.c:438
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 CDIS_SELECTED
Definition: commctrl.h:276
#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:304
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
#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 CDIS_HOT
Definition: commctrl.h:282
#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:279
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
#define CDRF_DODEFAULT
Definition: commctrl.h:253
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
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
BOOL SaveDataToRegistry()
Definition: settings.c:138
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDI_REACTOS
Definition: osk_res.h:25
#define CDDS_PREPAINT
Definition: commctrl.h:265
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:68
HWND hwndFrom
Definition: winuser.h:3110
#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:109
#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:397
#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
LONG_PTR LRESULT
Definition: windef.h:209
#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 CDIS_DEFAULT
Definition: commctrl.h:281
#define WM_NOTIFY
Definition: richedit.h:61
#define APIENTRY
Definition: api.h:79
#define IDM_CLICK_SOUND
Definition: osk_res.h:45
#define ICON_BIG
Definition: tnclass.cpp:51
#define CDDS_PREERASE
Definition: commctrl.h:267
#define SCAN_CODE_129
Definition: osk_res.h:169
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:531