mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:22:58 +00:00
Update testapp
svn path=/trunk/; revision=25924
This commit is contained in:
parent
9eea1f6b20
commit
93f907207b
3 changed files with 25 additions and 4 deletions
|
@ -80,7 +80,7 @@ void UpdateData(HWND hDlg)
|
||||||
int n, i,j;
|
int n, i,j;
|
||||||
|
|
||||||
GetKeyboardLayoutName(buf);
|
GetKeyboardLayoutName(buf);
|
||||||
swprintf(buf2, L"Active layout: %s (%x)", buf, GetKeyboardLayout(0));
|
swprintf(buf2, L"Active: %s (%x)", buf, GetKeyboardLayout(0));
|
||||||
SetWindowText(GetDlgItem(hDlg, IDC_ACTIVE), buf2);
|
SetWindowText(GetDlgItem(hDlg, IDC_ACTIVE), buf2);
|
||||||
|
|
||||||
hList = GetDlgItem(hDlg, IDC_LIST);
|
hList = GetDlgItem(hDlg, IDC_LIST);
|
||||||
|
@ -194,6 +194,18 @@ DWORD GetLoadFlags(HWND hDlg)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT GetDelayMilliseconds(HWND hDlg)
|
||||||
|
{
|
||||||
|
WCHAR Buf[255];
|
||||||
|
UINT ret;
|
||||||
|
|
||||||
|
GetWindowText(GetDlgItem(hDlg, IDC_DELAY), Buf, sizeof(Buf));
|
||||||
|
|
||||||
|
swscanf(Buf, L"%d", &ret);
|
||||||
|
|
||||||
|
return ret*1000;
|
||||||
|
}
|
||||||
|
|
||||||
HKL GetSelectedLayout(HWND hDlg)
|
HKL GetSelectedLayout(HWND hDlg)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -251,6 +263,8 @@ LRESULT MainDialogProc(HWND hDlg,
|
||||||
swprintf(Buf, L"Current thread id: %d", GetCurrentThreadId());
|
swprintf(Buf, L"Current thread id: %d", GetCurrentThreadId());
|
||||||
SetWindowText(GetDlgItem(hDlg, IDC_CURTHREAD), Buf);
|
SetWindowText(GetDlgItem(hDlg, IDC_CURTHREAD), Buf);
|
||||||
|
|
||||||
|
SetWindowText(GetDlgItem(hDlg, IDC_DELAY), L"0");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} /* WM_INITDIALOG */
|
} /* WM_INITDIALOG */
|
||||||
|
|
||||||
|
@ -268,6 +282,7 @@ LRESULT MainDialogProc(HWND hDlg,
|
||||||
{
|
{
|
||||||
if((hKl = GetActivateHandle(hDlg)) != INVALID_HANDLE_VALUE)
|
if((hKl = GetActivateHandle(hDlg)) != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
Sleep(GetDelayMilliseconds(hDlg));
|
||||||
if(!(hKl = ActivateKeyboardLayout(hKl, GetActivateFlags(hDlg))))
|
if(!(hKl = ActivateKeyboardLayout(hKl, GetActivateFlags(hDlg))))
|
||||||
FormatBox(hDlg, MB_ICONERROR, L"Error",
|
FormatBox(hDlg, MB_ICONERROR, L"Error",
|
||||||
L"ActivateKeyboardLayout() failed. %d", GetLastError());
|
L"ActivateKeyboardLayout() failed. %d", GetLastError());
|
||||||
|
@ -283,6 +298,7 @@ LRESULT MainDialogProc(HWND hDlg,
|
||||||
{
|
{
|
||||||
if((hKl = GetSelectedLayout(hDlg)) != INVALID_HANDLE_VALUE)
|
if((hKl = GetSelectedLayout(hDlg)) != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
|
Sleep(GetDelayMilliseconds(hDlg));
|
||||||
if(!UnloadKeyboardLayout(hKl))
|
if(!UnloadKeyboardLayout(hKl))
|
||||||
FormatBox(hDlg, MB_ICONERROR, L"Error",
|
FormatBox(hDlg, MB_ICONERROR, L"Error",
|
||||||
L"UnloadKeyboardLayout() failed. %d",
|
L"UnloadKeyboardLayout() failed. %d",
|
||||||
|
@ -297,6 +313,7 @@ LRESULT MainDialogProc(HWND hDlg,
|
||||||
{
|
{
|
||||||
WCHAR buf[255];
|
WCHAR buf[255];
|
||||||
GetWindowText(GetDlgItem(hDlg, IDC_KLID), buf, sizeof(buf));
|
GetWindowText(GetDlgItem(hDlg, IDC_KLID), buf, sizeof(buf));
|
||||||
|
Sleep(GetDelayMilliseconds(hDlg));
|
||||||
if(!LoadKeyboardLayout(buf, GetLoadFlags(hDlg)))
|
if(!LoadKeyboardLayout(buf, GetLoadFlags(hDlg)))
|
||||||
FormatBox(hDlg, MB_ICONERROR, L"Error",
|
FormatBox(hDlg, MB_ICONERROR, L"Error",
|
||||||
L"LoadKeyboardLayout() failed. %d",
|
L"LoadKeyboardLayout() failed. %d",
|
||||||
|
|
|
@ -33,10 +33,10 @@ FONT 8, "MS Sans Serif"
|
||||||
BEGIN
|
BEGIN
|
||||||
PUSHBUTTON "Close",ID_CANCEL,215,172,105,14
|
PUSHBUTTON "Close",ID_CANCEL,215,172,105,14
|
||||||
EDITTEXT IDC_EDIT1,7,140,199,47,ES_MULTILINE | ES_AUTOHSCROLL
|
EDITTEXT IDC_EDIT1,7,140,199,47,ES_MULTILINE | ES_AUTOHSCROLL
|
||||||
LISTBOX IDC_LIST,124,17,84,89,LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
LISTBOX IDC_LIST,124,60,84,46,LBS_NOINTEGRALHEIGHT | WS_VSCROLL |
|
||||||
WS_TABSTOP
|
WS_TABSTOP
|
||||||
LTEXT "Loaded layouts",IDC_STATIC,128,7,49,8
|
LTEXT "Loaded layouts",IDC_STATIC,124,50,49,8
|
||||||
LTEXT "Active layout:",IDC_ACTIVE,7,127,114,10,SS_SUNKEN
|
LTEXT "Active:",IDC_ACTIVE,7,127,114,10,SS_SUNKEN
|
||||||
PUSHBUTTON "Unload",IDC_UNLOAD,124,109,41,14
|
PUSHBUTTON "Unload",IDC_UNLOAD,124,109,41,14
|
||||||
PUSHBUTTON "Activate",IDC_ACTIVATE,166,109,41,14
|
PUSHBUTTON "Activate",IDC_ACTIVATE,166,109,41,14
|
||||||
GROUPBOX "Activate Flags",IDC_STATIC,215,7,103,67
|
GROUPBOX "Activate Flags",IDC_STATIC,215,7,103,67
|
||||||
|
@ -75,6 +75,9 @@ BEGIN
|
||||||
GROUPBOX "Multithreading",IDC_STATIC,216,130,104,39
|
GROUPBOX "Multithreading",IDC_STATIC,216,130,104,39
|
||||||
LTEXT "Current thread ID:",IDC_CURTHREAD,219,141,93,8
|
LTEXT "Current thread ID:",IDC_CURTHREAD,219,141,93,8
|
||||||
PUSHBUTTON "Create new thread",IDC_NEWTHREAD,234,152,71,12
|
PUSHBUTTON "Create new thread",IDC_NEWTHREAD,234,152,71,12
|
||||||
|
GROUPBOX "Load\\Activate delay",IDC_STATIC,124,7,85,40
|
||||||
|
LTEXT "Delay (seconds):",IDC_STATIC,130,17,75,8
|
||||||
|
EDITTEXT IDC_DELAY,128,29,59,14,ES_AUTOHSCROLL
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#define IDC_LIST 1022
|
#define IDC_LIST 1022
|
||||||
#define IDC_ACTIVE 1023
|
#define IDC_ACTIVE 1023
|
||||||
#define IDC_EDIT2 1024
|
#define IDC_EDIT2 1024
|
||||||
|
#define IDC_DELAY 1024
|
||||||
#define IDC_UNLOAD 1025
|
#define IDC_UNLOAD 1025
|
||||||
#define IDC_ACTIVATE 1026
|
#define IDC_ACTIVATE 1026
|
||||||
#define IDC_KLF_REORDER 1027
|
#define IDC_KLF_REORDER 1027
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue