ReactOS 0.4.15-dev-8344-g0574987
main.c File Reference
#include "precomp.h"
Include dependency graph for main.c:

Go to the source code of this file.

Functions

int OSK_SetImage (int IdDlgItem, int IdResource)
 
void OSK_SetText (int IdDlgItem, int IdResource)
 
INT_PTR CALLBACK OSK_WarningProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
 
DWORD WINAPI OSK_WarningDlgThread (LPVOID lpParameter)
 
VOID OSK_About (VOID)
 
VOID OSK_DestroyKeys (VOID)
 
LRESULT OSK_SetKeys (int reason)
 
LRESULT OSK_Create (HWND hwnd)
 
int OSK_Close (void)
 
VOID OSK_RefreshLEDKeys (VOID)
 
int OSK_Timer (void)
 
VOID OSK_ChooseFont (VOID)
 
BOOL OSK_Command (WPARAM wCommand, HWND hWndControl)
 
BOOL OSK_ReleaseKey (WORD ScanCode)
 
LRESULT OSK_Paint (HWND hwnd)
 
LRESULT APIENTRY OSK_WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
int WINAPI wWinMain (HINSTANCE hInstance, HINSTANCE prev, LPWSTR cmdline, int show)
 

Variables

OSK_GLOBALS Globals
 
OSK_KEYLEDINDICATOR LedKey []
 

Function Documentation

◆ OSK_About()

VOID OSK_About ( VOID  )

Definition at line 138 of file main.c.

139{
140 WCHAR szAuthors[MAX_PATH];
141
142 /* Load the strings into the "About" dialog */
143 LoadStringW(Globals.hInstance, IDS_AUTHORS, szAuthors, _countof(szAuthors));
144
145 /* Load the icon */
146 /* Finally, execute the "About" dialog by using the Shell routine */
149}
OSK_GLOBALS Globals
Definition: main.c:16
#define MAX_PATH
Definition: compat.h:34
#define IDS_AUTHORS
Definition: osk_res.h:50
#define IDI_OSK
Definition: osk_res.h:15
BOOL WINAPI ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#define _countof(array)
Definition: sndvol32.h:70
HINSTANCE hInstance
Definition: precomp.h:52
HWND hMainWnd
Definition: precomp.h:53
WCHAR szTitle[MAX_PATH]
Definition: precomp.h:59
#define IMAGE_ICON
Definition: winuser.h:212
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2247
#define LR_SHARED
Definition: winuser.h:1100
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by OSK_WndProc().

◆ OSK_ChooseFont()

VOID OSK_ChooseFont ( VOID  )

Definition at line 572 of file main.c.

573{
574 LOGFONTW lf = {0};
575 CHOOSEFONTW cf = {0};
576 HFONT hFont, hOldFont;
577 int i;
578
581
582 cf.lStructSize = sizeof(cf);
583 cf.hwndOwner = Globals.hMainWnd;
584 cf.lpLogFont = &lf;
586
587 if (!ChooseFontW(&cf))
588 return;
589
591
592 if (!hFont)
593 return;
594
595 /* Set font information */
598
599 hOldFont = Globals.hFont;
601
602 for (i = 0; i < Globals.Keyboard->KeyCount; i++)
604
605 DeleteObject(hOldFont);
606}
HFONT hFont
Definition: main.c:53
#define CF_INITTOLOGFONTSTRUCT
Definition: commdlg.h:66
#define CF_NOSTYLESEL
Definition: commdlg.h:82
#define TRUE
Definition: types.h:120
BOOL WINAPI ChooseFontW(LPCHOOSEFONTW lpChFont)
Definition: fontdlg.c:184
pKey DeleteObject()
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
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
LONG lfHeight
Definition: dimm.idl:59
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
WCHAR FontFaceName[LF_FACESIZE]
Definition: precomp.h:68
LONG FontHeight
Definition: precomp.h:69
PKEYBOARD_STRUCT Keyboard
Definition: precomp.h:56
HWND * hKeys
Definition: precomp.h:57
HFONT hFont
Definition: precomp.h:58
UINT_PTR WPARAM
Definition: windef.h:207
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
#define WM_SETFONT
Definition: winuser.h:1650
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by OSK_WndProc().

◆ OSK_Close()

int OSK_Close ( void  )

Definition at line 485 of file main.c.

486{
488
489 /* Release Ctrl, Shift, Alt keys */
490 OSK_ReleaseKey(SCAN_CODE_44); // Left shift
491 OSK_ReleaseKey(SCAN_CODE_57); // Right shift
492 OSK_ReleaseKey(SCAN_CODE_58); // Left ctrl
493 OSK_ReleaseKey(SCAN_CODE_60); // Left alt
494 OSK_ReleaseKey(SCAN_CODE_62); // Right alt
495 OSK_ReleaseKey(SCAN_CODE_64); // Right ctrl
496
497 /* Destroy child controls */
499
500 /* delete GDI objects */
503
504 /* Save the application's settings on registry */
505 SaveSettings();
506
507 return TRUE;
508}
void SaveSettings(void)
Definition: settings.c:115
VOID OSK_DestroyKeys(VOID)
Definition: main.c:157
BOOL OSK_ReleaseKey(WORD ScanCode)
Definition: main.c:710
#define SCAN_CODE_64
Definition: osk_res.h:134
#define SCAN_CODE_44
Definition: osk_res.h:117
#define SCAN_CODE_60
Definition: osk_res.h:131
#define SCAN_CODE_58
Definition: osk_res.h:130
#define SCAN_CODE_57
Definition: osk_res.h:129
#define SCAN_CODE_62
Definition: osk_res.h:133
UINT_PTR iTimer
Definition: precomp.h:55
HBRUSH hBrushGreenLed
Definition: precomp.h:54
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by OSK_WndProc().

◆ OSK_Command()

BOOL OSK_Command ( WPARAM  wCommand,
HWND  hWndControl 
)

Definition at line 614 of file main.c.

615{
617 INPUT Input;
618 BOOL bExtendedKey;
619 BOOL bKeyDown;
620 BOOL bKeyUp;
621 LONG WindowStyle;
622 INT i;
623
624 /* KeyDown and/or KeyUp ? */
625 WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
626 if ((WindowStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX)
627 {
628 /* 2-states key like Shift, Alt, Ctrl, ... */
629 if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
630 {
631 bKeyDown = TRUE;
632 bKeyUp = FALSE;
633 }
634 else
635 {
636 bKeyDown = FALSE;
637 bKeyUp = TRUE;
638 }
639 }
640 else
641 {
642 /* Other key */
643 bKeyDown = TRUE;
644 bKeyUp = TRUE;
645 }
646
647 /* Get the key from dialog control key command */
648 ScanCode = wCommand;
649
650 /*
651 The user could've pushed one of the key buttons of the dialog that
652 can trigger particular function toggling (Caps Lock, Num Lock or Scroll Lock). Update
653 (invalidate) the LED icon resources accordingly.
654 */
655 for (i = 0; i < _countof(LedKey); i++)
656 {
657 if (LedKey[i].wScanCode == ScanCode)
658 {
660 }
661 }
662
663 /* Extended key ? */
664 if (ScanCode & 0x0200)
665 bExtendedKey = TRUE;
666 else
667 bExtendedKey = FALSE;
669
670 /* Press and release the key */
671 if (bKeyDown)
672 {
673 Input.type = INPUT_KEYBOARD;
674 Input.ki.wVk = 0;
675 Input.ki.wScan = ScanCode;
676 Input.ki.time = GetTickCount();
677 Input.ki.dwExtraInfo = GetMessageExtraInfo();
678 Input.ki.dwFlags = KEYEVENTF_SCANCODE;
679 if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
680 SendInput(1, &Input, sizeof(Input));
681 }
682
683 if (bKeyUp)
684 {
685 Input.type = INPUT_KEYBOARD;
686 Input.ki.wVk = 0;
687 Input.ki.wScan = ScanCode;
688 Input.ki.time = GetTickCount();
689 Input.ki.dwExtraInfo = GetMessageExtraInfo();
690 Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
691 if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
692 SendInput(1, &Input, sizeof(Input));
693 }
694
695 /* Play the sound during clicking event (only if "Use Click Sound" menu option is ticked) */
697 {
699 }
700
701 return TRUE;
702}
UINT ScanCode
Definition: VirtualKey.c:24
OSK_KEYLEDINDICATOR LedKey[]
Definition: main.c:18
#define SCANCODE_MASK
Definition: precomp.h:120
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned short WORD
Definition: ntddk_ex.h:93
#define SND_RESOURCE
Definition: mmsystem.h:163
#define SND_ASYNC
Definition: mmsystem.h:154
#define IDI_SOUNDCLICK
Definition: osk_res.h:8
#define BS_AUTOCHECKBOX
Definition: pedump.c:654
long LONG
Definition: pedump.c:60
BOOL WINAPI PlaySoundW(LPCWSTR pszSoundW, HMODULE hmod, DWORD fdwSound)
Definition: playsound.c:653
@ Input
Definition: arc.h:84
BOOL bSoundClick
Definition: precomp.h:64
int32_t INT
Definition: typedefs.h:58
UINT WINAPI SendInput(UINT, LPINPUT, int)
Definition: ntwrapper.h:344
#define INPUT_KEYBOARD
Definition: winable.h:10
#define GetModuleHandle
Definition: winbase.h:3827
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define KEYEVENTF_EXTENDEDKEY
Definition: winuser.h:1101
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:852
LPARAM WINAPI GetMessageExtraInfo(void)
Definition: message.c:1340
#define KEYEVENTF_KEYUP
Definition: winuser.h:1102
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1918

Referenced by OSK_WndProc().

◆ OSK_Create()

LRESULT OSK_Create ( HWND  hwnd)

Definition at line 367 of file main.c.

368{
369 HMONITOR monitor;
371 POINT Pt;
372 RECT rcWindow, rcDlgIntersect;
373 LOGFONTW lf = {0};
374
375 /* Save handle */
377
378 /* Init Font */
382
383 if (OSK_SetKeys(SETKEYS_INIT) == -1)
384 return -1;
385
386 /* Check the checked menu item before displaying the window */
388 {
389 /* Enhanced keyboard dialog chosen, set the respective menu item as checked */
392 }
393 else
394 {
395 /* Standard keyboard dialog chosen, set the respective menu item as checked */
398 }
399
400 /* Check if the "Click Sound" option was chosen before (and if so, then tick the menu item) */
402 {
404 }
405
406 /* Get screen info */
407 memset(&Pt, 0, sizeof(Pt));
408 monitor = MonitorFromPoint(Pt, MONITOR_DEFAULTTOPRIMARY);
409 info.cbSize = sizeof(info);
410 GetMonitorInfoW(monitor, &info);
411 GetWindowRect(hwnd, &rcWindow);
412
413 /*
414 If the coordination values are default then re-initialize using the specific formulas
415 to move the dialog at the bottom of the screen.
416 */
418 {
419 Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
420 Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
421 }
422
423 /*
424 Calculate the intersection of two rectangle sources (dialog and work desktop area).
425 If such sources do not intersect, then the dialog is deemed as "off screen".
426 */
427 if (IntersectRect(&rcDlgIntersect, &rcWindow, &info.rcWork) == 0)
428 {
429 Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
430 Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
431 }
432 else
433 {
434 /*
435 There's still some intersection but we're not for sure if it is sufficient (the dialog could also be partially hidden).
436 Therefore, check the remaining intersection if it's enough.
437 */
438 if (rcWindow.top < info.rcWork.top || rcWindow.left < info.rcWork.left || rcWindow.right > info.rcWork.right || rcWindow.bottom > info.rcWork.bottom)
439 {
440 Globals.PosX = (info.rcMonitor.left + info.rcMonitor.right - (rcWindow.right - rcWindow.left)) / 2;
441 Globals.PosY = info.rcMonitor.bottom - (rcWindow.bottom - rcWindow.top);
442 }
443 }
444
445 /*
446 Place the window (with respective placement coordinates) as topmost, above
447 every window which are not on top or are at the bottom of the Z order.
448 */
450 {
453 }
454 else
455 {
458 }
459
460 /* Create a green brush for leds */
462
463 /* Set a timer for periodic tasks */
464 Globals.iTimer = SetTimer(hwnd, 0, 100, NULL);
465
466 /* If the member of the struct (bShowWarning) is set then display the dialog box */
468 {
469 /* If for whatever reason the thread fails to be created then handle the dialog box in main thread... */
471 {
473 }
474 }
475
476 return 0;
477}
DWORD WINAPI OSK_WarningDlgThread(LPVOID lpParameter)
Definition: main.c:124
LRESULT OSK_SetKeys(int reason)
Definition: main.c:183
INT_PTR CALLBACK OSK_WarningProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:83
@ SETKEYS_INIT
Definition: precomp.h:130
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define RGB(r, g, b)
Definition: precomp.h:71
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
#define IDM_STANDARD_KB
Definition: osk_res.h:33
#define IDM_CLICK_SOUND
Definition: osk_res.h:41
#define IDM_ENHANCED_KB
Definition: osk_res.h:34
#define IDM_ON_TOP
Definition: osk_res.h:40
#define IDD_WARNINGDIALOG_OSK
Definition: osk_res.h:47
#define memset(x, y, z)
Definition: compat.h:39
BOOL bAlwaysOnTop
Definition: precomp.h:65
INT PosX
Definition: precomp.h:66
INT PosY
Definition: precomp.h:67
BOOL bShowWarning
Definition: precomp.h:62
BOOL bIsEnhancedKeyboard
Definition: precomp.h:63
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define MF_BYCOMMAND
Definition: winuser.h:202
#define HWND_TOPMOST
Definition: winuser.h:1208
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 DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define MF_CHECKED
Definition: winuser.h:132
#define SWP_NOSIZE
Definition: winuser.h:1245
#define MF_UNCHECKED
Definition: winuser.h:204
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define HWND_NOTOPMOST
Definition: winuser.h:1206
HMENU WINAPI GetMenu(_In_ HWND)

Referenced by OSK_WndProc().

◆ OSK_DestroyKeys()

VOID OSK_DestroyKeys ( VOID  )

Definition at line 157 of file main.c.

158{
159 int i;
160 /* Hide before destroying child controls */
162
163 for (i = 0; i < Globals.Keyboard->KeyCount; i++)
164 {
166 }
167 for (i = 0; i < _countof(LedKey); i++)
168 {
170 }
171
175}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by OSK_Close(), and OSK_SetKeys().

◆ OSK_Paint()

LRESULT OSK_Paint ( HWND  hwnd)

Definition at line 751 of file main.c.

752{
753 PAINTSTRUCT ps;
754 RECT rcText;
755 HFONT hOldFont = NULL;
756 WCHAR szTemp[MAX_PATH];
757
758 HDC hdc = BeginPaint(hwnd, &ps);
759
760 if (Globals.hFont)
761 hOldFont = SelectObject(hdc, Globals.hFont);
762
765 rcText.right = rcText.left + Globals.Keyboard->LedTextSize.cx;
766 rcText.bottom = rcText.top + Globals.Keyboard->LedTextSize.cy;
767
769 DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
770
772
774 DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
775
777
779 DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
780
781 if (hOldFont)
782 SelectObject(hdc, hOldFont);
783
784 EndPaint(hwnd, &ps);
785
786 return 0;
787}
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define IDS_SCROLLLOCK
Definition: osk_res.h:54
#define IDS_NUMLOCK
Definition: osk_res.h:52
#define IDS_CAPSLOCK
Definition: osk_res.h:53
INT LedTextOffset
Definition: precomp.h:44
SIZE LedTextSize
Definition: precomp.h:43
POINT LedTextStart
Definition: precomp.h:42
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DT_NOCLIP
Definition: winuser.h:536
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by OSK_WndProc().

◆ OSK_RefreshLEDKeys()

VOID OSK_RefreshLEDKeys ( VOID  )

Definition at line 517 of file main.c.

518{
519 INT i;
520 BOOL bKeyIsPressed;
521
522 for (i = 0; i < _countof(LedKey); i++)
523 {
524 bKeyIsPressed = (GetAsyncKeyState(LedKey[i].vKey) & 0x8000) != 0;
525 if (LedKey[i].bWasKeyPressed != bKeyIsPressed)
526 {
527 LedKey[i].bWasKeyPressed = bKeyIsPressed;
529 }
530 }
531}
SHORT WINAPI GetAsyncKeyState(_In_ int)

Referenced by OSK_Timer().

◆ OSK_ReleaseKey()

BOOL OSK_ReleaseKey ( WORD  ScanCode)

Definition at line 710 of file main.c.

711{
712 INPUT Input;
713 BOOL bExtendedKey;
714 LONG WindowStyle;
715 HWND hWndControl;
716
717 /* Is it a 2-states key ? */
718 hWndControl = GetDlgItem(Globals.hMainWnd, ScanCode);
719 WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
720 if ((WindowStyle & BS_AUTOCHECKBOX) != BS_AUTOCHECKBOX) return FALSE;
721
722 /* Is the key down ? */
723 if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) != BST_CHECKED) return TRUE;
724
725 /* Extended key ? */
726 if (ScanCode & 0x0200)
727 bExtendedKey = TRUE;
728 else
729 bExtendedKey = FALSE;
731
732 /* Release the key */
733 Input.type = INPUT_KEYBOARD;
734 Input.ki.wVk = 0;
735 Input.ki.wScan = ScanCode;
736 Input.ki.time = GetTickCount();
737 Input.ki.dwExtraInfo = GetMessageExtraInfo();
738 Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
739 if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
740 SendInput(1, &Input, sizeof(Input));
741
742 return TRUE;
743}

Referenced by OSK_Close().

◆ OSK_SetImage()

int OSK_SetImage ( int  IdDlgItem,
int  IdResource 
)

Definition at line 33 of file main.c.

34{
36 HWND hWndItem;
37
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}
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_SETIMAGE
Definition: winuser.h:1922
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2097

Referenced by OSK_SetKeys().

◆ OSK_SetKeys()

LRESULT OSK_SetKeys ( int  reason)

Definition at line 183 of file main.c.

184{
185 WCHAR wKey[2];
186 BYTE bKeyStates[256];
187 LPCWSTR szKey;
188 PKEY Keys;
189 UINT uVirtKey;
190 POINT LedPos;
191 SIZE LedSize;
192 int i, yPad;
193
194 /* Get key states before doing anything */
195 if (!GetKeyboardState(bKeyStates))
196 {
197 DPRINT("OSK_SetKeys(): GetKeyboardState() call failed.\n");
198 return -1;
199 }
200
201 switch (reason)
202 {
203 case SETKEYS_LANG:
204 {
205 /* Keyboard language/caps change, just update the button texts */
206 Keys = Globals.Keyboard->Keys;
207 for (i = 0; i < Globals.Keyboard->KeyCount; i++)
208 {
209 if (!Keys[i].translate)
210 continue;
211
212 uVirtKey = MapVirtualKeyW(Keys[i].scancode & SCANCODE_MASK, MAPVK_VSC_TO_VK);
213
214 if (ToUnicode(uVirtKey, Keys[i].scancode & SCANCODE_MASK, bKeyStates, wKey, _countof(wKey), 0) >= 1)
215 {
216 szKey = wKey;
217 }
218 else
219 {
220 szKey = Keys[i].name;
221 }
222
223 /* Only one & the button will try to underline the next character... */
224 if (wcsncmp(szKey, L"&", 1) == 0)
225 szKey = L"&&";
226
227 SetWindowTextW(Globals.hKeys[i], szKey);
228 }
229 return 0;
230 }
231 case SETKEYS_LAYOUT:
232 {
233 /* Clear up current layout before applying a different one */
235 }
236 /* Fallthrough */
237 case SETKEYS_INIT:
238 {
240 {
242 }
243 else
244 {
246 }
247
249
250 if (!Globals.hKeys)
251 {
252 DPRINT("OSK_SetKeys(): Failed to allocate memory for button handles.\n");
253 return -1;
254 }
255
256 Keys = Globals.Keyboard->Keys;
257
258 /* Create key buttons */
259 for (i = 0; i < Globals.Keyboard->KeyCount; i++)
260 {
261 uVirtKey = MapVirtualKeyW(Keys[i].scancode & SCANCODE_MASK, MAPVK_VSC_TO_VK);
262
263 if (Keys[i].translate && ToUnicode(uVirtKey, Keys[i].scancode & SCANCODE_MASK, bKeyStates, wKey, _countof(wKey), 0) >= 1)
264 {
265 szKey = wKey;
266 }
267 else
268 {
269 szKey = Keys[i].name;
270 }
271
273 szKey,
275 Keys[i].x,
276 Keys[i].y,
277 Keys[i].cx,
278 Keys[i].cy,
280 (HMENU)Keys[i].scancode,
282 NULL);
283 if (Globals.hFont)
285 }
286
287 /* Add additional padding for caption and menu */
289 /* Size window according to layout */
292 0,
293 0,
295 Globals.Keyboard->Size.cy + yPad,
296 SWP_NOMOVE);
297
298 /* Create LEDs */
299 LedPos = Globals.Keyboard->LedStart;
300 LedSize = Globals.Keyboard->LedSize;
301
303 LedPos.x, LedPos.y, LedSize.cx, LedSize.cy, Globals.hMainWnd,
305
306 LedPos.x += Globals.Keyboard->LedGap;
307
309 LedPos.x, LedPos.y, LedSize.cx, LedSize.cy, Globals.hMainWnd,
311
312 LedPos.x += Globals.Keyboard->LedGap;
313
315 LedPos.x, LedPos.y, LedSize.cx, LedSize.cy, Globals.hMainWnd,
317
318 /* Set system keys text */
327 OSK_SetText(SCAN_CODE_58, IDS_CTRL); /* Left ctrl */
328 OSK_SetText(SCAN_CODE_64, IDS_CTRL); /* Right ctrl */
331
332 /* Set icon on visual buttons */
349 }
350 }
351
352 if (reason != SETKEYS_INIT)
353 {
356 }
357
358 return 0;
359}
#define IDS_DELETE
Definition: resource.h:40
KEYBOARD_STRUCT EnhancedKeyboard
Definition: keyboard.c:227
KEYBOARD_STRUCT StandardKeyboard
Definition: keyboard.c:240
void OSK_SetText(int IdDlgItem, int IdResource)
Definition: main.c:63
int OSK_SetImage(int IdDlgItem, int IdResource)
Definition: main.c:33
@ SETKEYS_LANG
Definition: precomp.h:132
@ SETKEYS_LAYOUT
Definition: precomp.h:131
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLbitfield flags
Definition: glext.h:7161
static void translate(POINT *pt, UINT count, const XFORM *xform)
Definition: metafile.c:2586
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define SCAN_CODE_30
Definition: osk_res.h:103
#define IDS_RIGHTALT
Definition: osk_res.h:66
#define IDI_BOTTOM
Definition: osk_res.h:29
#define IDC_LED_CAPS
Definition: osk_res.h:11
#define SCAN_CODE_79
Definition: osk_res.h:137
#define SCAN_CODE_127
Definition: osk_res.h:179
#define IDI_SHIFT
Definition: osk_res.h:20
#define SCAN_CODE_124
Definition: osk_res.h:175
#define IDC_LED_SCROLL
Definition: osk_res.h:12
#define IDI_RETURN
Definition: osk_res.h:19
#define SCAN_CODE_85
Definition: osk_res.h:142
#define SCAN_CODE_86
Definition: osk_res.h:143
#define IDS_STOP
Definition: osk_res.h:58
#define SCAN_CODE_16
Definition: osk_res.h:89
#define SCAN_CODE_15
Definition: osk_res.h:88
#define SCAN_CODE_110
Definition: osk_res.h:162
#define SCAN_CODE_126
Definition: osk_res.h:177
#define IDI_TAB
Definition: osk_res.h:17
#define IDS_CTRL
Definition: osk_res.h:64
#define IDI_REACTOS
Definition: osk_res.h:21
#define IDS_INSERT
Definition: osk_res.h:60
#define SCAN_CODE_75
Definition: osk_res.h:135
#define IDI_PG_DOWN
Definition: osk_res.h:25
#define SCAN_CODE_84
Definition: osk_res.h:141
#define IDI_CAPS_LOCK
Definition: osk_res.h:18
#define IDI_HOME
Definition: osk_res.h:23
#define IDS_LEFTALT
Definition: osk_res.h:65
#define SCAN_CODE_80
Definition: osk_res.h:138
#define SCAN_CODE_89
Definition: osk_res.h:144
#define IDS_PRN
Definition: osk_res.h:57
#define IDS_ESCAPE
Definition: osk_res.h:56
#define IDI_PG_UP
Definition: osk_res.h:24
#define SCAN_CODE_90
Definition: osk_res.h:145
#define SCAN_CODE_81
Definition: osk_res.h:139
#define SCAN_CODE_125
Definition: osk_res.h:176
#define SCAN_CODE_83
Definition: osk_res.h:140
#define IDI_RIGHT
Definition: osk_res.h:28
#define IDI_BACK
Definition: osk_res.h:16
#define SCAN_CODE_129
Definition: osk_res.h:181
#define SCAN_CODE_76
Definition: osk_res.h:136
#define IDS_NUMLOCKKEY
Definition: osk_res.h:61
#define IDS_ATTN
Definition: osk_res.h:59
#define IDI_LEFT
Definition: osk_res.h:26
#define SCAN_CODE_128
Definition: osk_res.h:180
#define IDS_END
Definition: osk_res.h:63
#define IDC_LED_NUM
Definition: osk_res.h:10
#define IDI_MENU
Definition: osk_res.h:22
#define SCAN_CODE_43
Definition: osk_res.h:116
#define IDI_TOP
Definition: osk_res.h:27
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define SS_CENTER
Definition: pedump.c:693
#define BS_PUSHBUTTON
Definition: pedump.c:651
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define WC_BUTTONW
Definition: commctrl.h:4623
_Out_opt_ int * cx
Definition: commctrl.h:585
#define WC_STATICW
Definition: commctrl.h:4680
_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)
#define DPRINT
Definition: sndvol32.h:73
POINT LedStart
Definition: precomp.h:45
Definition: precomp.h:26
LPCWSTR name
Definition: precomp.h:27
#define SM_CYSIZE
Definition: winuser.h:992
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SS_NOTIFY
Definition: winuser.h:351
#define SM_CYMENU
Definition: winuser.h:976
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)
_Check_return_ BOOL WINAPI GetKeyboardState(_Out_writes_(256) PBYTE lpKeyState)
#define MAPVK_VSC_TO_VK
Definition: winuser.h:2356
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4316
#define SW_SHOW
Definition: winuser.h:775
int WINAPI GetSystemMetrics(_In_ int)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193

