ReactOS 0.4.15-dev-6054-gbddd8b0
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 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}
OSK_GLOBALS Globals
Definition: main.c:16
#define MAX_PATH
Definition: compat.h:34
static HICON
Definition: imagelist.c:84
#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:68
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:2172
#define LR_DEFAULTSIZE
Definition: winuser.h:1088
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2022
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by OSK_WndProc().

◆ OSK_ChooseFont()

VOID OSK_ChooseFont ( VOID  )

Definition at line 577 of file main.c.

578{
579 LOGFONTW lf = {0};
580 CHOOSEFONTW cf = {0};
581 HFONT hFont, hOldFont;
582 int i;
583
586
587 cf.lStructSize = sizeof(cf);
588 cf.hwndOwner = Globals.hMainWnd;
589 cf.lpLogFont = &lf;
591
592 if (!ChooseFontW(&cf))
593 return;
594
596
597 if (!hFont)
598 return;
599
600 /* Set font information */
603
604 hOldFont = Globals.hFont;
606
607 for (i = 0; i < Globals.Keyboard->KeyCount; i++)
609
610 DeleteObject(hOldFont);
611}
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:1640
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by OSK_WndProc().

◆ OSK_Close()

int OSK_Close ( void  )

Definition at line 490 of file main.c.

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 */
504
505 /* delete GDI objects */
508
509 /* Save the application's settings on registry */
510 SaveSettings();
511
512 return TRUE;
513}
void SaveSettings(void)
Definition: settings.c:115
VOID OSK_DestroyKeys(VOID)
Definition: main.c:162
BOOL OSK_ReleaseKey(WORD ScanCode)
Definition: main.c:715
#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 619 of file main.c.

620{
622 INPUT Input;
623 BOOL bExtendedKey;
624 BOOL bKeyDown;
625 BOOL bKeyUp;
626 LONG WindowStyle;
627 INT i;
628
629 /* KeyDown and/or KeyUp ? */
630 WindowStyle = GetWindowLongW(hWndControl, GWL_STYLE);
631 if ((WindowStyle & BS_AUTOCHECKBOX) == BS_AUTOCHECKBOX)
632 {
633 /* 2-states key like Shift, Alt, Ctrl, ... */
634 if (SendMessageW(hWndControl, BM_GETCHECK, 0, 0) == BST_CHECKED)
635 {
636 bKeyDown = TRUE;
637 bKeyUp = FALSE;
638 }
639 else
640 {
641 bKeyDown = FALSE;
642 bKeyUp = TRUE;
643 }
644 }
645 else
646 {
647 /* Other key */
648 bKeyDown = TRUE;
649 bKeyUp = TRUE;
650 }
651
652 /* Get the key from dialog control key command */
653 ScanCode = wCommand;
654
655 /*
656 The user could've pushed one of the key buttons of the dialog that
657 can trigger particular function toggling (Caps Lock, Num Lock or Scroll Lock). Update
658 (invalidate) the LED icon resources accordingly.
659 */
660 for (i = 0; i < _countof(LedKey); i++)
661 {
662 if (LedKey[i].wScanCode == ScanCode)
663 {
665 }
666 }
667
668 /* Extended key ? */
669 if (ScanCode & 0x0200)
670 bExtendedKey = TRUE;
671 else
672 bExtendedKey = FALSE;
674
675 /* Press and release the key */
676 if (bKeyDown)
677 {
678 Input.type = INPUT_KEYBOARD;
679 Input.ki.wVk = 0;
680 Input.ki.wScan = ScanCode;
681 Input.ki.time = GetTickCount();
682 Input.ki.dwExtraInfo = GetMessageExtraInfo();
683 Input.ki.dwFlags = KEYEVENTF_SCANCODE;
684 if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
685 SendInput(1, &Input, sizeof(Input));
686 }
687
688 if (bKeyUp)
689 {
690 Input.type = INPUT_KEYBOARD;
691 Input.ki.wVk = 0;
692 Input.ki.wScan = ScanCode;
693 Input.ki.time = GetTickCount();
694 Input.ki.dwExtraInfo = GetMessageExtraInfo();
695 Input.ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
696 if (bExtendedKey) Input.ki.dwFlags |= KEYEVENTF_EXTENDEDKEY;
697 SendInput(1, &Input, sizeof(Input));
698 }
699
700 /* Play the sound during clicking event (only if "Use Click Sound" menu option is ticked) */
702 {
704 }
705
706 return TRUE;
707}
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:636
@ 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:3698
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define KEYEVENTF_EXTENDEDKEY
Definition: winuser.h:1095
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:846
LPARAM WINAPI GetMessageExtraInfo(void)
Definition: message.c:1340
#define KEYEVENTF_KEYUP
Definition: winuser.h:1096
#define BST_CHECKED
Definition: winuser.h:197
#define BM_GETCHECK
Definition: winuser.h:1908

