00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
#include "precomp.h"
00021
#pragma hdrstop
00022
00023
00024
00025
00026 HANDLE
LastConsole;
00027 HIMC
ghDefaultIMC;
00028
00029 PCONSOLE_TABLE *
ConsoleTable;
00030 ULONG
NumberOfConsoleTable;
00031
00032 CRITICAL_SECTION
ConsoleTableLock;
00033 #define LockConsoleTable() RtlEnterCriticalSection(&ConsoleTableLock)
00034 #define UnlockConsoleTable() RtlLeaveCriticalSection(&ConsoleTableLock)
00035
00036
00037 BOOL gfDoNotKillFocus;
00038
00039
00040 DWORD dwConsoleThreadId;
00041
00042
00043
#if DBG
00044
ULONG
InputExceptionFilter(
00045 PEXCEPTION_POINTERS pexi)
00046 {
00047
if (pexi->ExceptionRecord->ExceptionCode != STATUS_PORT_DISCONNECTED) {
00048
DbgPrint(
"CONIME: Unexpected exception - %x, pexi = %x\n",
00049 pexi->ExceptionRecord->ExceptionCode, pexi);
00050 DbgBreakPoint();
00051 }
00052
00053
return EXCEPTION_EXECUTE_HANDLER;
00054 }
00055
#else
00056 #define InputExceptionFilter(pexi) EXCEPTION_EXECUTE_HANDLER
00057
#endif
00058
00059
00060
int
00061
APIENTRY
00062 WinMain(
00063 HINSTANCE hInstance,
00064 HINSTANCE hPrevInstance,
00065 LPSTR lpCmdLine,
00066
int nCmdShow
00067 )
00068 {
00069 MSG
msg;
00070 WCHAR systemPath[
MAX_PATH];
00071
00072 GetSystemDirectory ( systemPath,
MAX_PATH );
00073 SetCurrentDirectory ( systemPath );
00074
00075
if (!
InitConsoleIME(hInstance) ) {
00076
DBGPRINT((
"CONIME: InitConsoleIME failure!\n"));
00077
return FALSE;
00078 }
00079
else {
00080
DBGPRINT((
"CONIME: InitConsoleIME successful!\n"));
00081 }
00082
00083
try {
00084
00085
while (
TRUE) {
00086
if (
GetMessage(&
msg,
NULL, 0, 0)) {
00087
TranslateMessage(&
msg);
00088
DispatchMessage(&
msg);
00089 }
else {
00090
break;
00091 }
00092 }
00093
00094 } except (
InputExceptionFilter(GetExceptionInformation())) {
00095
00096
if (
dwConsoleThreadId)
00097 {
00098
DBGPRINT((
"CONIME: Exception on WinMain!!\n"));
00099 UnregisterConsoleIME();
00100
dwConsoleThreadId = 0;
00101 }
00102
00103 }
00104
00105
return (
int)
msg.wParam;
00106 }
00107
00108
BOOL
00109 InitConsoleIME(
00110 HINSTANCE hInstance
00111 )
00112 {
00113 HANDLE hEvent;
00114 ATOM atom;
00115 HWND
hWnd;
00116 WNDCLASS ConsoleIMEClass;
00117
int cxExecStart;
00118
int cyExecStart;
00119 WCHAR szMenuName[16];
00120 WCHAR szClassName[16];
00121 WCHAR
szTitle[16];
00122
00123
#ifdef DEBUG_MODE
00124
WCHAR szAppName[16];
00125
00126 LoadString(hInstance,
IDS_TITLE,
szTitle,
sizeof(
szTitle));
00127
#else
00128
szTitle[0] =
L'\0';
00129
#endif
00130
00131
DBGPRINT((
"CONIME: Enter InitConsoleIMEl!\n"));
00132
00133
RtlInitializeCriticalSection(&
ConsoleTableLock);
00134
00135
ConsoleTable = (
PCONSOLE_TABLE *)LocalAlloc(LPTR,
CONSOLE_INITIAL_TABLE *
sizeof(
PCONSOLE_TABLE));
00136
if (
ConsoleTable ==
NULL) {
00137
return FALSE;
00138 }
00139 RtlZeroMemory(
ConsoleTable,
CONSOLE_INITIAL_TABLE *
sizeof(
PCONSOLE_TABLE));
00140
NumberOfConsoleTable =
CONSOLE_INITIAL_TABLE;
00141
00142
00143 LoadString(hInstance,
IDS_MENUNAME, szMenuName,
sizeof(szMenuName));
00144 LoadString(hInstance,
IDS_CLASSNAME, szClassName,
sizeof(szClassName));
00145
00146 hEvent = OpenEvent(EVENT_MODIFY_STATE,
00147
FALSE,
00148
CONSOLEIME_EVENT);
00149
if (hEvent ==
NULL)
00150 {
00151
DBGPRINT((
"CONIME: OpenEvent failure! %d\n",GetLastError()));
00152
goto ErrorExit;
00153 }
00154
00155
00156
00157
00158 ConsoleIMEClass.style = 0;
00159 ConsoleIMEClass.lpfnWndProc =
WndProc;
00160 ConsoleIMEClass.cbClsExtra = 0;
00161 ConsoleIMEClass.cbWndExtra = 0;
00162 ConsoleIMEClass.hInstance = hInstance;
00163 ConsoleIMEClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(
ID_CONSOLEIME_ICON));
00164 ConsoleIMEClass.hCursor = LoadCursor(
NULL, IDC_ARROW);
00165 ConsoleIMEClass.hbrBackground = GetStockObject(WHITE_BRUSH);
00166 ConsoleIMEClass.lpszMenuName = szMenuName;
00167 ConsoleIMEClass.lpszClassName = szClassName;
00168
00169
00170
00171 atom =
RegisterClass(&ConsoleIMEClass);
00172
if (atom == 0)
00173 {
00174
DBGPRINT((
"CONIME: RegisterClass failure! %d\n",GetLastError()));
00175
goto ErrorExit;
00176 }
00177
else {
00178
DBGPRINT((
"CONIME: RegisterClass Successful!\n"));
00179 }
00180
00181
00182 cxExecStart =
GetSystemMetrics(SM_CXSCREEN);
00183 cyExecStart =
GetSystemMetrics(SM_CYMENU);
00184
00185
00186
hWnd = CreateWindow(szClassName,
00187
szTitle,
00188 WS_OVERLAPPEDWINDOW,
00189 cxExecStart - (cxExecStart / 3) ,
00190 cyExecStart ,
00191 cxExecStart / 3 ,
00192 cyExecStart * 10 ,
00193
NULL,
00194
NULL,
00195 hInstance,
00196 (
LPVOID)
NULL);
00197
00198
00199
if (
hWnd ==
NULL) {
00200
DBGPRINT((
"CONIME: CreateWindow failured! %d\n",GetLastError()));
00201
goto ErrorExit;
00202 }
00203
else{
00204
DBGPRINT((
"CONIME: CreateWindow Successful!\n"));
00205 }
00206
00207
if (! RegisterConsoleIME(
hWnd, &
dwConsoleThreadId))
00208 {
00209
DBGPRINT((
"CONIME: RegisterConsoleIME failured! %d\n",GetLastError()));
00210
goto ErrorExit;
00211 }
00212
00213
if (! AttachThreadInput(GetCurrentThreadId(),
dwConsoleThreadId,
TRUE))
00214 {
00215
DBGPRINT((
"CONIME: AttachThreadInput failured! %d\n",GetLastError()));
00216
goto ErrorExit;
00217 }
00218
00219
00220
00221
00222 SetEvent(hEvent);
00223 CloseHandle(hEvent);
00224
00225
#ifdef DEBUG_MODE
00226
LoadString(hInstance,
IDS_APPNAME, szAppName,
sizeof(szAppName));
00227
00228
00229
ShowWindow(
hWnd, SW_MINIMIZE);
00230
SetWindowText(
hWnd, szAppName);
00231
UpdateWindow(
hWnd);
00232
00233 {
00234
int i;
00235
00236
for (i = 0; i <
CVMAX; i++) {
00237 ConvertLine[i] =
UNICODE_SPACE;
00238 ConvertLineAtr[i] = 0;
00239 }
00240 xPos = 0;
00241 xPosLast = 0;
00242 }
00243
00244
#endif
00245
00246
return TRUE;
00247
00248
ErrorExit:
00249
if (
dwConsoleThreadId)
00250 UnregisterConsoleIME();
00251
if (
hWnd)
00252
DestroyWindow(
hWnd);
00253
if (atom)
00254
UnregisterClass(szClassName,hInstance);
00255
if (hEvent)
00256 {
00257 SetEvent(hEvent);
00258 CloseHandle(hEvent);
00259 }
00260
return FALSE;
00261 }
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288 LRESULT
FAR PASCAL
WndProc( HWND hWnd,
00289 UINT Message,
00290 WPARAM wParam,
00291 LPARAM lParam)
00292 {
00293
DWORD dwImmRet = 0;
00294
00295
try {
00296
00297
switch (Message)
00298 {
00299
case CONIME_CREATE:
00300
DBGPRINT((
"CONIME: CONIME_CREATE: Console Handle=%08x\n", wParam));
00301
return InsertNewConsole(
hWnd,(HANDLE)wParam,(HWND)lParam);
00302
00303
case CONIME_DESTROY:
00304
DBGPRINT((
"CONIME: CONIME_DESTROY: Console Handle=%08x\n", wParam));
00305
return RemoveConsole(
hWnd, (HANDLE)wParam);
00306
00307
case CONIME_SETFOCUS:
00308
DBGPRINT((
"CONIME: CONIME_SETFOCUS: Console Handle=%08x\n", wParam));
00309
return ConsoleSetFocus(
hWnd, (HANDLE)wParam, (HKL)lParam);
00310
00311
case CONIME_KILLFOCUS:
00312
DBGPRINT((
"CONIME: CONIME_KILLFOCUS: Console Handle=%08x\n", wParam));
00313
return ConsoleKillFocus(
hWnd, (HANDLE)wParam);
00314
00315
case CONIME_GET_NLSMODE:
00316
DBGPRINT((
"CONIME: CONIME_GET_NLSMODE: Console Handle=%08x\n", wParam));
00317
return GetNLSMode(
hWnd, (HANDLE)wParam);
00318
00319
case CONIME_SET_NLSMODE:
00320
DBGPRINT((
"CONIME: CONIME_SET_NLSMODE: Console Handle=%08x\n", wParam));
00321
return SetNLSMode(
hWnd, (HANDLE)wParam, (
DWORD)lParam);
00322
00323
case CONIME_HOTKEY:
00324
DBGPRINT((
"CONIME: CONIME_HOTKEY\n"));
00325
return ConimeHotkey(
hWnd, (HANDLE)wParam, (
DWORD)lParam);
00326
00327
case CONIME_NOTIFY_VK_KANA:
00328
DBGPRINT((
"CONIME: CONIME_NOTIFY_VK_KANA\n"));
00329
return ImeUISetConversionMode(
hWnd);
00330
00331
case CONIME_NOTIFY_SCREENBUFFERSIZE: {
00332 COORD ScreenBufferSize;
00333
DBGPRINT((
"CONIME: CONIME_NOTIFY_SCREENBUFFERSIZE: Console Handle=%08x\n", wParam));
00334 ScreenBufferSize.X = LOWORD(lParam);
00335 ScreenBufferSize.Y = HIWORD(lParam);
00336
return ConsoleScreenBufferSize(
hWnd, (HANDLE)wParam, ScreenBufferSize);
00337 }
00338
00339
case CONIME_INPUTLANGCHANGE: {
00340
DBGPRINT((
"CONIME: CONIME_INPUTLANGCHANGE: Console Handle=%08x \n",wParam));
00341
ConImeInputLangchange(
hWnd, (HANDLE)wParam, (HKL)lParam );
00342
return TRUE;
00343 }
00344
00345
case CONIME_NOTIFY_CODEPAGE: {
00346
BOOL Output;
00347 WORD Codepage;
00348
00349 Codepage = HIWORD(lParam);
00350 Output = LOWORD(lParam);
00351
DBGPRINT((
"CONIME: CONIME_NOTIFY_CODEPAGE: Console Handle=%08x %04x %04x\n",wParam, Output, Codepage));
00352
return ConsoleCodepageChange(
hWnd, (HANDLE)wParam, Output, Codepage);
00353 }
00354
00355
case WM_KEYDOWN +
CONIME_KEYDATA:
00356
case WM_KEYUP +
CONIME_KEYDATA:
00357
case WM_SYSKEYDOWN +
CONIME_KEYDATA:
00358
case WM_SYSKEYUP +
CONIME_KEYDATA:
00359
case WM_DEADCHAR +
CONIME_KEYDATA:
00360
case WM_SYSDEADCHAR+
CONIME_KEYDATA:
00361
case WM_SYSCHAR +
CONIME_KEYDATA:
00362
case WM_CHAR +
CONIME_KEYDATA:
00363
CharHandlerFromConsole(
hWnd, Message, (ULONG)wParam, (ULONG)lParam );
00364
break;
00365
case WM_KEYDOWN:
00366
case WM_KEYUP:
00367
case WM_SYSKEYDOWN:
00368
case WM_SYSKEYUP:
00369
case WM_DEADCHAR:
00370
case WM_SYSDEADCHAR:
00371
case WM_SYSCHAR:
00372
case WM_CHAR:
00373
CharHandlerToConsole(
hWnd, Message, (ULONG)wParam, (ULONG)lParam );
00374
break;
00375
00376
case WM_INPUTLANGCHANGE:
00377
DBGPRINT((
"CONIME: CONIME_INPUTLANGCHANGE: Console Handle=%08x \n",wParam));
00378
InputLangchange(
hWnd, (
DWORD)wParam, (HKL)lParam );
00379
return TRUE;
00380
00381
case WM_INPUTLANGCHANGEREQUEST:
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402 {
00403
PCONSOLE_TABLE ConTbl;
00404
00405 ConTbl =
SearchConsole(
LastConsole);
00406
if (ConTbl ==
NULL) {
00407
return DefWindowProc(
hWnd, Message, wParam, lParam);
00408 }
00409
00410
PostMessage(ConTbl->
hWndCon, Message, wParam, lParam);
00411 }
00412
return TRUE;
00413
00414
case CONIME_INPUTLANGCHANGEREQUEST:
00415
DBGPRINT((
"CONIME: CONIME_INPUTLANGCHANGEREQUEST: Console Handle=%08x \n",wParam));
00416
return ConImeInputLangchangeRequest(
hWnd, (HANDLE)wParam, (HKL)lParam,
CONIME_DIRECT);
00417
00418
case CONIME_INPUTLANGCHANGEREQUESTFORWARD:
00419
DBGPRINT((
"CONIME: CONIME_INPUTLANGCHANGEREQUEST: Console Handle=%08x \n",wParam));
00420
return ConImeInputLangchangeRequest(
hWnd, (HANDLE)wParam, (HKL)lParam,
CONIME_FORWARD);
00421
00422
case CONIME_INPUTLANGCHANGEREQUESTBACKWARD:
00423
DBGPRINT((
"CONIME: CONIME_INPUTLANGCHANGEREQUEST: Console Handle=%08x \n",wParam));
00424
return ConImeInputLangchangeRequest(
hWnd, (HANDLE)wParam, (HKL)lParam,
CONIME_BACKWARD);
00425
00426
#ifdef DEBUG_MODE
00427
case WM_MOVE:
00428 ImeUIMoveCandWin(
hWnd );
00429
break;
00430
00431
case WM_COMMAND:
00432
00433
00434
00435
00436
switch (LOWORD(wParam)) {
00437
case MM_EXIT:
00438
PostMessage(
hWnd,WM_CLOSE,0,0
L);
00439
break;
00440
00441
case MM_ACCESS_VIOLATION:
00442 {
00443
PBYTE p = 0;
00444 *p = 0;
00445 }
00446
break;
00447 }
00448
break;
00449
#endif
00450
00451
case WM_IME_STARTCOMPOSITION:
00452
ImeUIStartComposition(
hWnd );
00453
break;
00454
case WM_IME_ENDCOMPOSITION:
00455
ImeUIEndComposition(
hWnd );
00456
break;
00457
case WM_IME_COMPOSITION:
00458
ImeUIComposition(
hWnd, wParam, lParam );
00459
break;
00460
case WM_IME_COMPOSITIONFULL:
00461
break;
00462
case WM_IME_NOTIFY:
00463
if ( !
ImeUINotify(
hWnd, wParam, lParam ) ) {
00464
return DefWindowProc(
hWnd, Message, wParam, lParam);
00465 }
00466
break;
00467
case WM_IME_SETCONTEXT:
00468
00469
00470
00471
00472
00473
00474 lParam &= ~ISC_SHOWUIALL;
00475
00476
return DefWindowProc(
hWnd, Message, wParam, lParam );
00477
case WM_IME_SYSTEM:
00478
switch (wParam) {
00479
case IMS_CLOSEPROPERTYWINDOW:
00480
case IMS_OPENPROPERTYWINDOW:
00481
ImeSysPropertyWindow(
hWnd, wParam, lParam);
00482
break;
00483
default:
00484
return DefWindowProc(
hWnd, Message, wParam, lParam );
00485 }
00486
break;
00487
00488
case WM_CREATE:
00489
return Create(
hWnd);
00490
break;
00491
00492
case WM_DESTROY:
00493
DBGPRINT((
"CONIME:Recieve WM_DESTROY\n"));
00494
ExitList(
hWnd);
00495
PostQuitMessage(0);
00496
return 0;
00497
break;
00498
00499
case WM_CLOSE:
00500
DBGPRINT((
"CONIME:Recieve WM_CLOSE\n"));
00501
DestroyWindow(
hWnd);
00502
return 0;
00503
break;
00504
00505
case WM_ENABLE:{
00506
PCONSOLE_TABLE FocusedConsole;
00507
if (!wParam) {
00508 FocusedConsole =
SearchConsole(
LastConsole);
00509
if (FocusedConsole !=
NULL &&
00510 FocusedConsole->
hConsole !=
NULL) {
00511 FocusedConsole->
Enable =
FALSE;
00512
EnableWindow(FocusedConsole->
hWndCon,
FALSE);
00513
gfDoNotKillFocus =
TRUE;
00514 }
00515 }
00516
else{
00517
DWORD i;
00518
LockConsoleTable();
00519
for ( i = 1; i <
NumberOfConsoleTable; i ++){
00520 FocusedConsole =
ConsoleTable[i];
00521
if (FocusedConsole !=
NULL)
00522 {
00523
if ((FocusedConsole->
hConsole !=
NULL)&&
00524 (!FocusedConsole->
Enable)&&
00525 (!
IsWindowEnabled(FocusedConsole->
hWndCon))){
00526
EnableWindow(FocusedConsole->
hWndCon,
TRUE);
00527 FocusedConsole->
Enable =
TRUE;
00528
if (!FocusedConsole->
LateRemove)
00529
SetForegroundWindow(FocusedConsole->
hWndCon);
00530 }
00531 }
00532 }
00533
UnlockConsoleTable();
00534 }
00535
return DefWindowProc(
hWnd, Message, wParam, lParam);
00536
break;
00537 }
00538
00539
#ifdef DEBUG_MODE
00540
case WM_SETFOCUS:
00541
CreateCaret(
hWnd,
00542
NULL,
00543
IsUnicodeFullWidth( ConvertLine[xPos] ) ?
00544 CaretWidth*2 : CaretWidth,
00545 (
UINT)cyMetrics );
00546
SetCaretPos( xPos * cxMetrics, 0 );
00547 ShowCaret(
hWnd );
00548
break;
00549
00550
case WM_KILLFOCUS:
00551 HideCaret(
hWnd );
00552
DestroyCaret();
00553
break;
00554
00555
case WM_PAINT:
00556 {
00557 PAINTSTRUCT pstruc;
00558 HDC hDC;
00559 hDC =
BeginPaint(
hWnd,&pstruc);
00560 ReDraw(
hWnd);
00561 EndPaint(
hWnd,&pstruc);
00562
break;
00563 }
00564
#endif
00565
00566
case WM_QUERYENDSESSION:
00567
#ifdef HIRSHI_DEBUG
00568
00569
00570
00571
00572
00573 {
00574
int i;
00575 i = MessageBox(
hWnd,TEXT(
"Could you approve exit session?"), TEXT(
"Console IME"),
00576 MB_ICONSTOP | MB_YESNO);
00577
return (i == IDYES ?
TRUE :
FALSE);
00578 }
00579
#endif
00580
return TRUE;
00581
00582
case WM_ENDSESSION:
00583
DBGPRINT((
"CONIME:Recieve WM_ENDSESSION\n"));
00584
ExitList(
hWnd);
00585
return 0;
00586
00587
default:
00588
return DefWindowProc(
hWnd, Message, wParam, lParam);
00589 }
00590
00591 } except (
InputExceptionFilter(GetExceptionInformation())) {
00592
00593
if (
dwConsoleThreadId)
00594 {
00595
DBGPRINT((
"CONIME: Exception on WndProc!!\n"));
00596 UnregisterConsoleIME();
00597
dwConsoleThreadId = 0;
00598
00599
DestroyWindow(
hWnd);
00600
return 0;
00601 }
00602
00603 }
00604
00605
00606
return TRUE;
00607 }
00608
00609
00610
VOID
00611 ExitList(
00612 HWND hWnd
00613 )
00614 {
00615 ULONG i ,j;
00616
PCONSOLE_TABLE FocusedConsole;
00617
00618
DBGPRINT((
"CONIME:ExitList Processing\n"));
00619
ImmAssociateContext(
hWnd,
ghDefaultIMC);
00620
00621
LockConsoleTable();
00622
00623
for (i = 1; i <
NumberOfConsoleTable; i++) {
00624 FocusedConsole =
ConsoleTable[i];
00625
if (FocusedConsole !=
NULL)
00626 {
00627
if (FocusedConsole->
hConsole !=
NULL) {
00628
if (FocusedConsole->
Enable) {
00629
ImmDestroyContext(FocusedConsole->
hIMC_Original);
00630
if ( FocusedConsole->
lpCompStrMem !=
NULL) {
00631 LocalFree( FocusedConsole->
lpCompStrMem );
00632 FocusedConsole->
lpCompStrMem =
NULL;
00633 }
00634
for (j = 0; j <
MAX_LISTCAND; j++){
00635
if (FocusedConsole->
lpCandListMem[j] !=
NULL) {
00636 LocalFree(FocusedConsole->
lpCandListMem[j]);
00637 FocusedConsole->
lpCandListMem[j] =
NULL;
00638 FocusedConsole->
CandListMemAllocSize[j] = 0;
00639 }
00640 }
00641
if (FocusedConsole->
CandSep !=
NULL) {
00642 LocalFree(FocusedConsole->
CandSep);
00643 FocusedConsole->
CandSepAllocSize = 0;
00644 }
00645 FocusedConsole->
Enable =
FALSE;
00646 }
00647
else
00648 FocusedConsole->
LateRemove =
TRUE;
00649 }
00650 }
00651 }
00652 LocalFree(
ConsoleTable );
00653
UnlockConsoleTable();
00654
00655
if (
dwConsoleThreadId)
00656 {
00657 AttachThreadInput(GetCurrentThreadId(),
dwConsoleThreadId,
FALSE);
00658 UnregisterConsoleIME();
00659
dwConsoleThreadId = 0;
00660 }
00661 }
00662
00663
BOOL
00664 InsertConsole(
00665 HWND hWnd,
00666 HANDLE hConsole,
00667 HWND hWndConsole
00668 )
00669 {
00670 ULONG i;
00671
PCONSOLE_TABLE FocusedConsole;
00672
00673 i = 1;
00674
00675
do {
00676
for (; i <
NumberOfConsoleTable; i++) {
00677 FocusedConsole =
ConsoleTable[i];
00678
00679
if (FocusedConsole ==
NULL)
00680 {
00681 FocusedConsole = LocalAlloc(LPTR,
sizeof(
CONSOLE_TABLE));
00682
if (FocusedConsole ==
NULL)
00683
return FALSE;
00684
ConsoleTable[i] = FocusedConsole;
00685 }
00686
00687
if ((FocusedConsole->
hConsole !=
NULL) &&
00688 (FocusedConsole->
LateRemove)&&
00689 (FocusedConsole->
Enable)) {
00690
RemoveConsoleWorker(
hWnd, FocusedConsole);
00691 }
00692
00693
if (FocusedConsole->
hConsole ==
NULL) {
00694 RtlZeroMemory(FocusedConsole,
sizeof(
CONSOLE_TABLE));
00695 FocusedConsole->
lphklList = LocalAlloc(LPTR,
sizeof(
HKL_TABLE)*
HKL_INITIAL_TABLE);
00696
if (FocusedConsole->
lphklList ==
NULL)
00697 {
00698
return FALSE;
00699 }
00700 RtlZeroMemory(FocusedConsole->
lphklList,
sizeof(
HKL_TABLE)*
HKL_INITIAL_TABLE);
00701 FocusedConsole->
hklListMax =
HKL_INITIAL_TABLE ;
00702
00703 FocusedConsole->
hIMC_Current =
ImmCreateContext();
00704
if (FocusedConsole->
hIMC_Current == (HIMC)
NULL) {
00705 LocalFree(FocusedConsole);
00706 FocusedConsole =
NULL;
00707
return FALSE;
00708 }
00709
00710 FocusedConsole->
hIMC_Original = FocusedConsole->
hIMC_Current;
00711 FocusedConsole->
hConsole = hConsole;
00712 FocusedConsole->
hWndCon = hWndConsole;
00713
00714 FocusedConsole->
Enable =
TRUE;
00715
00716
00717
00718
00719 FocusedConsole->
ScreenBufferSize.X =
DEFAULT_TEMP_WIDTH;
00720
00721 FocusedConsole->
CompAttrColor[0] =
DEFAULT_COMP_ENTERED;
00722 FocusedConsole->
CompAttrColor[1] =
DEFAULT_COMP_ALREADY_CONVERTED;
00723 FocusedConsole->
CompAttrColor[2] =
DEFAULT_COMP_CONVERSION;
00724 FocusedConsole->
CompAttrColor[3] =
DEFAULT_COMP_YET_CONVERTED;
00725 FocusedConsole->
CompAttrColor[4] =
DEFAULT_COMP_INPUT_ERROR;
00726 FocusedConsole->
CompAttrColor[5] =
DEFAULT_COMP_INPUT_ERROR;
00727 FocusedConsole->
CompAttrColor[6] =
DEFAULT_COMP_INPUT_ERROR;
00728 FocusedConsole->
CompAttrColor[7] =
DEFAULT_COMP_INPUT_ERROR;
00729
00730
GetIMEName(FocusedConsole);
00731
00732
return TRUE;
00733 }
00734 }
00735 }
while (
GrowConsoleTable());
00736
00737
DBGPRINT((
"CONIME: Cannot grow Console Table\n"));
00738
return FALSE;
00739 }
00740
00741
BOOL
00742 GrowConsoleTable(
00743 VOID
00744 )
00745 {
00746
PCONSOLE_TABLE *NewTable;
00747
PCONSOLE_TABLE *OldTable;
00748 ULONG MaxConsoleTable;
00749
00750 MaxConsoleTable =
NumberOfConsoleTable +
CONSOLE_CONSOLE_TABLE_INCREMENT;
00751 NewTable = (
PCONSOLE_TABLE *)LocalAlloc(LPTR, MaxConsoleTable *
sizeof(
PCONSOLE_TABLE));
00752
if (NewTable ==
NULL) {
00753
return FALSE;
00754 }
00755 CopyMemory(NewTable,
ConsoleTable,
NumberOfConsoleTable *
sizeof(
PCONSOLE_TABLE));
00756
00757 OldTable =
ConsoleTable;
00758
ConsoleTable = NewTable;
00759
NumberOfConsoleTable = MaxConsoleTable;
00760
00761 LocalFree(OldTable);
00762
00763
return TRUE;
00764 }
00765
00766
PCONSOLE_TABLE
00767 SearchConsole(
00768 HANDLE hConsole
00769 )
00770 {
00771 ULONG i;
00772
PCONSOLE_TABLE FocusedConsole;
00773
00774
LockConsoleTable();
00775
00776
00777
00778
00779
00780
if (
LastConsole == 0) {
00781
LastConsole = hConsole ;
00782 }
00783
00784
for (i = 1; i <
NumberOfConsoleTable; i++) {
00785 FocusedConsole =
ConsoleTable[i];
00786
if (FocusedConsole !=
NULL)
00787 {
00788
if ((FocusedConsole->
hConsole == hConsole)&&
00789 (!FocusedConsole->
LateRemove)) {
00790
00791
UnlockConsoleTable();
00792
return FocusedConsole;
00793 }
00794 }
00795 }
00796
UnlockConsoleTable();
00797
return NULL;
00798 }
00799
00800
BOOL
00801 RemoveConsole(
00802 HWND hwnd,
00803 HANDLE hConsole
00804 )
00805 {
00806
PCONSOLE_TABLE ConTbl;
00807
BOOL ret;
00808
00809
LockConsoleTable();
00810
00811 ConTbl =
SearchConsole(hConsole);
00812
if (ConTbl ==
NULL)
00813 {
00814
UnlockConsoleTable();
00815
return FALSE;
00816 }
00817 ret =
RemoveConsoleWorker(hwnd, ConTbl);
00818
00819
UnlockConsoleTable();
00820
return ret;
00821 }
00822
00823
BOOL
00824 RemoveConsoleWorker(
00825 HWND hwnd,
00826
PCONSOLE_TABLE ConTbl
00827 )
00828 {
00829
DWORD j;
00830
00831
if (ConTbl->
Enable) {
00832 ConTbl->
hConsole =
NULL;
00833 ConTbl->
ScreenBufferSize.X = 0;
00834 ConTbl->
ConsoleCP = 0;
00835 ConTbl->
ConsoleOutputCP = 0;
00836 ConTbl->
hklActive = 0;
00837
00838
ImmDestroyContext(ConTbl->
hIMC_Original);
00839
00840
if (ConTbl->
lpCompStrMem !=
NULL){
00841 LocalFree(ConTbl->
lpCompStrMem);
00842 }
00843
for (j = 0; j <
MAX_LISTCAND; j++){
00844
if (ConTbl->
lpCandListMem[j] !=
NULL) {
00845 LocalFree(ConTbl->
lpCandListMem[j]);
00846 }
00847 }
00848
if (ConTbl->
CandSep !=
NULL) {
00849 LocalFree(ConTbl->
CandSep);
00850 }
00851
00852
if (ConTbl->
lphklList !=
NULL) {
00853 LocalFree(ConTbl->
lphklList) ;
00854 }
00855
00856 ConTbl->
Enable =
FALSE;
00857 ConTbl->
LateRemove =
FALSE;
00858 }
00859
else
00860 ConTbl->
LateRemove =
TRUE;
00861
00862
#ifdef DEBUG_MODE
00863
InvalidateRect(hwnd,
NULL,
TRUE);
00864
#endif
00865
return TRUE;
00866 }
00867
00868
BOOL
00869 InsertNewConsole(
00870 HWND hWnd,
00871 HANDLE hConsole,
00872 HWND hWndConsole
00873 )
00874 {
00875
00876
00877
00878
00879
if (
SearchConsole(hConsole) !=
NULL) {
00880
return TRUE;
00881 }
00882
00883
LockConsoleTable();
00884
00885
if (!
InsertConsole(
hWnd, hConsole, hWndConsole)) {
00886
UnlockConsoleTable();
00887
return FALSE;
00888 }
00889
00890
#ifdef DEBUG_MODE
00891
DisplayInformation(
hWnd, hConsole);
00892
#endif
00893
00894
ImeUISetOpenStatus( hWndConsole );
00895
00896
UnlockConsoleTable();
00897
00898
return TRUE;
00899 }
00900
00901
00902
BOOL
00903 ConsoleSetFocus(
00904 HWND hWnd,
00905 HANDLE hConsole,
00906 HKL hKL
00907 )
00908 {
00909
PCONSOLE_TABLE ConTbl;
00910 HKL OldhKL;
00911
00912 ConTbl =
SearchConsole(hConsole);
00913
if (ConTbl ==
NULL) {
00914
DBGPRINT((
"CONIME: Error! Cannot found registed Console\n"));
00915
return FALSE;
00916 }
00917
00918
if (
gfDoNotKillFocus ){
00919
gfDoNotKillFocus =
FALSE;
00920 }
00921
00922 OldhKL = ConTbl->
hklActive ;
00923 ConTbl->
hklActive = hKL;
00924
ActivateKeyboardLayout(ConTbl->
hklActive, 0);
00925
ImmAssociateContext(
hWnd, ConTbl->
hIMC_Current);
00926
00927
if (OldhKL == 0) {
00928
GetIMEName( ConTbl );
00929 ConTbl->
ImmGetProperty =
ImmGetProperty(ConTbl->
hklActive , IGP_PROPERTY);
00930 }
00931
00932
00933
ImmSetActiveContextConsoleIME(
hWnd,
TRUE);
00934
00935
00936
LastConsole = hConsole;
00937
00938
#ifdef DEBUG_MODE
00939
DisplayInformation(
hWnd, hConsole);
00940
#endif
00941
00942
ImeUISetOpenStatus(
hWnd );
00943
if (ConTbl->
lpCompStrMem !=
NULL)
00944
ReDisplayCompositionStr(
hWnd );
00945
00946
return TRUE;
00947 }
00948
00949
BOOL
00950 ConsoleKillFocus(
00951 HWND hWnd,
00952 HANDLE hConsole
00953 )
00954 {
00955
PCONSOLE_TABLE ConTbl;
00956
00957 ConTbl =
SearchConsole(hConsole);
00958
if (ConTbl ==
NULL) {
00959
DBGPRINT((
"CONIME: Error! Cannot found registed Console\n"));
00960
return FALSE;
00961 }
00962
00963
if (
gfDoNotKillFocus ){
00964
gfDoNotKillFocus =
FALSE;
00965 }
00966
else{
00967
00968
ImmSetActiveContextConsoleIME(
hWnd,
FALSE);
00969
00970
ImmAssociateContext(
hWnd,
ghDefaultIMC);
00971 }
00972
00973
#ifdef DEBUG_MODE
00974
DisplayInformation(
hWnd, hConsole);
00975
#endif
00976
00977
return TRUE;
00978 }
00979
00980
BOOL
00981 ConsoleScreenBufferSize(
00982 HWND hWnd,
00983 HANDLE hConsole,
00984 COORD ScreenBufferSize
00985 )
00986 {
00987
PCONSOLE_TABLE ConTbl;
00988
00989 ConTbl =
SearchConsole(hConsole);
00990
if (ConTbl ==
NULL) {
00991
DBGPRINT((
"CONIME: Error! Cannot found registed Console\n"));
00992
return FALSE;
00993 }
00994
00995 ConTbl->
ScreenBufferSize = ScreenBufferSize;
00996
return TRUE;
00997 }
00998
00999
BOOL
01000 ConImeInputLangchangeRequest(
01001 HWND hWnd,
01002 HANDLE hConsole,
01003 HKL hkl,
01004
int Direction
01005 )
01006 {
01007
PCONSOLE_TABLE ConTbl;
01008
int nLayouts;
01009 LPHKL lphkl;
01010
DWORD RequiredLID = 0;
01011
int StartPos;
01012
int CurrentHklPos;
01013
int i;
01014
01015 ConTbl =
SearchConsole(hConsole);
01016
if (ConTbl ==
NULL) {
01017
DBGPRINT((
"CONIME: cannot find registered Console\n"));
01018
return FALSE;
01019 }
01020
01021
switch (ConTbl->
ConsoleOutputCP) {
01022
case JAPAN_CODEPAGE:
01023 RequiredLID =
LANG_ID_JAPAN;
01024
break;
01025
case PRC_CODEPAGE:
01026 RequiredLID =
LANG_ID_PRC;
01027
break;
01028
case KOREA_CODEPAGE:
01029 RequiredLID =
LANG_ID_KOREA;
01030
break;
01031
case TAIWAN_CODEPAGE:
01032 RequiredLID =
LANG_ID_TAIWAN;
01033
break;
01034
default:
01035
break;
01036 }
01037
01038
if ( !
IS_IME_KBDLAYOUT(hkl) ||
01039 (
HKL_TO_LANGID(hkl) == RequiredLID)) {
01040
return TRUE;
01041 }
01042
if (Direction ==
CONIME_DIRECT) {
01043
return FALSE;
01044 }
01045
01046 nLayouts = GetKeyboardLayoutList(0,
NULL);
01047
if (nLayouts == 0) {
01048
return FALSE;
01049 }
01050 lphkl = LocalAlloc(LPTR, nLayouts *
sizeof(HKL));
01051
if (lphkl ==
NULL) {
01052
return FALSE;
01053 }
01054 GetKeyboardLayoutList(nLayouts, lphkl);
01055
01056
for (CurrentHklPos = 0; CurrentHklPos < nLayouts; CurrentHklPos++) {
01057
if (ConTbl->
hklActive == lphkl[CurrentHklPos] ) {
01058
break;
01059 }
01060 }
01061
if (CurrentHklPos >= nLayouts) {
01062 LocalFree(lphkl);
01063
return FALSE;
01064 }
01065
01066 StartPos = CurrentHklPos;
01067
01068
for (i = 0; i < nLayouts; i++) {
01069 StartPos+=Direction;
01070
if (StartPos < 0) {
01071 StartPos = nLayouts-1;
01072 }
01073
else if (StartPos >= nLayouts) {
01074 StartPos = 0;
01075 }
01076
01077
if ((( HandleToUlong(lphkl[StartPos]) & 0xf0000000) == 0x00000000) ||
01078 (( HandleToUlong(lphkl[StartPos]) & 0x0000ffff) == RequiredLID)) {
01079
PostMessage( ConTbl->
hWndCon,
01080
CM_CONIME_KL_ACTIVATE,
01081 HandleToUlong(lphkl[StartPos]),
01082 0);
01083 LocalFree(lphkl);
01084
return FALSE;
01085 }
01086 }
01087
01088 LocalFree(lphkl);
01089
return FALSE;
01090
01091 }
01092
01093
BOOL
01094 ConImeInputLangchange(
01095 HWND hWnd,
01096 HANDLE hConsole,
01097 HKL hkl
01098 )
01099 {
01100
PCONSOLE_TABLE ConTbl;
01101
LPCONIME_UIMODEINFO lpModeInfo;
01102 COPYDATASTRUCT CopyData;
01103
INT counter ;
01104
LPHKL_TABLE lphklListNew ;
01105
01106 ConTbl =
SearchConsole(hConsole);
01107
if (ConTbl ==
NULL) {
01108
01109
01110
01111 ConTbl =
SearchConsole(
LastConsole);
01112
if (ConTbl ==
NULL) {
01113
DBGPRINT((
"CONIME: Error! Cannot found registed Console\n"));
01114
return FALSE;
01115 }
01116 }
01117
01118
if (ConTbl->
lphklList ==
NULL) {
01119
return FALSE;
01120 }
01121
01122
if (
IS_IME_KBDLAYOUT(ConTbl->
hklActive)) {
01123
for (counter = 0 ; counter < ConTbl->
hklListMax ;counter ++)
01124 {
01125
if (ConTbl->
lphklList[counter].
hkl == 0 || ConTbl->
lphklList[counter].
hkl == ConTbl->
hklActive) {
01126
break;
01127 }
01128 }
01129
01130
if (counter >= ConTbl->
hklListMax)
01131 {
01132
ASSERT(counter == ConTbl->
hklListMax);
01133
01134 lphklListNew = LocalAlloc(LPTR,
sizeof(
HKL_TABLE) * (ConTbl->
hklListMax +
HKL_TABLE_INCREMENT) ) ;
01135
if (lphklListNew !=
NULL)
01136 {
01137 CopyMemory(lphklListNew , ConTbl->
lphklList ,
sizeof(
HKL_TABLE) * ConTbl->
hklListMax) ;
01138 ConTbl->
hklListMax +=
HKL_TABLE_INCREMENT ;
01139 LocalFree(ConTbl->
lphklList);
01140 ConTbl->
lphklList = lphklListNew;
01141 }
01142
else {
01143
return FALSE ;
01144 }
01145 }
01146
ASSERT(ConTbl->
lphklList !=
NULL);
01147 ConTbl->
lphklList[counter].
hkl = ConTbl->
hklActive;
01148 ConTbl->
lphklList[counter].
dwConversion = ConTbl->
dwConversion | (ConTbl->
fOpen ?
IME_CMODE_OPEN : 0) ;
01149 }
01150
01151
ActivateKeyboardLayout(hkl, 0);
01152 ConTbl->
hklActive = hkl;
01153
GetIMEName( ConTbl );
01154
ImeUIOpenStatusWindow(
hWnd);
01155 ConTbl->
ImmGetProperty =
ImmGetProperty(ConTbl->
hklActive , IGP_PROPERTY);
01156
01157 lpModeInfo = (
LPCONIME_UIMODEINFO)LocalAlloc( LPTR,
sizeof(
CONIME_UIMODEINFO) ) ;
01158
if ( lpModeInfo ==
NULL) {
01159
return FALSE;
01160 }
01161 CopyData.dwData =
CI_CONIMEMODEINFO ;
01162 CopyData.cbData =
sizeof(
CONIME_UIMODEINFO) ;
01163 CopyData.lpData = lpModeInfo ;
01164
01165
if (
IS_IME_KBDLAYOUT(hkl)) {
01166
01167
for (counter=0; counter < ConTbl->
hklListMax ; counter++)
01168 {
01169
if (ConTbl->
lphklList[counter].
hkl == hkl)
01170 {
01171
SetNLSMode(
hWnd, hConsole,ConTbl->
lphklList[counter].
dwConversion ) ;
01172
ImeUIOpenStatusWindow(
hWnd) ;
01173
if (
ImeUIMakeInfoString(ConTbl,
01174 lpModeInfo))
01175 {
01176
ConsoleImeSendMessage( ConTbl->
hWndCon,
01177 (WPARAM)
hWnd,
01178 (LPARAM)&CopyData
01179 ) ;
01180 }
01181 }
01182 }
01183 }
01184
else
01185 {
01186
01187
SetNLSMode(
hWnd, hConsole,ConTbl->
dwConversion & ~
IME_CMODE_OPEN ) ;
01188 lpModeInfo->
ModeStringLen = 0 ;
01189 lpModeInfo->
Position =
VIEW_RIGHT ;
01190
ConsoleImeSendMessage( ConTbl->
hWndCon,
01191 (WPARAM)
hWnd,
01192 (LPARAM)&CopyData
01193 ) ;
01194 }
01195
01196 LocalFree( lpModeInfo );
01197
01198
return TRUE;
01199 }
01200
01201
BOOL
01202 InputLangchange(
01203 HWND hWnd,
01204 DWORD CharSet,
01205 HKL hkl
01206 )
01207 {
01208
PCONSOLE_TABLE ConTbl;
01209
01210 ConTbl =
SearchConsole(
LastConsole);
01211
if (ConTbl ==
NULL) {
01212
DBGPRINT((
"CONIME: Error! Cannot found registed Console\n"));
01213
return FALSE;
01214 }
01215
01216 ConTbl->
hklActive = hkl;
01217
ActivateKeyboardLayout(ConTbl->
hklActive, 0);
01218
GetIMEName( ConTbl );
01219
ImeUIOpenStatusWindow(
hWnd);
01220
return TRUE;
01221 }
01222
01223
01224
01225
01226 LRESULT
01227 ConsoleImeSendMessage(
01228 HWND hWndConsoleIME,
01229 WPARAM wParam,
01230 LPARAM lParam
01231 )
01232 {
01233 LRESULT lResult;
01234 LRESULT fNoTimeout;
01235
01236
if (hWndConsoleIME ==
NULL)
01237 {
01238
return FALSE;
01239 }
01240
01241 fNoTimeout =
SendMessageTimeout(hWndConsoleIME,
01242 WM_COPYDATA,
01243 wParam,
01244 lParam,
01245 SMTO_ABORTIFHUNG | SMTO_NORMAL,
01246
CONIME_SENDMSG_TIMEOUT,
01247 &lResult);
01248
01249
if (fNoTimeout)
01250 {
01251
return TRUE;
01252 }
01253
01254
01255
01256
01257
01258
01259
01260 KdPrint((
"ConsoleImeSendMessage: CONIME_SENDMSG_COUNT is hung up\n"));
01261
01262
return FALSE;
01263
01264 }
01265
01266
#ifdef DEBUG_MODE
01267
01268
int cxMetrics;
01269
int cyMetrics;
01270
int cxOverTypeCaret;
01271
int xPos;
01272
int xPosLast;
01273
int CaretWidth;
01274
01275 WCHAR ConvertLine[
CVMAX];
01276
unsigned char ConvertLineAtr[
CVMAX];
01277
01278 WCHAR DispTitle[] = TEXT(
" Console Handle");
01279
01280
DWORD CompColor[ 8 ] = { RGB( 0, 0, 0 ),
01281 RGB( 0, 0, 255 ),
01282 RGB( 0, 255, 0 ),
01283 RGB( 255, 0, 0 ),
01284 RGB( 255, 0, 255 ),
01285 RGB( 0, 255, 255 ),
01286 RGB( 255, 255, 0 ),
01287 RGB( 255, 255, 255 ) };
01288
01289
VOID
01290 DisplayConvInformation(
01291 HWND hWnd
01292 )
01293 {
01294 RECT
Rect;
01295 HDC lhdc;
01296
01297 lhdc =
GetDC(hWnd);
01298
GetClientRect(hWnd, &Rect);
01299
01300 InvalidateRect(hWnd,NULL,FALSE);
01301
UpdateWindow(hWnd);
01302
ReleaseDC(hWnd, lhdc);
01303 }
01304
01305
VOID
01306 DisplayInformation(
01307 HWND hWnd,
01308 HANDLE hConsole
01309 )
01310 {
01311
PCONSOLE_TABLE ConTbl;
01312 RECT
Rect;
01313 HDC lhdc;
01314
01315 ConTbl =
SearchConsole(hConsole);
01316
if (ConTbl ==
NULL) {
01317
DBGPRINT((
"CONIME: Error! Cannot found registed Console\n"));
01318
return;
01319 }
01320
01321 lhdc =
GetDC(hWnd);
01322
GetClientRect(hWnd, &Rect);
01323
01324 wsprintf(ConTbl->DispBuf, TEXT(
"%08x"), (ULONG)hConsole);
01325
01326 InvalidateRect(hWnd,NULL,FALSE);
01327
UpdateWindow(hWnd);
01328
ReleaseDC(hWnd, lhdc);
01329 }
01330
01331
VOID
01332 RealReDraw(
01333 HDC r_hdc
01334 )
01335 {
01336
PCONSOLE_TABLE ConTbl;
01337
INT ix, iy, i, rx, sx;
01338 ULONG cnt;
01339
int ColorIndex;
01340
int PrevColorIndex;
01341
DWORD dwColor;
01342
01343 iy = 0;
01344
01345 dwColor = GetTextColor( r_hdc );
01346
01347 ColorIndex = ( ((
int)ConvertLineAtr[0]) < 0 ) ? 0 : (
int)ConvertLineAtr[0];
01348 ColorIndex = ( ColorIndex > 7 ) ? 0 : ColorIndex;
01349 PrevColorIndex = ColorIndex;
01350 SetTextColor( r_hdc, CompColor[ ColorIndex ] );
01351
01352 rx = 0;
01353 sx = 0;
01354
for (ix = 0; ix <
MAXCOL; ) {
01355
for (i = ix; i <
MAXCOL; i++) {
01356
if (PrevColorIndex != (
int)ConvertLineAtr[i])
01357
break;
01358 rx +=
IsUnicodeFullWidth(ConvertLine[ix]) ? 2 : 1;
01359 }
01360 TextOut( r_hdc, sx * cxMetrics, iy, &ConvertLine[ix], i-ix );
01361 sx = rx;
01362 ColorIndex = ( ((
int)ConvertLineAtr[i]) < 0 ) ? 0 : (
int)ConvertLineAtr[i];
01363 ColorIndex = ( ColorIndex > 7 ) ? 0 : ColorIndex;
01364 PrevColorIndex = ColorIndex;
01365 SetTextColor( r_hdc, CompColor[ ColorIndex ] );
01366 ix = i;
01367 }
01368
01369 ix = 0;
01370 SetTextColor( r_hdc, dwColor );
01371 iy += cyMetrics;
01372 TextOut( r_hdc, ix, iy, DispTitle, lstrlenW(DispTitle));
01373
01374 iy += cyMetrics;
01375
01376
LockConsoleTable();
01377
01378
for (cnt = 1; cnt <
NumberOfConsoleTable; cnt++, iy += cyMetrics){
01379 ConTbl =
ConsoleTable[cnt];
01380
if (ConTbl !=
NULL)
01381 {
01382
if (ConTbl->
hConsole)
01383 {
01384 TextOut( r_hdc, ix, iy, ConTbl->DispBuf, lstrlenW(ConTbl->DispBuf) );
01385 }
01386 }
01387 }
01388
01389
UnlockConsoleTable();
01390
01391
return;
01392 }
01393
01394
VOID
01395 ReDraw(
01396 HWND hWnd
01397 )
01398 {
01399 HDC r_hdc;
01400 RECT ClientRect;
01401
01402
GetClientRect(hWnd, &ClientRect);
01403 r_hdc =
GetDC(hWnd);
01404
FillRect(r_hdc, &ClientRect, GetStockObject(WHITE_BRUSH));
01405 RealReDraw(r_hdc);
01406
ReleaseDC(hWnd, r_hdc);
01407
return;
01408 }
01409
#endif