Referenced by OSK_Create(), OSK_Timer(), and OSK_WndProc().

◆ OSK_SetText()

void OSK_SetText ( int  IdDlgItem,
int  IdResource 
)

Definition at line 63 of file main.c.

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}

Referenced by OSK_SetKeys().

◆ OSK_Timer()

int OSK_Timer ( void  )

Definition at line 539 of file main.c.

540{
541 HWND hWndActiveWindow;
542 DWORD dwThread;
543 HKL hKeyboardLayout;
544
545 hWndActiveWindow = GetForegroundWindow();
546 if (hWndActiveWindow != NULL && hWndActiveWindow != Globals.hMainWnd)
547 {
548 /* Grab the current keyboard layout from the foreground window */
549 dwThread = GetWindowThreadProcessId(hWndActiveWindow, NULL);
550 hKeyboardLayout = GetKeyboardLayout(dwThread);
551 /* Activate the layout */
552 ActivateKeyboardLayout(hKeyboardLayout, 0);
553 }
554
555 /*
556 Update the LED key indicators accordingly to their state (if one
557 of the specific keys is held down).
558 */
560 /* Update the buttons */
562
563 return TRUE;
564}
VOID OSK_RefreshLEDKeys(VOID)
Definition: main.c:517
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT_PTR HKL
Definition: msctf.idl:143
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
HKL WINAPI ActivateKeyboardLayout(_In_ HKL, _In_ UINT)

