Esempio n. 1
0
INT_PTR CALLBACK
InputLangPropDlgProc(HWND hDlg,
               UINT message,
               WPARAM wParam,
               LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);

    switch (message)
    {
        case WM_INITDIALOG:
            CreateKeyboardLayoutList(GetDlgItem(hDlg, IDC_KB_LAYOUT_IME_COMBO));
            InitInputLangPropDlg(hDlg);
            break;

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDOK:
                    SaveInputLang(hDlg);
                    UpdateLayoutsList();
                    EndDialog(hDlg,LOWORD(wParam));
                    break;

                case IDCANCEL:
                    EndDialog(hDlg,LOWORD(wParam));
                    break;
            }
            break;
    }

    return FALSE;
}
Esempio n. 2
0
File: add.c Progetto: jmalak/reactos
INT_PTR CALLBACK
AddDlgProc(HWND hDlg,
           UINT message,
           WPARAM wParam,
           LPARAM lParam)
{
    UNREFERENCED_PARAMETER(lParam);

    switch (message)
    {
        case WM_INITDIALOG:
        {
            hLangList = GetDlgItem(hDlg, IDC_INPUT_LANG_COMBO);
            hLayoutList = GetDlgItem(hDlg, IDC_KEYBOARD_LO_COMBO);
            EnumSystemLocales(LanguagesEnumProc, LCID_INSTALLED);
            CreateKeyboardLayoutList(hLayoutList);
        }
        break;

        case WM_COMMAND:
        {
            switch (LOWORD(wParam))
            {
                case IDC_INPUT_LANG_COMBO:
                {
                    if (HIWORD(wParam) == CBN_SELCHANGE)
                    {
                        SelectLayoutByLang();
                    }
                }
                break;

                case IDOK:
                {
                    AddNewLayout(hDlg);
                    EndDialog(hDlg, LOWORD(wParam));
                }
                break;

                case IDCANCEL:
                {
                    EndDialog(hDlg, LOWORD(wParam));
                }
            }
        }
        break;

        case WM_DESTROY:
        {
            INT iCount;

            for(iCount = SendMessage(hLayoutList, CB_GETCOUNT, 0, 0); --iCount >= 0;)
                HeapFree(hProcessHeap, 0, (LPVOID)SendMessage(hLayoutList, CB_GETITEMDATA, iCount, 0));
        }
        break;
    }

    return FALSE;
}