Referenced by OSK_WndProc().

◆ OSK_Create()

LRESULT OSK_Create ( HWND  hwnd)

Definition at line 372 of file main.c.

373{
374 HMONITOR monitor;
376 POINT Pt;
377 RECT rcWindow, rcDlgIntersect;
378 LOGFONTW lf = {0};
379
380 /* Save handle */
382
383 /* Init Font */
387
388 if (OSK_SetKeys(SETKEYS_INIT) == -1)
389 return -1;
390
391 /* Check the checked menu item before displaying the window */
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) */
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 */
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 */
455 {
458 }
459 else
460 {
463 }
464
465 /* Create a green brush for leds */
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 */
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}
DWORD WINAPI OSK_WarningDlgThread(LPVOID lpParameter)
Definition: main.c:124
LRESULT OSK_SetKeys(int reason)
Definition: main.c:188
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:62
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:1198
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:4389
#define MF_CHECKED
Definition: winuser.h:132
#define SWP_NOSIZE
Definition: winuser.h:1235
#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:1196
HMENU WINAPI GetMenu(_In_ HWND)

Referenced by OSK_WndProc().

◆ OSK_DestroyKeys()

VOID OSK_DestroyKeys ( VOID  )

Definition at line 162 of file main.c.

163{
164 int i;
165 /* Hide before destroying child controls */
167
168 for (i = 0; i < Globals.Keyboard->KeyCount; i++)
169 {
171 }
172 for (i = 0; i < _countof(LedKey); i++)
173 {
175 }
176
180}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
#define SW_HIDE
Definition: winuser.h:762
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 756 of file main.c.

757{
758 PAINTSTRUCT ps;
759 RECT rcText;
760 HFONT hOldFont = NULL;
761 WCHAR szTemp[MAX_PATH];
762
763 HDC hdc = BeginPaint(hwnd, &ps);
764
765 if (Globals.hFont)
766 hOldFont = SelectObject(hdc, Globals.hFont);
767
770 rcText.right = rcText.left + Globals.Keyboard->LedTextSize.cx;
771 rcText.bottom = rcText.top + Globals.Keyboard->LedTextSize.cy;
772
774 DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
775
777
779 DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
780
782
784 DrawTextW(hdc, szTemp, -1, &rcText, DT_NOCLIP);
785
786 if (hOldFont)
787 SelectObject(hdc, hOldFont);
788
789 EndPaint(hwnd, &ps);
790
791 return 0;
792}
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:1539
#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 522 of file main.c.

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}
SHORT WINAPI GetAsyncKeyState(_In_ int)

Referenced by OSK_Timer().

◆ OSK_ReleaseKey()

BOOL OSK_ReleaseKey ( WORD  ScanCode)

Definition at line 715 of file main.c.

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

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}
HICON hIcon
Definition: msconfig.c:44
LONG_PTR LPARAM
Definition: windef.h:208
#define BM_SETIMAGE
Definition: winuser.h:1912
#define LR_DEFAULTCOLOR
Definition: winuser.h:1081

Referenced by OSK_SetKeys().

◆ OSK_SetKeys()

LRESULT OSK_SetKeys ( int  reason)

