這是下一個我要寫的 geOShell 的 plugins,先用 BCB 測試的 code,提供參考。
//---------------------------------------------------------------------------
// IME Tester version 0.01
//
// @ List All IMEs of the windows system
// @ Switch IMEs
// @ Monitor Current IMEs (not work on other Apps)
//
// <2003-09-24> dllee http://dllee.ktop.com.tw
//---------------------------------------------------------------------------
#include
#pragma hdrstop #include "Unit1.h"
//----------------------------------------------------------------------------//
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1; typedef struct _LanguageID
{
unsigned short ID;
char Language[38];
} TLanguageID, *PLanguageID; TLanguageID lidList[]={
//Identifier Language
{ 0x0000, "Language Neutral"}, // 001
{ 0x007f, "LOCALE_INVARIANT"}, // 002
{ 0x0400, "User Default Language"}, // 003
{ 0x0800, "System Default Language"}, // 004
{ 0x0436, "Afrikaans"}, // 005
{ 0x041c, "Albanian"}, // 006
{ 0x0401, "Arabic (Saudi Arabia)"}, // 007
{ 0x0801, "Arabic (Iraq)"}, // 008
{ 0x0c01, "Arabic (Egypt)"}, // 009
{ 0x1001, "Arabic (Libya)"}, // 010
{ 0x1401, "Arabic (Algeria)"}, // 011
{ 0x1801, "Arabic (Morocco)"}, // 012
{ 0x1c01, "Arabic (Tunisia)"}, // 013
{ 0x2001, "Arabic (Oman)"}, // 014
{ 0x2401, "Arabic (Yemen)"}, // 015
{ 0x2801, "Arabic (Syria)"}, // 016
{ 0x2c01, "Arabic (Jordan)"}, // 017
{ 0x3001, "Arabic (Lebanon)"}, // 018
{ 0x3401, "Arabic (Kuwait)"}, // 019
{ 0x3801, "Arabic (U.A.E.)"}, // 020
{ 0x3c01, "Arabic (Bahrain)"}, // 021
{ 0x4001, "Arabic (Qatar)"}, // 022
{ 0x042b, "Armenian (Unicode only)"}, // 023
{ 0x042c, "Azeri (Latin)"}, // 024
{ 0x082c, "Azeri (Cyrillic)"}, // 025
{ 0x042d, "Basque"}, // 026
{ 0x0423, "Belarusian"}, // 027
{ 0x0402, "Bulgarian"}, // 028
{ 0x0455, "Burmese"}, // 029
{ 0x0403, "Catalan"}, // 030
{ 0x0404, "Chinese (Taiwan)"}, // 031
{ 0x0804, "Chinese (PRC)"}, // 032
{ 0x0c04, "Chinese (Hong Kong SAR, PRC)"}, // 033
{ 0x1004, "Chinese (Singapore)"}, // 034
{ 0x1404, "Chinese (Macau SAR)"}, // 035
{ 0x041a, "Croatian"}, // 036
{ 0x0405, "Czech"}, // 037
{ 0x0406, "Danish"}, // 038
{ 0x0465, "Divehi (Unicode only)"}, // 039
{ 0x0413, "Dutch (Netherlands)"}, // 040
{ 0x0813, "Dutch (Belgium)"}, // 041
{ 0x0409, "English (United States)"}, // 042
{ 0x0809, "English (United Kingdom)"}, // 043
{ 0x0c09, "English (Australian)"}, // 044
{ 0x1009, "English (Canadian)"}, // 045
{ 0x1409, "English (New Zealand)"}, // 046
{ 0x1809, "English (Ireland)"}, // 047
{ 0x1c09, "English (South Africa)"}, // 048
{ 0x2009, "English (Jamaica)"}, // 049
{ 0x2409, "English (Caribbean)"}, // 050
{ 0x2809, "English (Belize)"}, // 051
{ 0x2c09, "English (Trinidad)"}, // 052
{ 0x3009, "English (Zimbabwe)"}, // 053
{ 0x3409, "English (Philippines)"}, // 054
{ 0x0425, "Estonian"}, // 055
{ 0x0438, "Faeroese"}, // 056
{ 0x0429, "Farsi"}, // 057
{ 0x040b, "Finnish"}, // 058
{ 0x040c, "French (Standard)"}, // 059
{ 0x080c, "French (Belgian)"}, // 060
{ 0x0c0c, "French (Canadian)"}, // 061
{ 0x100c, "French (Switzerland)"}, // 062
{ 0x140c, "French (Luxembourg)"}, // 063
{ 0x180c, "French (Monaco)"}, // 064
{ 0x0456, "Galician"}, // 065
{ 0x0437, "Georgian (Unicode only)"}, // 066
{ 0x0407, "German (Standard)"}, // 067
{ 0x0807, "German (Switzerland)"}, // 068
{ 0x0c07, "German (Austria)"}, // 069
{ 0x1007, "German (Luxembourg)"}, // 070
{ 0x1407, "German (Liechtenstein)"}, // 071
{ 0x0408, "Greek"}, // 072
{ 0x0447, "Gujarati (Unicode only)"}, // 073
{ 0x040d, "Hebrew"}, // 074
{ 0x0439, "Hindi (Unicode only)"}, // 075
{ 0x040e, "Hungarian"}, // 076
{ 0x040f, "Icelandic"}, // 077
{ 0x0421, "Indonesian"}, // 078
{ 0x0410, "Italian (Standard)"}, // 079
{ 0x0810, "Italian (Switzerland)"}, // 080
{ 0x0411, "Japanese"}, // 081
{ 0x044b, "Kannada (Unicode only)"}, // 082
{ 0x0457, "Konkani (Unicode only)"}, // 083
{ 0x0412, "Korean"}, // 084
{ 0x0812, "Korean (Johab)"}, // 085
{ 0x0440, "Kyrgyz"}, // 086
{ 0x0426, "Latvian"}, // 087
{ 0x0427, "Lithuanian"}, // 088
{ 0x0827, "Lithuanian (Classic)"}, // 089
{ 0x042f, "FYRO Macedonian"}, // 090
{ 0x043e, "Malay (Malaysian)"}, // 091
{ 0x083e, "Malay (Brunei Darussalam)"}, // 092
{ 0x044e, "Marathi (Unicode only)"}, // 093
{ 0x0450, "Mongolian"}, // 094
{ 0x0414, "Norwegian (Bokmal)"}, // 095
{ 0x0814, "Norwegian (Nynorsk)"}, // 096
{ 0x0415, "Polish"}, // 097
{ 0x0416, "Portuguese (Brazil)"}, // 098
{ 0x0816, "Portuguese (Portugal)"}, // 099
{ 0x0446, "Punjabi (Unicode only)"}, // 100
{ 0x0418, "Romanian"}, // 101
{ 0x0419, "Russian"}, // 102
{ 0x044f, "Sanskrit (Unicode only)"}, // 103
{ 0x0c1a, "Serbian (Cyrillic)"}, // 104
{ 0x081a, "Serbian (Latin)"}, // 105
{ 0x041b, "Slovak"}, // 106
{ 0x0424, "Slovenian"}, // 107
{ 0x040a, "Spanish (Spain, Traditional Sort)"},// 108
{ 0x080a, "Spanish (Mexican)"}, // 109
{ 0x0c0a, "Spanish (Spain, Modern Sort)"}, // 110
{ 0x100a, "Spanish (Guatemala)"}, // 111
{ 0x140a, "Spanish (Costa Rica)"}, // 112
{ 0x180a, "Spanish (Panama)"}, // 113
{ 0x1c0a, "Spanish (Dominican Republic)"}, // 114
{ 0x200a, "Spanish (Venezuela)"}, // 115
{ 0x240a, "Spanish (Colombia)"}, // 116
{ 0x280a, "Spanish (Peru)"}, // 117
{ 0x2c0a, "Spanish (Argentina)"}, // 118
{ 0x300a, "Spanish (Ecuador)"}, // 119
{ 0x340a, "Spanish (Chile)"}, // 120
{ 0x380a, "Spanish (Uruguay)"}, // 121
{ 0x3c0a, "Spanish (Paraguay)"}, // 122
{ 0x400a, "Spanish (Bolivia)"}, // 123
{ 0x440a, "Spanish (El Salvador)"}, // 124
{ 0x480a, "Spanish (Honduras)"}, // 125
{ 0x4c0a, "Spanish (Nicaragua)"}, // 126
{ 0x500a, "Spanish (Puerto Rico)"}, // 127
{ 0x0430, "Sutu"}, // 128
{ 0x0441, "Swahili (Kenya)"}, // 129
{ 0x041d, "Swedish"}, // 130
{ 0x081d, "Swedish (Finland)"}, // 131
{ 0x045a, "Syriac (Unicode only)"}, // 132
{ 0x0449, "Tamil (Unicode only)"}, // 133
{ 0x0444, "Tatar (Tatarstan)"}, // 134
{ 0x044a, "Telugu (Unicode only)"}, // 135
{ 0x041e, "Thai"}, // 136
{ 0x041f, "Turkish"}, // 137
{ 0x0422, "Ukrainian"}, // 138
{ 0x0420, "Urdu (Pakistan)"}, // 139
{ 0x0820, "Urdu (India)"}, // 140
{ 0x0443, "Uzbek (Latin)"}, // 141
{ 0x0843, "Uzbek (Cyrillic)"}, // 142
{ 0x042a, "Vietnamese"} }; // 143
#define _TotalLanguageCount_ 143 //----------------------------------------------------------------------------//
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//----------------------------------------------------------------------------// void __fastcall TForm1::Button1Click(TObject *Sender)
{
UINT cnt;
HKL FAR *lpKL;
HKL hKL;
char szImeName[30];
char szImeDesr[80]; cnt = GetKeyboardLayoutList(0, NULL);
if (!cnt) return; lpKL = (HKL FAR *)LocalAlloc(LPTR, sizeof(HKL) * cnt);
if (!lpKL) return; cnt = GetKeyboardLayoutList(cnt, lpKL);
if (!cnt) return; for(UINT ii=0;iiItems->AddObject(String(ii) " " IntToHex(int(hKL),8) " "
String(szImeDesr),(TObject *)(hKL));
} LocalFree(lpKL);
}
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------////----------------------------------------------------------------------------////----------------------------------------------------------------------------//
void __fastcall TForm1::ListBox1Click(TObject *Sender)
{
if(ListBox1->ItemIndex>=0)
{
if(ListBox1->Items->Objects[ListBox1->ItemIndex]!=NULL)
{
HKL hKL=(HKL)ListBox1->Items->Objects[ListBox1->ItemIndex];
ActivateKeyboardLayout(hKL, 0);
}
}
}
//----------------------------------------------------------------------------//
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
char szImeName[30];
char szImeDesr[80];
HKL hKL=GetKeyboardLayout(0);
ImmGetIMEFileName(hKL, szImeName, sizeof(szImeName));
ImmGetDescription(hKL, szImeDesr, sizeof(szImeDesr)); if(StrLen(szImeName)==0)
{
szImeDesr[0]='\0';
unsigned short usID=int(hKL)&0xFFFF;
for(int i=0;i<_TotalLanguageCount_;i )
{
if(lidList[i].ID==usID)
{
strcpy(szImeDesr,lidList[i].Language);
break;
}
}
} Panel2->Caption="CurrentIME: " IntToHex(int(hKL),8) " " String(szImeDesr);
}
//----------------------------------------------------------------------------//
void __fastcall TForm1::ButtonPreClick(TObject *Sender)
{
ActivateKeyboardLayout((HKL)HKL_PREV, 0);
}
//----------------------------------------------------------------------------// void __fastcall TForm1::ButtonNextClick(TObject *Sender)
{
ActivateKeyboardLayout((HKL)HKL_NEXT, 0);
}
//----------------------------------------------------------------------------//
沒空更新的網頁...
http://dllee.ktop.com.tw C及指標教學,計算機概論,資訊管理導論... http://dllee.adsldns.org 介紹Shells,LiteStep,GeoShell....