Referenced by OSK_WndProc().

◆ OSK_WarningDlgThread()

DWORD WINAPI OSK_WarningDlgThread ( LPVOID  lpParameter)

Definition at line 124 of file main.c.

125{
126 HINSTANCE hInstance = (HINSTANCE)lpParameter;
127
129 return 0;
130}
HINSTANCE hInstance
Definition: charmap.c:19
HANDLE HINSTANCE
Definition: typedefs.h:77

Referenced by OSK_Create().

◆ OSK_WarningProc()

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

Definition at line 83 of file main.c.

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 {
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}
#define IDC_SHOWWARNINGCHECK
Definition: resource.h:25
struct @1644 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define LOWORD(l)
Definition: pedump.c:82
#define IDCANCEL
Definition: winuser.h:831
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by OSK_Create(), and OSK_WarningDlgThread().

◆ OSK_WndProc()

LRESULT APIENTRY OSK_WndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 792 of file main.c.

793{
794 switch (msg)
795 {
796 case WM_CREATE:
797 return OSK_Create(hwnd);
798
799 case WM_PAINT:
800 return OSK_Paint(hwnd);
801
802 case WM_TIMER:
803 return OSK_Timer();
804
807 {
808 if (GetKeyState(VK_NUMLOCK) & 0x0001)
810 else
812 }
814 {
815 if (GetKeyState(VK_CAPITAL) & 0x0001)
817 else
819 }
821 {
822 if (GetKeyState(VK_SCROLL) & 0x0001)
824 else
826 }
827 break;
828
829 case WM_COMMAND:
830 switch (LOWORD(wParam))
831 {
832 case IDM_EXIT:
833 {
834 PostMessageW(hwnd, WM_CLOSE, 0, 0);
835 break;
836 }
837
838 case IDM_ENHANCED_KB:
839 {
841 {
842 /*
843 The user attempted to switch to enhanced keyboard dialog type.
844 Set the member value as TRUE, destroy the dialog and save the data configuration into the registry.
845 */
847 SaveSettings();
848
849 /* Change the condition of enhanced keyboard item menu to checked */
852
853 /* Finally, update the key layout */
854 LoadSettings();
856 }
857
858 break;
859 }
860
861 case IDM_STANDARD_KB:
862 {
864 {
865 /*
866 The user attempted to switch to standard keyboard dialog type.
867 Set the member value as FALSE, destroy the dialog and save the data configuration into the registry.
868 */
870 SaveSettings();
871
872 /* Change the condition of standard keyboard item menu to checked */
875
876 /* Finally, update the key layout */
877 LoadSettings();
879 }
880
881 break;
882 }
883
884 case IDM_CLICK_SOUND:
885 {
886 /*
887 This case is triggered when the user attempts to click on the menu item. Before doing anything,
888 we must check the condition state of such menu item so that we can tick/untick the menu item accordingly.
889 */
890 if (!Globals.bSoundClick)
891 {
894 }
895 else
896 {
899 }
900
901 break;
902 }
903
904 case IDM_ON_TOP:
905 {
906 /*
907 Check the condition state before disabling/enabling the menu
908 item and change the topmost order.
909 */
911 {
915 }
916 else
917 {
921 }
922
923 break;
924 }
925
926 case IDM_FONT:
927 {
929 break;
930 }
931
932 case IDM_ABOUT:
933 {
934 OSK_About();
935 break;
936 }
937
938 default:
940 break;
941 }
942 return 0;
943
944 case WM_THEMECHANGED:
945 /* Redraw the dialog (and its control buttons) using the new theme */
947 return 0;
948
949 case WM_CLOSE:
950 OSK_Close();
952 return 0;
953 }
955}
#define msg(x)
Definition: auth_time.c:54
void LoadSettings(void)
Definition: settings.c:53
#define IDM_ABOUT
Definition: resource.h:29
#define IDM_EXIT
Definition: resource.h:27
VOID OSK_ChooseFont(VOID)
Definition: main.c:572
LRESULT OSK_Create(HWND hwnd)
Definition: main.c:367
BOOL OSK_Command(WPARAM wCommand, HWND hWndControl)
Definition: main.c:614
LRESULT OSK_Paint(HWND hwnd)
Definition: main.c:751
VOID OSK_About(VOID)
Definition: main.c:138
int OSK_Timer(void)
Definition: main.c:539
int OSK_Close(void)
Definition: main.c:485
#define IDM_FONT
Definition: osk_res.h:43
LONG_PTR LRESULT
Definition: windef.h:209
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:896
#define WM_PAINT
Definition: winuser.h:1620
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1772
#define WM_CLOSE
Definition: winuser.h:1621
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1608
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define VK_CAPITAL
Definition: winuser.h:2206
#define VK_SCROLL
Definition: winuser.h:2280
#define WM_TIMER
Definition: winuser.h:1742
#define VK_NUMLOCK
Definition: winuser.h:2279
SHORT WINAPI GetKeyState(_In_ int)

Referenced by wWinMain().

◆ wWinMain()

int WINAPI wWinMain ( HINSTANCE  hInstance,
HINSTANCE  hPrevInstance,
LPWSTR  lpCmdLine,
int  nShowCmd 
)

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Definition at line 961 of file main.c.

965{
966 DWORD dwError;
969 WNDCLASSEXW wc = {0};
970 MSG msg;
971 HWND hwnd;
972
976
977 /*
978 Obtain a mutex for the program. This will ensure that
979 the program is launched only once.
980 */
981 hMutex = CreateMutexW(NULL, FALSE, L"OSKRunning");
982
983 if (hMutex)
984 {
985 /* Check if there's already a mutex for the program */
986 dwError = GetLastError();
987
988 if (dwError == ERROR_ALREADY_EXISTS)
989 {
990 /*
991 A mutex with the object name has been created previously.
992 Therefore, another instance is already running.
993 */
994 DPRINT("wWinMain(): Failed to create a mutex! The program instance is already running.\n");
996 return 0;
997 }
998 }
999
1000 /* Load the common controls */
1001 iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1003 InitCommonControlsEx(&iccex);
1004
1005 ZeroMemory(&Globals, sizeof(Globals));
1007
1008 /* Load the application's settings from the registry */
1009 LoadSettings();
1010
1011 /* Define the window class */
1012 wc.cbSize = sizeof(wc);
1018 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1019 /* Set the application's icon */
1022
1023 if (!RegisterClassExW(&wc))
1024 goto quit;
1025
1026 /* Load window title */
1028
1030 OSK_CLASS,
1037 NULL,
1038 NULL,
1040 NULL);
1041
1042 if (!hwnd)
1043 goto quit;
1044
1047
1048 while (GetMessageW(&msg, NULL, 0, 0))
1049 {
1052 }
1053
1054quit:
1055 /* Delete the mutex */
1056 if (hMutex)
1057 {
1059 }
1060
1061 return 0;
1062}
void quit(int argc, const char *argv[])
Definition: cmds.c:1606
LRESULT APIENTRY OSK_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: main.c:792
#define OSK_CLASS
Definition: precomp.h:124
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define CloseHandle
Definition: compat.h:739
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
HANDLE hMutex
Definition: mutex.c:11
#define IDR_OSK_MENU
Definition: osk_res.h:31
#define IDS_OSK
Definition: osk_res.h:49
#define WS_SYSMENU
Definition: pedump.c:629
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_MINIMIZEBOX
Definition: pedump.c:631
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_STANDARD_CLASSES
Definition: commctrl.h:73
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
TCHAR * cmdline
Definition: stretchblt.cpp:32
LPCWSTR lpszClassName
Definition: winuser.h:3226
LPCWSTR lpszMenuName
Definition: winuser.h:3225
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
HICON hIconSm
Definition: winuser.h:3227
HINSTANCE hInstance
Definition: winuser.h:3221
UINT style
Definition: winuser.h:3217
HICON hIcon
Definition: winuser.h:3222
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:576
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define ZeroMemory
Definition: winbase.h:1712
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define CS_VREDRAW
Definition: winuser.h:658
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:918
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define LR_COPYFROMRESOURCE
Definition: winuser.h:1099
#define CS_HREDRAW
Definition: winuser.h:653
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
#define SM_CYSMICON
Definition: winuser.h:1013
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2024
#define SM_CXSMICON
Definition: winuser.h:1012
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)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Variable Documentation

◆ Globals

OSK_GLOBALS Globals

Definition at line 16 of file main.c.

◆ LedKey

Initial value:

Definition at line 18 of file main.c.

Referenced by OSK_Command(), OSK_DestroyKeys(), and OSK_RefreshLEDKeys().