Definition at line 188 of file main.c.

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 */
240 }
241 /* Fallthrough */
242 case SETKEYS_INIT:
243 {
245 {
247 }
248 else
249 {
251 }
252
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 */
297 0,
298 0,
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}
#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:60
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:71
POINT LedStart
Definition: precomp.h:45
Definition: precomp.h:26
LPCWSTR name
Definition: precomp.h:27
#define SM_CYSIZE
Definition: winuser.h:986
#define SWP_NOMOVE
Definition: winuser.h:1234
#define SS_NOTIFY
Definition: winuser.h:351
#define SM_CYMENU
Definition: winuser.h:970
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:2346
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:4306
#define SW_SHOW
Definition: winuser.h:769
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 544 of file main.c.

545{
546 HWND hWndActiveWindow;
547 DWORD dwThread;
548 HKL hKeyboardLayout;
549
550 hWndActiveWindow = GetForegroundWindow();
551 if (hWndActiveWindow != NULL && hWndActiveWindow != Globals.hMainWnd)
552 {
553 /* Grab the current keyboard layout from the foreground window */
554 dwThread = GetWindowThreadProcessId(hWndActiveWindow, NULL);
555 hKeyboardLayout = GetKeyboardLayout(dwThread);
556 /* Activate the layout */
557 ActivateKeyboardLayout(hKeyboardLayout, 0);
558 }
559
560 /*
561 Update the LED key indicators accordingly to their state (if one
562 of the specific keys is held down).
563 */
565 /* Update the buttons */
567
568 return TRUE;
569}
VOID OSK_RefreshLEDKeys(VOID)
Definition: main.c:522
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT_PTR HKL
Definition: msctf.idl:104
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
WPARAM wParam
Definition: combotst.c:138
struct @1609 Msg[]
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:825
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
#define IDOK
Definition: winuser.h:824
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 797 of file main.c.

798{
799 switch (msg)
800 {
801 case WM_CREATE:
802 return OSK_Create(hwnd);
803
804 case WM_PAINT:
805 return OSK_Paint(hwnd);
806
807 case WM_TIMER:
808 return OSK_Timer();
809
812 {
813 if (GetKeyState(VK_NUMLOCK) & 0x0001)
815 else
817 }
819 {
820 if (GetKeyState(VK_CAPITAL) & 0x0001)
822 else
824 }
826 {
827 if (GetKeyState(VK_SCROLL) & 0x0001)
829 else
831 }
832 break;
833
834 case WM_COMMAND:
835 switch (LOWORD(wParam))
836 {
837 case IDM_EXIT:
838 {
839 PostMessageW(hwnd, WM_CLOSE, 0, 0);
840 break;
841 }
842
843 case IDM_ENHANCED_KB:
844 {
846 {
847 /*
848 The user attempted to switch to enhanced keyboard dialog type.
849 Set the member value as TRUE, destroy the dialog and save the data configuration into the registry.
850 */
852 SaveSettings();
853
854 /* Change the condition of enhanced keyboard item menu to checked */
857
858 /* Finally, update the key layout */
859 LoadSettings();
861 }
862
863 break;
864 }
865
866 case IDM_STANDARD_KB:
867 {
869 {
870 /*
871 The user attempted to switch to standard keyboard dialog type.
872 Set the member value as FALSE, destroy the dialog and save the data configuration into the registry.
873 */
875 SaveSettings();
876
877 /* Change the condition of standard keyboard item menu to checked */
880
881 /* Finally, update the key layout */
882 LoadSettings();
884 }
885
886 break;
887 }
888
889 case IDM_CLICK_SOUND:
890 {
891 /*
892 This case is triggered when the user attempts to click on the menu item. Before doing anything,
893 we must check the condition state of such menu item so that we can tick/untick the menu item accordingly.
894 */
895 if (!Globals.bSoundClick)
896 {
899 }
900 else
901 {
904 }
905
906 break;
907 }
908
909 case IDM_ON_TOP:
910 {
911 /*
912 Check the condition state before disabling/enabling the menu
913 item and change the topmost order.
914 */
916 {
920 }
921 else
922 {
926 }
927
928 break;
929 }
930
931 case IDM_FONT:
932 {
934 break;
935 }
936
937 case IDM_ABOUT:
938 {
939 OSK_About();
940 break;
941 }
942
943 default:
945 break;
946 }
947 return 0;
948
949 case WM_THEMECHANGED:
950 /* Redraw the dialog (and its control buttons) using the new theme */
952 return 0;
953
954 case WM_CLOSE:
955 OSK_Close();
957 return 0;
958 }
960}
#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:577
LRESULT OSK_Create(HWND hwnd)
Definition: main.c:372
BOOL OSK_Command(WPARAM wCommand, HWND hWndControl)
Definition: main.c:619
LRESULT OSK_Paint(HWND hwnd)
Definition: main.c:756
VOID OSK_About(VOID)
Definition: main.c:138
int OSK_Timer(void)
Definition: main.c:544
int OSK_Close(void)
Definition: main.c:490
#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:1610
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define WM_CLOSE
Definition: winuser.h:1611
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:1598
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define VK_CAPITAL
Definition: winuser.h:2196
#define VK_SCROLL
Definition: winuser.h:2270
#define WM_TIMER
Definition: winuser.h:1732
#define VK_NUMLOCK
Definition: winuser.h:2269
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 966 of file main.c.

