mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
[KBDLAYOUT] Avoid (DLGPROC) cast (#5698)
- Avoid DLGPROC-cast - Bring header-section closer to our coding guidelines - Strip inconsistent empty-lines - Strip useless return at the end of void func Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
This commit is contained in:
parent
1da71e2519
commit
0eecebb1cc
1 changed files with 9 additions and 31 deletions
|
@ -1,9 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* PROJECT: ReactOS
|
* PROJECT: ReactOS
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
* FILE: base/applications/testset/user32/kbdlayout/kbdlayout.c
|
* PURPOSE: Keyboard layout testapp
|
||||||
* PURPOSE: Keyboard layout testapp
|
* COPYRIGHT: Copyright 2007 Saveliy Tretiakov
|
||||||
* COPYRIGHT: Copyright 2007 Saveliy Tretiakov
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define UNICODE
|
#define UNICODE
|
||||||
|
@ -13,7 +12,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LRESULT MainDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
|
INT_PTR CALLBACK MainDialogProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
|
|
||||||
HINSTANCE hInst;
|
HINSTANCE hInst;
|
||||||
|
@ -27,11 +26,10 @@ typedef struct {
|
||||||
|
|
||||||
DWORD WINAPI ThreadProc(LPVOID lpParam)
|
DWORD WINAPI ThreadProc(LPVOID lpParam)
|
||||||
{
|
{
|
||||||
|
|
||||||
DialogBoxParam(hInst,
|
DialogBoxParam(hInst,
|
||||||
MAKEINTRESOURCE(IDD_MAINDIALOG),
|
MAKEINTRESOURCE(IDD_MAINDIALOG),
|
||||||
NULL,
|
NULL,
|
||||||
(DLGPROC)MainDialogProc,
|
MainDialogProc,
|
||||||
(LPARAM)NULL);
|
(LPARAM)NULL);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -42,8 +40,6 @@ INT WINAPI WinMain(HINSTANCE hInstance,
|
||||||
LPSTR lpCmdLine,
|
LPSTR lpCmdLine,
|
||||||
int nCmdShow)
|
int nCmdShow)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
hInst = hInstance;
|
hInst = hInstance;
|
||||||
|
|
||||||
ThreadProc(0);
|
ThreadProc(0);
|
||||||
|
@ -51,7 +47,6 @@ INT WINAPI WinMain(HINSTANCE hInstance,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GetKlList(HKL **list)
|
int GetKlList(HKL **list)
|
||||||
{
|
{
|
||||||
HKL *ret;
|
HKL *ret;
|
||||||
|
@ -69,7 +64,6 @@ void FreeKlList(HKL *list)
|
||||||
HeapFree(GetProcessHeap(), 0, list);
|
HeapFree(GetProcessHeap(), 0, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UpdateData(HWND hDlg)
|
void UpdateData(HWND hDlg)
|
||||||
{
|
{
|
||||||
WCHAR buf[KL_NAMELENGTH];
|
WCHAR buf[KL_NAMELENGTH];
|
||||||
|
@ -119,8 +113,7 @@ void FormatBox(HWND hWnd, DWORD Flags, WCHAR *Caption, WCHAR *Format, ...)
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LRESULT CALLBACK WndSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
WND_DATA *data = (WND_DATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
WND_DATA *data = (WND_DATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
|
||||||
|
|
||||||
|
@ -137,7 +130,7 @@ LRESULT CALLBACK WndSubclassProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
||||||
//Pass message to defwindowproc
|
//Pass message to defwindowproc
|
||||||
}
|
}
|
||||||
|
|
||||||
return ( CallWindowProc( data->OrigProc, hwnd, uMsg, wParam, lParam) );
|
return CallWindowProc(data->OrigProc, hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SubclassWnd(HWND hWnd, WCHAR* Name)
|
void SubclassWnd(HWND hWnd, WCHAR* Name)
|
||||||
|
@ -146,7 +139,6 @@ void SubclassWnd(HWND hWnd, WCHAR* Name)
|
||||||
data->OrigProc = (WNDPROC)SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR)WndSubclassProc);
|
data->OrigProc = (WNDPROC)SetWindowLongPtr( hWnd, GWLP_WNDPROC, (LONG_PTR)WndSubclassProc);
|
||||||
wcsncpy(data->WndName, Name, 25);
|
wcsncpy(data->WndName, Name, 25);
|
||||||
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)data);
|
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)data);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD GetActivateFlags(HWND hDlg)
|
DWORD GetActivateFlags(HWND hDlg)
|
||||||
|
@ -166,7 +158,6 @@ DWORD GetActivateFlags(HWND hDlg)
|
||||||
ret |= KLF_SETFORPROCESS;
|
ret |= KLF_SETFORPROCESS;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD GetLoadFlags(HWND hDlg)
|
DWORD GetLoadFlags(HWND hDlg)
|
||||||
|
@ -218,22 +209,15 @@ HKL GetSelectedLayout(HWND hDlg)
|
||||||
|
|
||||||
HKL GetActivateHandle(HWND hDlg)
|
HKL GetActivateHandle(HWND hDlg)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(IsDlgButtonChecked(hDlg, IDC_FROMLIST))
|
if(IsDlgButtonChecked(hDlg, IDC_FROMLIST))
|
||||||
return GetSelectedLayout(hDlg);
|
return GetSelectedLayout(hDlg);
|
||||||
else if(IsDlgButtonChecked(hDlg, IDC_HKL_NEXT))
|
else if(IsDlgButtonChecked(hDlg, IDC_HKL_NEXT))
|
||||||
return (HKL)HKL_NEXT;
|
return (HKL)HKL_NEXT;
|
||||||
|
|
||||||
return (HKL)HKL_PREV;
|
return (HKL)HKL_PREV;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT_PTR CALLBACK MainDialogProc(HWND hDlg,
|
||||||
/***************************************************
|
|
||||||
* MainDialogProc *
|
|
||||||
***************************************************/
|
|
||||||
|
|
||||||
LRESULT MainDialogProc(HWND hDlg,
|
|
||||||
UINT Msg,
|
UINT Msg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
|
@ -350,13 +334,11 @@ LRESULT MainDialogProc(HWND hDlg,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} /* WM_COMMAND */
|
} /* WM_COMMAND */
|
||||||
|
|
||||||
|
|
||||||
case WM_INPUTLANGCHANGE:
|
case WM_INPUTLANGCHANGE:
|
||||||
{
|
{
|
||||||
FormatMsg(L"dlg WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", lParam, wParam);
|
FormatMsg(L"dlg WM_INPUTLANGCHANGE lParam=%x wParam=%x\n", lParam, wParam);
|
||||||
|
@ -379,9 +361,5 @@ LRESULT MainDialogProc(HWND hDlg,
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue