ReactOS  0.4.14-dev-57-g333b8f1
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 "precomp.h"
12 
13 /* GLOBALS ********************************************************************/
14 
16 
17 /* FUNCTIONS ******************************************************************/
18 
19 /***********************************************************************
20  *
21  * OSK_SetImage
22  *
23  * Set an image on a button
24  */
25 int OSK_SetImage(int IdDlgItem, int IdResource)
26 {
27  HICON hIcon;
28  HWND hWndItem;
29 
31  IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
32  if (hIcon == NULL)
33  return FALSE;
34 
35  hWndItem = GetDlgItem(Globals.hMainWnd, IdDlgItem);
36  if (hWndItem == NULL)
37  {
39  return FALSE;
40  }
41 
43 
44  /* The system automatically deletes these resources when the process that created them terminates (MSDN) */
45 
46  return TRUE;
47 }
48 
49 /***********************************************************************
50  *
51  * OSK_WarningProc
52  *
53  * Function handler for the warning dialog box on startup
54  */
56 {
58 
59  switch (Msg)
60  {
61  case WM_INITDIALOG:
62  {
63  return TRUE;
64  }
65 
66  case WM_COMMAND:
67  {
68  switch (LOWORD(wParam))
69  {
71  {
72  Globals.bShowWarning = !IsDlgButtonChecked(hDlg, IDC_SHOWWARNINGCHECK);
73  return TRUE;
74  }
75 
76  case IDOK:
77  case IDCANCEL:
78  {
79  EndDialog(hDlg, LOWORD(wParam));
80  return TRUE;
81  }
82  }
83  break;
84  }
85  }
86 
87  return FALSE;
88 }
89 
90 /***********************************************************************
91  *
92  * OSK_About
93  *
94  * Initializes the "About" dialog box
95  */
97 {
99  WCHAR szAuthors[MAX_BUFF];
100  HICON OSKIcon;
101 
102  /* Load the icon */
104 
105  /* Load the strings into the "About" dialog */
107  LoadStringW(Globals.hInstance, STRING_AUTHORS, szAuthors, countof(szAuthors));
108 
109  /* Finally, execute the "About" dialog by using the Shell routine */
110  ShellAboutW(Globals.hMainWnd, szTitle, szAuthors, OSKIcon);
111 
112  /* Once done, destroy the icon */
113  DestroyIcon(OSKIcon);
114 }
115 
116 
117 /***********************************************************************
118  *
119  * OSK_DlgInitDialog
120  *
121  * Handling of WM_INITDIALOG
122  */
124 {
126  HMONITOR monitor;
128  POINT Pt;
129  RECT rcWindow, rcDlgIntersect;
130 
131  /* Save handle */
132  Globals.hMainWnd = hDlg;
133 
134  /* Check the checked menu item before displaying the modal box */
135  if (Globals.bIsEnhancedKeyboard)
136  {
137  /* Enhanced keyboard dialog chosen, set the respective menu item as checked */
140  }
141  else
142  {
143  /* Standard keyboard dialog chosen, set the respective menu item as checked */
146  }
147 
148  /* Check if the "Click Sound" option was chosen before (and if so, then tick the menu item) */
149  if (Globals.bSoundClick)
150  {
152  }
153 
154  /* Set the application's icon */
157  if (hIcon || hIconSm)
158  {
159  /* Set the window icons (they are deleted when the process terminates) */
162  }
163 
164  /* Get screen info */
165  memset(&Pt, 0, sizeof(Pt));
166  monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
167  info.cbSize = sizeof(info);
168  GetMonitorInfoW(monitor, &info);
169  GetWindowRect(hDlg, &rcWindow);
170 
171  /*
172  If the coordination values are default then re-initialize using the specific formulas
173  to move the dialog at the bottom of the screen.
174  */
175  if (Globals.PosX == CW_USEDEFAULT && Globals.PosY == CW_USEDEFAULT)
176  {
177  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
178  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
179  }
180 
181  /*
182  Calculate the intersection of two rectangle sources (dialog and work desktop area).
183  If such sources do not intersect, then the dialog is deemed as "off screen".
184  */
185  if (IntersectRect(&rcDlgIntersect, &rcWindow, &info.rcWork) == 0)
186  {
187  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
188  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
189  }
190  else
191  {
192  /*
193  There's still some intersection but we're not for sure if it is sufficient (the dialog could also be partially hidden).
194  Therefore, check the remaining intersection if it's enough.
195  */
196  if (rcWindow.top < info.rcWork.top || rcWindow.left < info.rcWork.left || rcWindow.right > info.rcWork.right || rcWindow.bottom > info.rcWork.bottom)
197  {
198  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
199  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
200  }
201  }
202 
203  /*
204  Place the window (with respective placement coordinates) as topmost, above
205  every window which are not on top or are at the bottom of the Z order.
206  */
207  if (Globals.bAlwaysOnTop)
208  {
210  SetWindowPos(hDlg, HWND_TOPMOST, Globals.PosX, Globals.PosY, 0, 0, SWP_NOSIZE);
211  }
212  else
213  {
215  SetWindowPos(hDlg, HWND_NOTOPMOST, Globals.PosX, Globals.PosY, 0, 0, SWP_NOSIZE);
216  }
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_RestoreDlgPlacement
248  *
249  * Restores the dialog placement
250  */
252 {
254  SetWindowPos(hDlg, (Globals.bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST), Globals.PosX, Globals.PosY, 0, 0, SWP_NOSIZE);
255 }
256 
257 /***********************************************************************
258  *
259  * OSK_DlgClose
260  *
261  * Handling of WM_CLOSE
262  */
263 int OSK_DlgClose(void)
264 {
266 
267  /* Release Ctrl, Shift, Alt keys */
268  OSK_ReleaseKey(SCAN_CODE_44); // Left shift
269  OSK_ReleaseKey(SCAN_CODE_57); // Right shift
270  OSK_ReleaseKey(SCAN_CODE_58); // Left ctrl
271  OSK_ReleaseKey(SCAN_CODE_60); // Left alt
272  OSK_ReleaseKey(SCAN_CODE_62); // Right alt
273  OSK_ReleaseKey(SCAN_CODE_64); // Right ctrl
274 
275  /* delete GDI objects */
276  if (Globals.hBrushGreenLed) DeleteObject(Globals.hBrushGreenLed);
277 
278  /* Save the settings to the registry hive */
280 
281  return TRUE;
282 }
283 
284 /***********************************************************************
285  *
286  * OSK_DlgTimer
287  *
288  * Handling of WM_TIMER
289  */
290 int OSK_DlgTimer(void)
291 {
292  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
293  HWND hWndActiveWindow;
294 
295  hWndActiveWindow = GetForegroundWindow();
296  if (hWndActiveWindow != NULL && hWndActiveWindow != Globals.hMainWnd)
297  {
298  Globals.hActiveWnd = hWndActiveWindow;
299  }
300 
301  /* Always redraw leds because it can be changed by the real keyboard) */
305 
306  return TRUE;
307 }
308 
309 /***********************************************************************
310  *
311  * OSK_DlgCommand
312  *
313  * All handling of dialog command
314  */
315 BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl)
316 {
317  WORD ScanCode;
318  INPUT Input;
319  BOOL bExtendedKey;
320  BOOL bKeyDown;
321  BOOL bKeyUp;
322  LONG WindowStyle;
323 
324  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
325  if (Globals.hActiveWnd)
326  {
327  MSG msg;
328 
329  SetForegroundWindow(Globals.hActiveWnd);
330  while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
331  {
334  }
335  }
336 
337  /* KeyDown and/or KeyUp ? */
338  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
339  if ((WindowStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX)
340  {
341  /* 2-states key like Shift, Alt, Ctrl, ... */
342  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
343  {
344  bKeyDown = TRUE;
345  bKeyUp = FALSE;
346  }
347  else
348  {
349  bKeyDown = FALSE;
350  bKeyUp = TRUE;
351  }
352  }
353  else
354  {
355  /* Other key */
356  bKeyDown = TRUE;
357  bKeyUp = TRUE;
358  }
359 
360  /* Extended key ? */
361  ScanCode = wCommand;
362  if (ScanCode & 0x0200)
363  bExtendedKey = TRUE;
364  else
365  bExtendedKey = FALSE;
366  ScanCode &= 0xFF;
367 
368  /* Press and release the key */
369  if (bKeyDown)
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;
377  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
378  SendInput(1, &Input, sizeof(Input));
379  }
380 
381  if (bKeyUp)
382  {
383  Input.type = INPUT_KEYBOARD;
384  Input.ki.wVk = 0;
385  Input.ki.wScan = ScanCode;
386  Input.ki.time = GetTickCount();
387  Input.ki.dwExtraInfo = GetMessageExtraInfo();
388  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
389  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
390  SendInput(1, &Input, sizeof(Input));
391  }
392 
393  /* Play the sound during clicking event (only if "Use Click Sound" menu option is ticked) */
394  if (Globals.bSoundClick)
395  {
397  }
398 
399  return TRUE;
400 }
401 
402 /***********************************************************************
403  *
404  * OSK_ReleaseKey
405  *
406  * Release the key of ID wCommand
407  */
409 {
410  INPUT Input;
411  BOOL bExtendedKey;
412  LONG WindowStyle;
413  HWND hWndControl;
414 
415  /* Is it a 2-states key ? */
416  hWndControl = GetDlgItem(Globals.hMainWnd, ScanCode);
417  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
418  if ((WindowStyle & BS_AUTOCHECKBOX) != BS_AUTOCHECKBOX) return FALSE;
419 
420  /* Is the key down ? */
421  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) != BST_CHECKED) return TRUE;
422 
423  /* Extended key ? */
424  if (ScanCode & 0x0200)
425  bExtendedKey = TRUE;
426  else
427  bExtendedKey = FALSE;
428  ScanCode &= 0xFF;
429 
430  /* Release the key */
431  Input.type = INPUT_KEYBOARD;
432  Input.ki.wVk = 0;
433  Input.ki.wScan = ScanCode;
434  Input.ki.time = GetTickCount();
435  Input.ki.dwExtraInfo = GetMessageExtraInfo();
436  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
437  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
438  SendInput(1, &Input, sizeof(Input));
439 
440  return TRUE;
441 }
442 
443 /***********************************************************************
444  *
445  * OSK_ThemeHandler
446  *
447  * Function helper which handles theme drawing of controls
448  */
450 {
451  HTHEME hTheme;
452  HWND hDlgButtonCtrl;
453  LRESULT Ret;
454  INT iState = PBS_NORMAL;
455 
456  /* Retrieve the theme handle for the button controls */
457  hDlgButtonCtrl = pNmDraw->hdr.hwndFrom;
458  hTheme = GetWindowTheme(hDlgButtonCtrl);
459 
460  /*
461  Begin the painting procedures if we retrieved
462  the theme for control buttons of the dialog.
463  */
464  if (hTheme)
465  {
466  /* Obtain CDDS drawing stages */
467  switch (pNmDraw->dwDrawStage)
468  {
469  case CDDS_PREPAINT:
470  {
471  /*
472  The button could be either in normal state or pushed.
473  Retrieve its state and save to a variable.
474  */
475  if (pNmDraw->uItemState & CDIS_DEFAULT)
476  {
477  iState = PBS_DEFAULTED;
478  }
479  else if (pNmDraw->uItemState & CDIS_SELECTED)
480  {
481  iState = PBS_PRESSED;
482  }
483  else if (pNmDraw->uItemState & CDIS_HOT)
484  {
485  iState = PBS_HOT;
486  }
487 
489  {
490  /* Draw the application if the theme is transparent */
491  DrawThemeParentBackground(hDlgButtonCtrl, pNmDraw->hdc, &pNmDraw->rc);
492  }
493 
494  /* Draw it */
495  DrawThemeBackground(hTheme, pNmDraw->hdc, BP_PUSHBUTTON, iState, &pNmDraw->rc, NULL);
496 
497  Ret = CDRF_SKIPDEFAULT;
498  break;
499  }
500 
501  case CDDS_PREERASE:
502  {
503  Ret = CDRF_DODEFAULT;
504  break;
505  }
506 
507  default:
508  Ret = CDRF_SKIPDEFAULT;
509  break;
510  }
511  }
512  else
513  {
514  /* hTheme is NULL so bail right away */
515  Ret = CDRF_DODEFAULT;
516  }
517 
518  return Ret;
519 }
520 
521 /***********************************************************************
522  *
523  * OSK_DlgProc
524  */
526 {
527  switch (msg)
528  {
529  case WM_INITDIALOG:
530  OSK_DlgInitDialog(hDlg);
531  return TRUE;
532 
533  case WM_TIMER:
534  OSK_DlgTimer();
535  return TRUE;
536 
537  case WM_NOTIFY:
538  return OSK_ThemeHandler(hDlg, (LPNMCUSTOMDRAW)lParam);
539 
540  case WM_CTLCOLORSTATIC:
541  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_NUM))
542  {
543  if (GetKeyState(VK_NUMLOCK) & 0x0001)
544  return (INT_PTR)Globals.hBrushGreenLed;
545  else
547  }
548  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_CAPS))
549  {
550  if (GetKeyState(VK_CAPITAL) & 0x0001)
551  return (INT_PTR)Globals.hBrushGreenLed;
552  else
554  }
555  if ((HWND)lParam == GetDlgItem(hDlg, IDC_LED_SCROLL))
556  {
557  if (GetKeyState(VK_SCROLL) & 0x0001)
558  return (INT_PTR)Globals.hBrushGreenLed;
559  else
561  }
562  break;
563 
564  case WM_COMMAND:
565  switch (LOWORD(wParam))
566  {
567  case IDCANCEL:
568  {
569  EndDialog(hDlg, FALSE);
570  break;
571  }
572 
573  case IDM_EXIT:
574  {
575  EndDialog(hDlg, FALSE);
576  break;
577  }
578 
579  case IDM_ENHANCED_KB:
580  {
581  if (!Globals.bIsEnhancedKeyboard)
582  {
583  /*
584  The user attempted to switch to enhanced keyboard dialog type.
585  Set the member value as TRUE, destroy the dialog and save the data configuration into the registry.
586  */
587  Globals.bIsEnhancedKeyboard = TRUE;
588  EndDialog(hDlg, FALSE);
590 
591  /* Change the condition of enhanced keyboard item menu to checked */
594 
595  /*
596  Before creating the dialog box restore the coordinates. The user can
597  move the dialog around before choosing a different dialog layout therefore
598  we must create the dialog with the new coordinates.
599  */
601 
602  /* Finally, display the dialog modal box with the enhanced keyboard dialog */
606  OSK_DlgProc);
607  }
608 
609  break;
610  }
611 
612  case IDM_STANDARD_KB:
613  {
614  if (Globals.bIsEnhancedKeyboard)
615  {
616  /*
617  The user attempted to switch to standard keyboard dialog type.
618  Set the member value as FALSE, destroy the dialog and save the data configuration into the registry.
619  */
620  Globals.bIsEnhancedKeyboard = FALSE;
621  EndDialog(hDlg, FALSE);
623 
624  /* Change the condition of standard keyboard item menu to checked */
627 
628  /*
629  Before creating the dialog box restore the coordinates. The user can
630  move the dialog around before choosing a different dialog layout therefore
631  we must create the dialog with the new coordinates.
632  */
634 
635  /* Finally, display the dialog modal box with the standard keyboard dialog */
639  OSK_DlgProc);
640  }
641 
642  break;
643  }
644 
645  case IDM_CLICK_SOUND:
646  {
647  /*
648  This case is triggered when the user attempts to click on the menu item. Before doing anything,
649  we must check the condition state of such menu item so that we can tick/untick the menu item accordingly.
650  */
651  if (!Globals.bSoundClick)
652  {
653  Globals.bSoundClick = TRUE;
655  }
656  else
657  {
658  Globals.bSoundClick = FALSE;
660  }
661 
662  break;
663  }
664 
665  case IDM_ON_TOP:
666  {
667  /*
668  Check the condition state before disabling/enabling the menu
669  item and change the topmost order.
670  */
671  if (!Globals.bAlwaysOnTop)
672  {
673  Globals.bAlwaysOnTop = TRUE;
675  SetWindowPos(hDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
676  }
677  else
678  {
679  Globals.bAlwaysOnTop = FALSE;
681  SetWindowPos(hDlg, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
682  }
683 
684  break;
685  }
686 
687  case IDM_ABOUT:
688  {
689  OSK_About();
690  break;
691  }
692 
693  default:
695  break;
696  }
697  break;
698 
699  case WM_THEMECHANGED:
700  /* Redraw the dialog (and its control buttons) using the new theme */
701  InvalidateRect(hDlg, NULL, FALSE);
702  break;
703 
704  case WM_CLOSE:
705  OSK_DlgClose();
706  break;
707  }
708 
709  return 0;
710 }
711 
712 /***********************************************************************
713  *
714  * WinMain
715  */
717  HINSTANCE prev,
718  LPWSTR cmdline,
719  int show)
720 {
721  HANDLE hMutex;
722  DWORD dwError;
723  INT LayoutResource;
724  INITCOMMONCONTROLSEX iccex;
725 
729 
730  /*
731  Obtain a mutex for the program. This will ensure that
732  the program is launched only once.
733  */
734  hMutex = CreateMutexW(NULL, FALSE, L"OSKRunning");
735 
736  if (hMutex)
737  {
738  /* Check if there's already a mutex for the program */
739  dwError = GetLastError();
740 
741  if (dwError == ERROR_ALREADY_EXISTS)
742  {
743  /*
744  A mutex with the object name has been created previously.
745  Therefore, another instance is already running.
746  */
747  DPRINT("wWinMain(): Failed to create a mutex! The program instance is already running.\n");
749  return 0;
750  }
751  }
752 
753  /* Load the common controls */
754  iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
756  InitCommonControlsEx(&iccex);
757 
758  ZeroMemory(&Globals, sizeof(Globals));
760 
761  /* Load the settings from the registry hive */
763 
764  /* If the member of the struct (bShowWarning) is set then display the dialog box */
765  if (Globals.bShowWarning)
766  {
768  }
769 
770  /* Before initializing the dialog execution, check if the chosen keyboard type is standard or enhanced */
771  if (Globals.bIsEnhancedKeyboard)
772  {
773  LayoutResource = MAIN_DIALOG_ENHANCED_KB;
774  }
775  else
776  {
777  LayoutResource = MAIN_DIALOG_STANDARD_KB;
778  }
779 
780  /* Create the modal box based on the configuration registry */
782  MAKEINTRESOURCEW(LayoutResource),
784  OSK_DlgProc);
785 
786  /* Delete the mutex */
787  if (hMutex)
788  {
790  }
791 
792  return 0;
793 }
794 
795 /* EOF */
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define SCAN_CODE_30
Definition: osk_res.h:90
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
INT_PTR APIENTRY OSK_DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:525
int OSK_DlgClose(void)
Definition: main.c:263
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:118
#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:52
#define IDM_ABOUT
Definition: resource.h:29
#define SCAN_CODE_128
Definition: osk_res.h:167
#define KEYEVENTF_KEYUP
Definition: winuser.h:1092
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDI_PG_UP
Definition: osk_res.h:27
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1754
#define MAIN_DIALOG_STANDARD_KB
Definition: osk_res.h:9
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define CALLBACK
Definition: compat.h:27
#define IDI_OSK
Definition: osk_res.h:18
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:31
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define SCAN_CODE_64
Definition: osk_res.h:121
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define HWND_TOPMOST
Definition: winuser.h:1194
#define SM_CYSMICON
Definition: winuser.h:1003
#define IDC_SHOWWARNINGCHECK
Definition: resource.h:25
#define SCAN_CODE_62
Definition: osk_res.h:120
#define SCAN_CODE_79
Definition: osk_res.h:124
#define IDI_TOP
Definition: osk_res.h:30
UINT_PTR WPARAM
Definition: windef.h:207
#define IDI_TAB
Definition: osk_res.h:20
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:23
#define BM_SETIMAGE
Definition: winuser.h:1904
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
#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:123
#define SCAN_CODE_80
Definition: osk_res.h:125
#define IDC_LED_CAPS
Definition: osk_res.h:14
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
struct @1576 Msg[]
#define SCAN_CODE_16
Definition: osk_res.h:76
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDI_LEFT
Definition: osk_res.h:29
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:25
#define IDI_BACK
Definition: osk_res.h:19
#define SCAN_CODE_57
Definition: osk_res.h:116
#define STRING_AUTHORS
Definition: osk_res.h:53
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define IDI_MENU
Definition: osk_res.h:25
#define CW_USEDEFAULT
Definition: winuser.h:225
#define IDI_HOME
Definition: osk_res.h:26
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SCAN_CODE_86
Definition: osk_res.h:130
LRESULT APIENTRY OSK_ThemeHandler(HWND hDlg, NMCUSTOMDRAW *pNmDraw)
Definition: main.c:449
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
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:117
LONG_PTR LPARAM
Definition: windef.h:208
void DPRINT(...)
Definition: polytest.cpp:61
#define BM_GETCHECK
Definition: winuser.h:1900
HANDLE hMutex
Definition: mutex.c:11
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define IDM_ON_TOP
Definition: osk_res.h:43
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4300
#define IDI_CAPS_LOCK
Definition: osk_res.h:21
SHORT WINAPI GetKeyState(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:895
#define IDM_STANDARD_KB
Definition: osk_res.h:36
#define MF_CHECKED
Definition: winuser.h:132
BOOL OSK_DlgCommand(WPARAM wCommand, HWND hWndControl)
Definition: main.c:315
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
#define IDM_ENHANCED_KB
Definition: osk_res.h:37
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
BOOL SaveDataToRegistry(VOID)
Definition: settings.c:155
__wchar_t WCHAR
Definition: xmlstorage.h:180
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define WM_TIMER
Definition: winuser.h:1724
#define CDIS_HOT
Definition: commctrl.h:282
#define WM_CLOSE
Definition: winuser.h:1603
#define RGB(r, g, b)
Definition: wingdi.h:2935
BOOL LoadDataFromRegistry(VOID)
Definition: settings.c:14
#define WINAPI
Definition: msvc.h:8
int OSK_DlgTimer(void)
Definition: main.c:290
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:15
#define SND_RESOURCE
Definition: mmsystem.h:163
#define SM_CXSMICON
Definition: winuser.h:1002
#define countof(x)
Definition: precomp.h:72
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDI_REACTOS
Definition: osk_res.h:24
#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:131
#define WM_COMMAND
Definition: winuser.h:1722
INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:55
HWND hwndFrom
Definition: winuser.h:3131
#define MF_UNCHECKED
Definition: winuser.h:204
#define SCAN_CODE_15
Definition: osk_res.h:75
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define IDI_RETURN
Definition: osk_res.h:22
#define SWP_NOSIZE
Definition: winuser.h:1230
#define GWL_STYLE
Definition: winuser.h:846
#define IDI_SOUNDCLICK
Definition: osk_res.h:11
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1089
#define GetModuleHandle
Definition: winbase.h:3644
#define SCAN_CODE_127
Definition: osk_res.h:166
VOID OSK_About(VOID)
Definition: main.c:96
#define VK_SCROLL
Definition: winuser.h:2255
#define VK_NUMLOCK
Definition: winuser.h:2254
#define MAIN_DIALOG_ENHANCED_KB
Definition: osk_res.h:8
HICON hIcon
Definition: msconfig.c:44
#define SCAN_CODE_84
Definition: osk_res.h:128
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CAPITAL
Definition: winuser.h:2181
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
#define IDI_BOTTOM
Definition: osk_res.h:32
#define SCAN_CODE_43
Definition: osk_res.h:103
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:50
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
#define SWP_NOMOVE
Definition: winuser.h:1229
BOOL OSK_ReleaseKey(WORD ScanCode)
Definition: main.c:408
#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 HWND_NOTOPMOST
Definition: winuser.h:1192
#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:129
#define PM_REMOVE
Definition: winuser.h:1182
#define SCAN_CODE_44
Definition: osk_res.h:104
#define IDC_LED_NUM
Definition: osk_res.h:13
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define SCAN_CODE_83
Definition: osk_res.h:127
LONG_PTR LRESULT
Definition: windef.h:209
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define memset(x, y, z)
Definition: compat.h:39
VOID OSK_RestoreDlgPlacement(HWND hDlg)
Definition: main.c:251
HMENU WINAPI GetMenu(_In_ HWND)
HWND hMainWnd
Definition: main.h:56
#define WM_INITDIALOG
Definition: winuser.h:1721
#define IDI_PG_DOWN
Definition: osk_res.h:28
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:44
#define ICON_BIG
Definition: tnclass.cpp:51
#define MAX_BUFF
Definition: precomp.h:73
#define CDDS_PREERASE
Definition: commctrl.h:267
#define SCAN_CODE_129
Definition: osk_res.h:168
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:531