ReactOS  0.4.15-dev-4594-g505ac65
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-2020 George BiČ™oc (george.bisoc@reactos.org)
7  * Baruch Rutman (peterooch at gmail dot com)
8  */
9 
10 /* INCLUDES *******************************************************************/
11 
12 #include "precomp.h"
13 
14 /* GLOBALS ********************************************************************/
15 
17 
19 {
20  {VK_NUMLOCK, IDC_LED_NUM, 0x0145, FALSE},
21  {VK_CAPITAL, IDC_LED_CAPS, 0x013A, FALSE},
22  {VK_SCROLL, IDC_LED_SCROLL, 0x0146, FALSE}
23 };
24 
25 /* FUNCTIONS ******************************************************************/
26 
27 /***********************************************************************
28  *
29  * OSK_SetImage
30  *
31  * Set an image on a button
32  */
33 int OSK_SetImage(int IdDlgItem, int IdResource)
34 {
35  HICON hIcon;
36  HWND hWndItem;
37 
39  IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
40  if (hIcon == NULL)
41  return FALSE;
42 
43  hWndItem = GetDlgItem(Globals.hMainWnd, IdDlgItem);
44  if (hWndItem == NULL)
45  {
47  return FALSE;
48  }
49 
51 
52  /* The system automatically deletes these resources when the process that created them terminates (MSDN) */
53 
54  return TRUE;
55 }
56 
57 /***********************************************************************
58  *
59  * OSK_SetText
60  *
61  * Update the text of a button according to the relevant language resource
62  */
63 void OSK_SetText(int IdDlgItem, int IdResource)
64 {
65  WCHAR szText[MAX_PATH];
66  HWND hWndItem;
67 
68  hWndItem = GetDlgItem(Globals.hMainWnd, IdDlgItem);
69 
70  if (hWndItem == NULL)
71  return;
72 
73  LoadStringW(Globals.hInstance, IdResource, szText, _countof(szText));
74 
75  SetWindowTextW(hWndItem, szText);
76 }
77 /***********************************************************************
78  *
79  * OSK_WarningProc
80  *
81  * Function handler for the warning dialog box on startup
82  */
84 {
86 
87  switch (Msg)
88  {
89  case WM_INITDIALOG:
90  {
91  return TRUE;
92  }
93 
94  case WM_COMMAND:
95  {
96  switch (LOWORD(wParam))
97  {
99  {
100  Globals.bShowWarning = !IsDlgButtonChecked(hDlg, IDC_SHOWWARNINGCHECK);
101  return TRUE;
102  }
103 
104  case IDOK:
105  case IDCANCEL:
106  {
107  EndDialog(hDlg, LOWORD(wParam));
108  return TRUE;
109  }
110  }
111  break;
112  }
113  }
114 
115  return FALSE;
116 }
117 
118 /***********************************************************************
119  *
120  * OSK_WarningDlgThread
121  *
122  * Thread procedure routine for the warning dialog box
123  */
125 {
126  HINSTANCE hInstance = (HINSTANCE)lpParameter;
127 
129  return 0;
130 }
131 
132 /***********************************************************************
133  *
134  * OSK_About
135  *
136  * Initializes the "About" dialog box
137  */
139 {
140  WCHAR szAuthors[MAX_PATH];
141  HICON OSKIcon;
142 
143  /* Load the icon */
145 
146  /* Load the strings into the "About" dialog */
147  LoadStringW(Globals.hInstance, IDS_AUTHORS, szAuthors, _countof(szAuthors));
148 
149  /* Finally, execute the "About" dialog by using the Shell routine */
150  ShellAboutW(Globals.hMainWnd, Globals.szTitle, szAuthors, OSKIcon);
151 
152  /* Once done, destroy the icon */
153  DestroyIcon(OSKIcon);
154 }
155 
156 /***********************************************************************
157  *
158  * OSK_DestroyKeys
159  *
160  * Used in layout change or in shutdown
161  */
163 {
164  int i;
165  /* Hide before destroying child controls */
167 
168  for (i = 0; i < Globals.Keyboard->KeyCount; i++)
169  {
170  DestroyWindow(Globals.hKeys[i]);
171  }
172  for (i = 0; i < _countof(LedKey); i++)
173  {
175  }
176 
177  HeapFree(GetProcessHeap(), 0, Globals.hKeys);
178  Globals.hKeys = NULL;
179  Globals.Keyboard = NULL;
180 }
181 
182 /***********************************************************************
183  *
184  * OSK_SetKeys
185  *
186  * Create/Update button controls with the relevant keyboard values
187  */
189 {
190  WCHAR wKey[2];
191  BYTE bKeyStates[256];
192  LPCWSTR szKey;
193  PKEY Keys;
194  UINT uVirtKey;
195  POINT LedPos;
196  SIZE LedSize;
197  int i, yPad;
198 
199  /* Get key states before doing anything */
200  if (!GetKeyboardState(bKeyStates))
201  {
202  DPRINT("OSK_SetKeys(): GetKeyboardState() call failed.\n");
203  return -1;
204  }
205 
206  switch (reason)
207  {
208  case SETKEYS_LANG:
209  {
210  /* Keyboard language/caps change, just update the button texts */
211  Keys = Globals.Keyboard->Keys;
212  for (i = 0; i < Globals.Keyboard->KeyCount; i++)
213  {
214  if (!Keys[i].translate)
215  continue;
216 
217  uVirtKey = MapVirtualKeyW(Keys[i].scancode & SCANCODE_MASK, MAPVK_VSC_TO_VK);
218 
219  if (ToUnicode(uVirtKey, Keys[i].scancode & SCANCODE_MASK, bKeyStates, wKey, _countof(wKey), 0) >= 1)
220  {
221  szKey = wKey;
222  }
223  else
224  {
225  szKey = Keys[i].name;
226  }
227 
228  /* Only one & the button will try to underline the next character... */
229  if (wcsncmp(szKey, L"&", 1) == 0)
230  szKey = L"&&";
231 
232  SetWindowTextW(Globals.hKeys[i], szKey);
233  }
234  return 0;
235  }
236  case SETKEYS_LAYOUT:
237  {
238  /* Clear up current layout before applying a different one */
239  OSK_DestroyKeys();
240  }
241  /* Fallthrough */
242  case SETKEYS_INIT:
243  {
244  if (Globals.bIsEnhancedKeyboard)
245  {
246  Globals.Keyboard = &EnhancedKeyboard;
247  }
248  else
249  {
250  Globals.Keyboard = &StandardKeyboard;
251  }
252 
253  Globals.hKeys = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(HWND) * Globals.Keyboard->KeyCount);
254 
255  if (!Globals.hKeys)
256  {
257  DPRINT("OSK_SetKeys(): Failed to allocate memory for button handles.\n");
258  return -1;
259  }
260 
261  Keys = Globals.Keyboard->Keys;
262 
263  /* Create key buttons */
264  for (i = 0; i < Globals.Keyboard->KeyCount; i++)
265  {
266  uVirtKey = MapVirtualKeyW(Keys[i].scancode & SCANCODE_MASK, MAPVK_VSC_TO_VK);
267 
268  if (Keys[i].translate && ToUnicode(uVirtKey, Keys[i].scancode & SCANCODE_MASK, bKeyStates, wKey, _countof(wKey), 0) >= 1)
269  {
270  szKey = wKey;
271  }
272  else
273  {
274  szKey = Keys[i].name;
275  }
276 
278  szKey,
280  Keys[i].x,
281  Keys[i].y,
282  Keys[i].cx,
283  Keys[i].cy,
285  (HMENU)Keys[i].scancode,
287  NULL);
288  if (Globals.hFont)
290  }
291 
292  /* Add additional padding for caption and menu */
294  /* Size window according to layout */
296  (Globals.bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST),
297  0,
298  0,
299  Globals.Keyboard->Size.cx,
300  Globals.Keyboard->Size.cy + yPad,
301  SWP_NOMOVE);
302 
303  /* Create LEDs */
304  LedPos = Globals.Keyboard->LedStart;
305  LedSize = Globals.Keyboard->LedSize;
306 
308  LedPos.x, LedPos.y, LedSize.cx, LedSize.cy, Globals.hMainWnd,
310 
311  LedPos.x += Globals.Keyboard->LedGap;
312 
314  LedPos.x, LedPos.y, LedSize.cx, LedSize.cy, Globals.hMainWnd,
316 
317  LedPos.x += Globals.Keyboard->LedGap;
318 
320  LedPos.x, LedPos.y, LedSize.cx, LedSize.cy, Globals.hMainWnd,
322 
323  /* Set system keys text */
332  OSK_SetText(SCAN_CODE_58, IDS_CTRL); /* Left ctrl */
333  OSK_SetText(SCAN_CODE_64, IDS_CTRL); /* Right ctrl */
336 
337  /* Set icon on visual buttons */
354  }
355  }
356 
357  if (reason != SETKEYS_INIT)
358  {
361  }
362 
363  return 0;
364 }
365 
366 /***********************************************************************
367  *
368  * OSK_Create
369  *
370  * Handling of WM_CREATE
371  */
373 {
374  HMONITOR monitor;
376  POINT Pt;
377  RECT rcWindow, rcDlgIntersect;
378  LOGFONTW lf = {0};
379 
380  /* Save handle */
382 
383  /* Init Font */
384  lf.lfHeight = Globals.FontHeight;
385  StringCchCopyW(lf.lfFaceName, _countof(Globals.FontFaceName), Globals.FontFaceName);
387 
388  if (OSK_SetKeys(SETKEYS_INIT) == -1)
389  return -1;
390 
391  /* Check the checked menu item before displaying the window */
392  if (Globals.bIsEnhancedKeyboard)
393  {
394  /* Enhanced keyboard dialog chosen, set the respective menu item as checked */
397  }
398  else
399  {
400  /* Standard keyboard dialog chosen, set the respective menu item as checked */
403  }
404 
405  /* Check if the "Click Sound" option was chosen before (and if so, then tick the menu item) */
406  if (Globals.bSoundClick)
407  {
409  }
410 
411  /* Get screen info */
412  memset(&Pt, 0, sizeof(Pt));
413  monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
414  info.cbSize = sizeof(info);
415  GetMonitorInfoW(monitor, &info);
416  GetWindowRect(hwnd, &rcWindow);
417 
418  /*
419  If the coordination values are default then re-initialize using the specific formulas
420  to move the dialog at the bottom of the screen.
421  */
422  if (Globals.PosX == CW_USEDEFAULT && Globals.PosY == CW_USEDEFAULT)
423  {
424  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
425  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
426  }
427 
428  /*
429  Calculate the intersection of two rectangle sources (dialog and work desktop area).
430  If such sources do not intersect, then the dialog is deemed as "off screen".
431  */
432  if (IntersectRect(&rcDlgIntersect, &rcWindow, &info.rcWork) == 0)
433  {
434  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
435  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
436  }
437  else
438  {
439  /*
440  There's still some intersection but we're not for sure if it is sufficient (the dialog could also be partially hidden).
441  Therefore, check the remaining intersection if it's enough.
442  */
443  if (rcWindow.top < info.rcWork.top || rcWindow.left < info.rcWork.left || rcWindow.right > info.rcWork.right || rcWindow.bottom > info.rcWork.bottom)
444  {
445  Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
446  Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
447  }
448  }
449 
450  /*
451  Place the window (with respective placement coordinates) as topmost, above
452  every window which are not on top or are at the bottom of the Z order.
453  */
454  if (Globals.bAlwaysOnTop)
455  {
458  }
459  else
460  {
463  }
464 
465  /* Create a green brush for leds */
466  Globals.hBrushGreenLed = CreateSolidBrush(RGB(0, 255, 0));
467 
468  /* Set a timer for periodic tasks */
469  Globals.iTimer = SetTimer(hwnd, 0, 100, NULL);
470 
471  /* If the member of the struct (bShowWarning) is set then display the dialog box */
472  if (Globals.bShowWarning)
473  {
474  /* If for whatever reason the thread fails to be created then handle the dialog box in main thread... */
476  {
478  }
479  }
480 
481  return 0;
482 }
483 
484 /***********************************************************************
485  *
486  * OSK_Close
487  *
488  * Handling of WM_CLOSE
489  */
490 int OSK_Close(void)
491 {
493 
494  /* Release Ctrl, Shift, Alt keys */
495  OSK_ReleaseKey(SCAN_CODE_44); // Left shift
496  OSK_ReleaseKey(SCAN_CODE_57); // Right shift
497  OSK_ReleaseKey(SCAN_CODE_58); // Left ctrl
498  OSK_ReleaseKey(SCAN_CODE_60); // Left alt
499  OSK_ReleaseKey(SCAN_CODE_62); // Right alt
500  OSK_ReleaseKey(SCAN_CODE_64); // Right ctrl
501 
502  /* Destroy child controls */
503  OSK_DestroyKeys();
504 
505  /* delete GDI objects */
506  if (Globals.hBrushGreenLed) DeleteObject(Globals.hBrushGreenLed);
508 
509  /* Save the application's settings on registry */
510  SaveSettings();
511 
512  return TRUE;
513 }
514 
515 /***********************************************************************
516  *
517  * OSK_RefreshLEDKeys
518  *
519  * Updates (invalidates) the LED icon resources then the respective
520  * keys (Caps Lock, Scroll Lock or Num Lock) are being held down
521  */
523 {
524  INT i;
525  BOOL bKeyIsPressed;
526 
527  for (i = 0; i < _countof(LedKey); i++)
528  {
529  bKeyIsPressed = (GetAsyncKeyState(LedKey[i].vKey) & 0x8000) != 0;
530  if (LedKey[i].bWasKeyPressed != bKeyIsPressed)
531  {
532  LedKey[i].bWasKeyPressed = bKeyIsPressed;
534  }
535  }
536 }
537 
538 /***********************************************************************
539  *
540  * OSK_Timer
541  *
542  * Handling of WM_TIMER
543  */
544 int OSK_Timer(void)
545 {
546  HWND hWndActiveWindow;
547  DWORD dwThread;
548  HKL hKeyboardLayout;
549 
550  hWndActiveWindow = GetForegroundWindow();
551  if (hWndActiveWindow != NULL && hWndActiveWindow != Globals.hMainWnd)
552  {
553  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
554  Globals.hActiveWnd = hWndActiveWindow;
555 
556  /* Grab the current keyboard layout from the foreground window */
557  dwThread = GetWindowThreadProcessId(hWndActiveWindow, NULL);
558  hKeyboardLayout = GetKeyboardLayout(dwThread);
559  /* Activate the layout */
560  ActivateKeyboardLayout(hKeyboardLayout, 0);
561  }
562 
563  /*
564  Update the LED key indicators accordingly to their state (if one
565  of the specific keys is held down).
566  */
568  /* Update the buttons */
570 
571  return TRUE;
572 }
573 
574 /***********************************************************************
575  *
576  * OSK_ChooseFont
577  *
578  * Change the font of which the keys are being displayed
579  */
581 {
582  LOGFONTW lf = {0};
583  CHOOSEFONTW cf = {0};
584  HFONT hFont, hOldFont;
585  int i;
586 
587  StringCchCopyW(lf.lfFaceName, _countof(Globals.FontFaceName), Globals.FontFaceName);
588  lf.lfHeight = Globals.FontHeight;
589 
590  cf.lStructSize = sizeof(cf);
591  cf.hwndOwner = Globals.hMainWnd;
592  cf.lpLogFont = &lf;
594 
595  if (!ChooseFontW(&cf))
596  return;
597 
598  hFont = CreateFontIndirectW(&lf);
599 
600  if (!hFont)
601  return;
602 
603  /* Set font information */
604  StringCchCopyW(Globals.FontFaceName, _countof(Globals.FontFaceName), lf.lfFaceName);
605  Globals.FontHeight = lf.lfHeight;
606 
607  hOldFont = Globals.hFont;
608  Globals.hFont = hFont;
609 
610  for (i = 0; i < Globals.Keyboard->KeyCount; i++)
612 
613  DeleteObject(hOldFont);
614 }
615 
616 /***********************************************************************
617  *
618  * OSK_Command
619  *
620  * All handling of commands
621  */
622 BOOL OSK_Command(WPARAM wCommand, HWND hWndControl)
623 {
624  WORD ScanCode;
625  INPUT Input;
626  BOOL bExtendedKey;
627  BOOL bKeyDown;
628  BOOL bKeyUp;
629  LONG WindowStyle;
630  INT i;
631 
632  /* FIXME: To be deleted when ReactOS will support WS_EX_NOACTIVATE */
633  if (Globals.hActiveWnd)
634  {
635  MSG msg;
636 
637  SetForegroundWindow(Globals.hActiveWnd);
638  while (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE))
639  {
642  }
643  }
644 
645  /* KeyDown and/or KeyUp ? */
646  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
647  if ((WindowStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX)
648  {
649  /* 2-states key like Shift, Alt, Ctrl, ... */
650  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
651  {
652  bKeyDown = TRUE;
653  bKeyUp = FALSE;
654  }
655  else
656  {
657  bKeyDown = FALSE;
658  bKeyUp = TRUE;
659  }
660  }
661  else
662  {
663  /* Other key */
664  bKeyDown = TRUE;
665  bKeyUp = TRUE;
666  }
667 
668  /* Get the key from dialog control key command */
669  ScanCode = wCommand;
670 
671  /*
672  The user could've pushed one of the key buttons of the dialog that
673  can trigger particular function toggling (Caps Lock, Num Lock or Scroll Lock). Update
674  (invalidate) the LED icon resources accordingly.
675  */
676  for (i = 0; i < _countof(LedKey); i++)
677  {
678  if (LedKey[i].wScanCode == ScanCode)
679  {
681  }
682  }
683 
684  /* Extended key ? */
685  if (ScanCode & 0x0200)
686  bExtendedKey = TRUE;
687  else
688  bExtendedKey = FALSE;
690 
691  /* Press and release the key */
692  if (bKeyDown)
693  {
694  Input.type = INPUT_KEYBOARD;
695  Input.ki.wVk = 0;
696  Input.ki.wScan = ScanCode;
697  Input.ki.time = GetTickCount();
698  Input.ki.dwExtraInfo = GetMessageExtraInfo();
699  Input.ki.dwFlags = KEYEVENTF_SCANCODE;
700  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
701  SendInput(1, &Input, sizeof(Input));
702  }
703 
704  if (bKeyUp)
705  {
706  Input.type = INPUT_KEYBOARD;
707  Input.ki.wVk = 0;
708  Input.ki.wScan = ScanCode;
709  Input.ki.time = GetTickCount();
710  Input.ki.dwExtraInfo = GetMessageExtraInfo();
711  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
712  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
713  SendInput(1, &Input, sizeof(Input));
714  }
715 
716  /* Play the sound during clicking event (only if "Use Click Sound" menu option is ticked) */
717  if (Globals.bSoundClick)
718  {
720  }
721 
722  return TRUE;
723 }
724 
725 /***********************************************************************
726  *
727  * OSK_ReleaseKey
728  *
729  * Release the key of ID wCommand
730  */
732 {
733  INPUT Input;
734  BOOL bExtendedKey;
735  LONG WindowStyle;
736  HWND hWndControl;
737 
738  /* Is it a 2-states key ? */
739  hWndControl = GetDlgItem(Globals.hMainWnd, ScanCode);
740  WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
741  if ((WindowStyle & BS_AUTOCHECKBOX) != BS_AUTOCHECKBOX) return FALSE;
742 
743  /* Is the key down ? */
744  if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) != BST_CHECKED) return TRUE;
745 
746  /* Extended key ? */
747  if (ScanCode & 0x0200)
748  bExtendedKey = TRUE;
749  else
750  bExtendedKey = FALSE;
752 
753  /* Release the key */
754  Input.type = INPUT_KEYBOARD;
755  Input.ki.wVk = 0;
756  Input.ki.wScan = ScanCode;
757  Input.ki.time = GetTickCount();
758  Input.ki.dwExtraInfo = GetMessageExtraInfo();
759  Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
760  if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
761  SendInput(1, &Input, sizeof(Input));
762 
763  return TRUE;
764 }
765 
766 /***********************************************************************
767  *
768  * OSK_Paint
769  *
770  * Handles WM_PAINT messages
771  */
773 {
774  PAINTSTRUCT ps;
775  RECT rcText;
776  HFONT hOldFont = NULL;
777  WCHAR szTemp[MAX_PATH];
778 
779  HDC hdc = BeginPaint(hwnd, &ps);
780 
781  if (Globals.hFont)
782  hOldFont = SelectObject(hdc, Globals.hFont);
783 
784  rcText.left = Globals.Keyboard->LedTextStart.x;
785  rcText.top = Globals.Keyboard->LedTextStart.y;
786  rcText.right = rcText.left + Globals.Keyboard->LedTextSize.cx;
787  rcText.bottom = rcText.top + Globals.Keyboard->LedTextSize.cy;
788 
789  LoadStringW(Globals.hInstance, IDS_NUMLOCK, szTemp, _countof(szTemp));
790  DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
791 
792  OffsetRect(&rcText, Globals.Keyboard->LedTextOffset, 0);
793 
795  DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
796 
797  OffsetRect(&rcText, Globals.Keyboard->LedTextOffset, 0);
798 
800  DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
801 
802  if (hOldFont)
803  SelectObject(hdc, hOldFont);
804 
805  EndPaint(hwnd, &ps);
806 
807  return 0;
808 }
809 /***********************************************************************
810  *
811  * OSK_WndProc
812  */
814 {
815  switch (msg)
816  {
817  case WM_CREATE:
818  return OSK_Create(hwnd);
819 
820  case WM_PAINT:
821  return OSK_Paint(hwnd);
822 
823  case WM_TIMER:
824  return OSK_Timer();
825 
826  case WM_CTLCOLORSTATIC:
828  {
829  if (GetKeyState(VK_NUMLOCK) & 0x0001)
830  return (LRESULT)Globals.hBrushGreenLed;
831  else
833  }
835  {
836  if (GetKeyState(VK_CAPITAL) & 0x0001)
837  return (LRESULT)Globals.hBrushGreenLed;
838  else
840  }
842  {
843  if (GetKeyState(VK_SCROLL) & 0x0001)
844  return (LRESULT)Globals.hBrushGreenLed;
845  else
847  }
848  break;
849 
850  case WM_COMMAND:
851  switch (LOWORD(wParam))
852  {
853  case IDM_EXIT:
854  {
855  PostMessageW(hwnd, WM_CLOSE, 0, 0);
856  break;
857  }
858 
859  case IDM_ENHANCED_KB:
860  {
861  if (!Globals.bIsEnhancedKeyboard)
862  {
863  /*
864  The user attempted to switch to enhanced keyboard dialog type.
865  Set the member value as TRUE, destroy the dialog and save the data configuration into the registry.
866  */
867  Globals.bIsEnhancedKeyboard = TRUE;
868  SaveSettings();
869 
870  /* Change the condition of enhanced keyboard item menu to checked */
873 
874  /* Finally, update the key layout */
875  LoadSettings();
877  }
878 
879  break;
880  }
881 
882  case IDM_STANDARD_KB:
883  {
884  if (Globals.bIsEnhancedKeyboard)
885  {
886  /*
887  The user attempted to switch to standard keyboard dialog type.
888  Set the member value as FALSE, destroy the dialog and save the data configuration into the registry.
889  */
890  Globals.bIsEnhancedKeyboard = FALSE;
891  SaveSettings();
892 
893  /* Change the condition of standard keyboard item menu to checked */
896 
897  /* Finally, update the key layout */
898  LoadSettings();
900  }
901 
902  break;
903  }
904 
905  case IDM_CLICK_SOUND:
906  {
907  /*
908  This case is triggered when the user attempts to click on the menu item. Before doing anything,
909  we must check the condition state of such menu item so that we can tick/untick the menu item accordingly.
910  */
911  if (!Globals.bSoundClick)
912  {
913  Globals.bSoundClick = TRUE;
915  }
916  else
917  {
918  Globals.bSoundClick = FALSE;
920  }
921 
922  break;
923  }
924 
925  case IDM_ON_TOP:
926  {
927  /*
928  Check the condition state before disabling/enabling the menu
929  item and change the topmost order.
930  */
931  if (!Globals.bAlwaysOnTop)
932  {
933  Globals.bAlwaysOnTop = TRUE;
936  }
937  else
938  {
939  Globals.bAlwaysOnTop = FALSE;
942  }
943 
944  break;
945  }
946 
947  case IDM_FONT:
948  {
949  OSK_ChooseFont();
950  break;
951  }
952 
953  case IDM_ABOUT:
954  {
955  OSK_About();
956  break;
957  }
958 
959  default:
961  break;
962  }
963  return 0;
964 
965  case WM_THEMECHANGED:
966  /* Redraw the dialog (and its control buttons) using the new theme */
968  return 0;
969 
970  case WM_CLOSE:
971  OSK_Close();
972  PostQuitMessage(0);
973  return 0;
974  }
975  return DefWindowProcW(hwnd, msg, wParam, lParam);
976 }
977 
978 /***********************************************************************
979  *
980  * WinMain
981  */
983  HINSTANCE prev,
984  LPWSTR cmdline,
985  int show)
986 {
987  DWORD dwError;
988  HANDLE hMutex;
989  INITCOMMONCONTROLSEX iccex;
990  WNDCLASSEXW wc = {0};
991  MSG msg;
992  HWND hwnd;
993 
997 
998  /*
999  Obtain a mutex for the program. This will ensure that
1000  the program is launched only once.
1001  */
1002  hMutex = CreateMutexW(NULL, FALSE, L"OSKRunning");
1003 
1004  if (hMutex)
1005  {
1006  /* Check if there's already a mutex for the program */
1007  dwError = GetLastError();
1008 
1009  if (dwError == ERROR_ALREADY_EXISTS)
1010  {
1011  /*
1012  A mutex with the object name has been created previously.
1013  Therefore, another instance is already running.
1014  */
1015  DPRINT("wWinMain(): Failed to create a mutex! The program instance is already running.\n");
1017  return 0;
1018  }
1019  }
1020 
1021  /* Load the common controls */
1022  iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1024  InitCommonControlsEx(&iccex);
1025 
1026  ZeroMemory(&Globals, sizeof(Globals));
1028 
1029  /* Load the application's settings from the registry */
1030  LoadSettings();
1031 
1032  /* Define the window class */
1033  wc.cbSize = sizeof(wc);
1035  wc.lpfnWndProc = OSK_WndProc;
1037  wc.lpszClassName = OSK_CLASS;
1038  wc.style = CS_HREDRAW | CS_VREDRAW;
1039  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1040  /* Set the application's icon */
1043 
1044  if (!RegisterClassExW(&wc))
1045  goto quit;
1046 
1047  /* Load window title */
1049 
1051  OSK_CLASS,
1052  Globals.szTitle,
1054  CW_USEDEFAULT,
1055  CW_USEDEFAULT,
1056  CW_USEDEFAULT,
1057  CW_USEDEFAULT,
1058  NULL,
1059  NULL,
1061  NULL);
1062 
1063  if (!hwnd)
1064  goto quit;
1065 
1067  UpdateWindow(hwnd);
1068 
1069  while (GetMessageW(&msg, NULL, 0, 0))
1070  {
1073  }
1074 
1075 quit:
1076  /* Delete the mutex */
1077  if (hMutex)
1078  {
1080  }
1081 
1082  return 0;
1083 }
1084 
1085 /* EOF */
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define SCAN_CODE_30
Definition: osk_res.h:103
static IClassFactory * cf
#define IDS_SCROLLLOCK
Definition: osk_res.h:54
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
#define IDS_LEFTALT
Definition: osk_res.h:65
#define IDS_CAPSLOCK
Definition: osk_res.h:53
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
Definition: precomp.h:25
#define SCAN_CODE_60
Definition: osk_res.h:131
#define IDOK
Definition: winuser.h:824
#define CloseHandle
Definition: compat.h:598
NOTEPAD_GLOBALS Globals
Definition: main.c:31
#define LR_SHARED
Definition: winuser.h:1094
DWORD WINAPI OSK_WarningDlgThread(LPVOID lpParameter)
Definition: main.c:124
#define IMAGE_ICON
Definition: winuser.h:212
#define SCAN_CODE_126
Definition: osk_res.h:177
#define SM_CYSIZE
Definition: winuser.h:986
ULONG ScanCode
Definition: api.c:39
#define MF_BYCOMMAND
Definition: winuser.h:202
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
long y
Definition: polytest.cpp:48
#define IDM_ABOUT
Definition: resource.h:29
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define RGB(r, g, b)
Definition: precomp.h:62
#define SCAN_CODE_128
Definition: osk_res.h:180
#define KEYEVENTF_KEYUP
Definition: winuser.h:1096
long x
Definition: polytest.cpp:48
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
#define IDI_PG_UP
Definition: osk_res.h:24
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
BOOL OSK_Command(WPARAM wCommand, HWND hWndControl)
Definition: main.c:622
#define SW_HIDE
Definition: winuser.h:762
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1759
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
void quit(int argc, const char *argv[])
Definition: cmds.c:1606
KEYBOARD_STRUCT StandardKeyboard
Definition: keyboard.c:240
#define IDS_AUTHORS
Definition: osk_res.h:50
LONG lfHeight
Definition: dimm.idl:59
struct @1591 Msg[]
static HDC
Definition: imagelist.c:92
#define CALLBACK
Definition: compat.h:35
#define IDI_OSK
Definition: osk_res.h:15
KEYBOARD_STRUCT EnhancedKeyboard
Definition: keyboard.c:227
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SCAN_CODE_75
Definition: osk_res.h:135
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
Definition: arc.h:84
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
#define IDI_RIGHT
Definition: osk_res.h:28
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
#define SCAN_CODE_64
Definition: osk_res.h:134
#define ZeroMemory
Definition: winbase.h:1667
#define CS_HREDRAW
Definition: winuser.h:648
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define HWND_TOPMOST
Definition: winuser.h:1198
#define SM_CYSMICON
Definition: winuser.h:1007
HICON hIcon
Definition: winuser.h:3202
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define IDC_SHOWWARNINGCHECK
Definition: resource.h:25
#define SCAN_CODE_62
Definition: osk_res.h:133
#define IDS_PRN
Definition: osk_res.h:57
#define SCAN_CODE_79
Definition: osk_res.h:137
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define IDI_TOP
Definition: osk_res.h:27
UINT_PTR WPARAM
Definition: windef.h:207
#define IDI_TAB
Definition: osk_res.h:17
#define WS_CHILD
Definition: pedump.c:617
TCHAR * cmdline
Definition: stretchblt.cpp:32
LONG left
Definition: windef.h:306
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
int32_t INT_PTR
Definition: typedefs.h:64
LONG right
Definition: windef.h:308
#define IDI_SHIFT
Definition: osk_res.h:20
#define IDS_NUMLOCKKEY
Definition: osk_res.h:61
BOOL WINAPI DestroyWindow(_In_ HWND)
#define BM_SETIMAGE
Definition: winuser.h:1909
#define IDS_ESCAPE
Definition: osk_res.h:56
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4296
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define COLOR_WINDOW
Definition: winuser.h:912
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HINSTANCE hInstance
Definition: main.h:55
#define IDS_OSK
Definition: osk_res.h:49
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
void SaveSettings(void)
Definition: settings.c:115
#define SCAN_CODE_80
Definition: osk_res.h:138
#define IDC_LED_CAPS
Definition: osk_res.h:11
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
#define L(x)
Definition: ntvdm.h:50
LPCWSTR lpszMenuName
Definition: winuser.h:3205
#define INPUT_KEYBOARD
Definition: winable.h:10
void LoadSettings(void)
Definition: settings.c:53
#define SCAN_CODE_16
Definition: osk_res.h:89
#define FALSE
Definition: types.h:117
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define IDI_LEFT
Definition: osk_res.h:26
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_PTR scancode
Definition: precomp.h:28
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
static struct _test_info info[]
Definition: SetCursorPos.c:19
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
int OSK_SetImage(int IdDlgItem, int IdResource)
Definition: main.c:33
BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
Definition: fontdlg.c:184
#define IDI_BACK
Definition: osk_res.h:16
#define SCAN_CODE_57
Definition: osk_res.h:129
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define IDI_MENU
Definition: osk_res.h:22
#define IDS_RIGHTALT
Definition: osk_res.h:66
#define CW_USEDEFAULT
Definition: winuser.h:225
#define IDI_HOME
Definition: osk_res.h:23
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:585
void OSK_SetText(int IdDlgItem, int IdResource)
Definition: main.c:63
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SCAN_CODE_124
Definition: osk_res.h:175
#define SCAN_CODE_86
Definition: osk_res.h:143
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
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
LPARAM WINAPI GetMessageExtraInfo(void)
Definition: message.c:1340
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
LONG cx
Definition: windef.h:334
#define SCAN_CODE_58
Definition: osk_res.h:130
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_GETCHECK
Definition: winuser.h:1905
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
#define IDM_FONT
Definition: osk_res.h:43
HANDLE hMutex
Definition: mutex.c:11
#define SW_SHOW
Definition: winuser.h:769
#define IDS_STOP
Definition: osk_res.h:58
HFONT hFont
Definition: main.h:60
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LPCWSTR lpszClassName
Definition: winuser.h:3206
int OSK_Close(void)
Definition: main.c:490
#define IDM_ON_TOP
Definition: osk_res.h:40
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4379
#define IDI_CAPS_LOCK
Definition: osk_res.h:18
SHORT WINAPI GetKeyState(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:896
#define IDS_INSERT
Definition: osk_res.h:60
#define IDM_STANDARD_KB
Definition: osk_res.h:33
LRESULT APIENTRY OSK_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:813
#define MF_CHECKED
Definition: winuser.h:132
#define CS_VREDRAW
Definition: winuser.h:653
VOID OSK_ChooseFont(VOID)
Definition: main.c:580
#define MAPVK_VSC_TO_VK
Definition: winuser.h:2336
#define SS_CENTER
Definition: pedump.c:693
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:2586
#define SCAN_CODE_125
Definition: osk_res.h:176
VOID OSK_RefreshLEDKeys(VOID)
Definition: main.c:522
#define GetProcessHeap()
Definition: compat.h:595
#define SS_NOTIFY
Definition: winuser.h:351
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDM_ENHANCED_KB
Definition: osk_res.h:34
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define LR_DEFAULTSIZE
Definition: winuser.h:1088
__wchar_t WCHAR
Definition: xmlstorage.h:180
HBRUSH hbrBackground
Definition: winuser.h:3204
UINT cbSize
Definition: winuser.h:3196
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define _countof(array)
Definition: sndvol32.h:68
#define WM_TIMER
Definition: winuser.h:1729
int OSK_Timer(void)
Definition: main.c:544
#define WM_CLOSE
Definition: winuser.h:1608
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
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
LRESULT OSK_SetKeys(int reason)
Definition: main.c:188
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define SCAN_CODE_110
Definition: osk_res.h:162
#define SND_ASYNC
Definition: mmsystem.h:154
HINSTANCE hInstance
Definition: main.c:36
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
GLbitfield flags
Definition: glext.h:7161
HINSTANCE hInstance
Definition: winuser.h:3201
#define WM_PAINT
Definition: winuser.h:1607
#define IDC_LED_SCROLL
Definition: osk_res.h:12
#define SM_CXSMICON
Definition: winuser.h:1006
#define SND_RESOURCE
Definition: mmsystem.h:163
HANDLE HINSTANCE
Definition: typedefs.h:77
#define IDS_ATTN
Definition: osk_res.h:59
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define IDI_REACTOS
Definition: osk_res.h:21
LRESULT OSK_Paint(HWND hwnd)
Definition: main.c:772
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
HDC hdc
Definition: main.c:9
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
LRESULT OSK_Create(HWND hwnd)
Definition: main.c:372
SHORT WINAPI GetAsyncKeyState(_In_ int)
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define SCAN_CODE_89
Definition: osk_res.h:144
#define IDS_CTRL
Definition: osk_res.h:64
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WM_COMMAND
Definition: winuser.h:1727
UINT_PTR HKL
Definition: msctf.idl:101
INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:83
UINT style
Definition: winuser.h:3197
#define MF_UNCHECKED
Definition: winuser.h:204
#define SCAN_CODE_15
Definition: osk_res.h:88
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
unsigned char BYTE
Definition: xxhash.c:193
#define BS_PUSHBUTTON
Definition: pedump.c:651
WNDPROC lpfnWndProc
Definition: winuser.h:3198
#define OSK_CLASS
Definition: precomp.h:126
#define IDI_RETURN
Definition: osk_res.h:19
#define SWP_NOSIZE
Definition: winuser.h:1235
#define GWL_STYLE
Definition: winuser.h:846
#define DT_NOCLIP
Definition: winuser.h:536
#define SCAN_CODE_76
Definition: osk_res.h:136
#define IDI_SOUNDCLICK
Definition: osk_res.h:8
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1093
#define CF_NOSTYLESEL
Definition: commdlg.h:82
VOID OSK_DestroyKeys(VOID)
Definition: main.c:162
#define GetModuleHandle
Definition: winbase.h:3688
#define SCAN_CODE_127
Definition: osk_res.h:179
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
#define WS_MINIMIZEBOX
Definition: pedump.c:631
VOID OSK_About(VOID)
Definition: main.c:138
#define VK_SCROLL
Definition: winuser.h:2260
#define VK_NUMLOCK
Definition: winuser.h:2259
HICON hIcon
Definition: msconfig.c:44
#define SCAN_CODE_84
Definition: osk_res.h:141
#define WC_BUTTONW
Definition: commctrl.h:4623
#define IDS_NUMLOCK
Definition: osk_res.h:52
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
#define VK_CAPITAL
Definition: winuser.h:2186
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:29
#define SCAN_CODE_43
Definition: osk_res.h:116
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define IDM_EXIT
Definition: resource.h:27
int WINAPI ToUnicode(_In_ UINT wVirtKey, _In_ UINT wScanCode, _In_reads_bytes_opt_(256) CONST BYTE *lpKeyState, _Out_writes_(cchBuff) LPWSTR pwszBuff, _In_ int cchBuff, _In_ UINT wFlags)
OSK_KEYLEDINDICATOR LedKey[]
Definition: main.c:18
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define KEYEVENTF_EXTENDEDKEY
Definition: winuser.h:1095
#define SCAN_CODE_90
Definition: osk_res.h:145
#define BST_CHECKED
Definition: winuser.h:197
#define WM_SETFONT
Definition: winuser.h:1637
#define WC_STATICW
Definition: commctrl.h:4680
HICON hIconSm
Definition: winuser.h:3207
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define msg(x)
Definition: auth_time.c:54
_Out_opt_ int * cx
Definition: commctrl.h:585
#define IDD_WARNINGDIALOG_OSK
Definition: osk_res.h:47
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IDS_END
Definition: osk_res.h:63
#define WM_CREATE
Definition: winuser.h:1595
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BOOL WINAPI SetForegroundWindow(_In_ HWND)
LONG bottom
Definition: windef.h:309
#define SCANCODE_MASK
Definition: precomp.h:122
int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow)
Definition: main.c:419
#define SWP_NOMOVE
Definition: winuser.h:1234
#define SM_CYMENU
Definition: winuser.h:970
BOOL OSK_ReleaseKey(WORD ScanCode)
Definition: main.c:731
#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:1196
#define IDS_DELETE
Definition: resource.h:40
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#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:142
#define PM_REMOVE
Definition: winuser.h:1186
#define SCAN_CODE_44
Definition: osk_res.h:117
#define IDC_LED_NUM
Definition: osk_res.h:10
#define DPRINT
Definition: sndvol32.h:71
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
#define SCAN_CODE_83
Definition: osk_res.h:140
LONG_PTR LRESULT
Definition: windef.h:209
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081
#define IDR_OSK_MENU
Definition: osk_res.h:31
#define WS_VISIBLE
Definition: pedump.c:620
LPCWSTR name
Definition: precomp.h:27
#define WS_SYSMENU
Definition: pedump.c:629
#define memset(x, y, z)
Definition: compat.h:39
HMENU WINAPI GetMenu(_In_ HWND)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HWND hMainWnd
Definition: main.h:56
LONG cy
Definition: windef.h:335
#define WM_INITDIALOG
Definition: winuser.h:1726
#define IDI_PG_DOWN
Definition: osk_res.h:25
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:594
#define SCAN_CODE_81
Definition: osk_res.h:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
UINT WINAPI SendInput(UINT, LPINPUT, int)
Definition: ntwrapper.h:344
#define CF_INITTOLOGFONTSTRUCT
Definition: commdlg.h:66
#define APIENTRY
Definition: api.h:79
#define IDM_CLICK_SOUND
Definition: osk_res.h:41
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:17
HFONT hFont
Definition: main.c:53
#define SCAN_CODE_129
Definition: osk_res.h:181
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:531