970{
971 DWORD dwError;
974 WNDCLASSEXW wc = {0};
975 MSG msg;
976 HWND hwnd;
977
981
982 /*
983 Obtain a mutex for the program. This will ensure that
984 the program is launched only once.
985 */
986 hMutex = CreateMutexW(NULL, FALSE, L"OSKRunning");
987
988 if (hMutex)
989 {
990 /* Check if there's already a mutex for the program */
991 dwError = GetLastError();
992
993 if (dwError == ERROR_ALREADY_EXISTS)
994 {
995 /*
996 A mutex with the object name has been created previously.
997 Therefore, another instance is already running.
998 */
999 DPRINT("wWinMain(): Failed to create a mutex! The program instance is already running.\n");
1001 return 0;
1002 }
1003 }
1004
1005 /* Load the common controls */
1006 iccex.dwSize = sizeof(INITCOMMONCONTROLSEX);
1008 InitCommonControlsEx(&iccex);
1009
1010 ZeroMemory(&Globals, sizeof(Globals));
1012
1013 /* Load the application's settings from the registry */
1014 LoadSettings();
1015
1016 /* Define the window class */
1017 wc.cbSize = sizeof(wc);
1023 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1024 /* Set the application's icon */
1027
1028 if (!RegisterClassExW(&wc))
1029 goto quit;
1030
1031 /* Load window title */
1033
1035 OSK_CLASS,
1042 NULL,
1043 NULL,
1045 NULL);
1046
1047 if (!hwnd)
1048 goto quit;
1049
1052
1053 while (GetMessageW(&msg, NULL, 0, 0))
1054 {
1057 }
1058
1059quit:
1060 /* Delete the mutex */
1061 if (hMutex)
1062 {
1064 }
1065
1066 return 0;
1067}
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:797
#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:3216
LPCWSTR lpszMenuName
Definition: winuser.h:3215
HBRUSH hbrBackground
Definition: winuser.h:3214
WNDPROC lpfnWndProc
Definition: winuser.h:3208
UINT cbSize
Definition: winuser.h:3206
HICON hIconSm
Definition: winuser.h:3217
HINSTANCE hInstance
Definition: winuser.h:3211
UINT style
Definition: winuser.h:3207
HICON hIcon
Definition: winuser.h:3212
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:1670
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define CS_VREDRAW
Definition: winuser.h:653
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:912
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:1093
#define CS_HREDRAW
Definition: winuser.h:648
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
#define SM_CYSMICON
Definition: winuser.h:1007
HANDLE WINAPI CopyImage(_In_ HANDLE, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:1956
#define SM_CXSMICON
Definition: winuser.h:1006
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 *)
#define LR_SHARED
Definition: winuser.h:1094
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().