Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.9 KiB

  1. /****************************************************************************
  2. PAD.CPP
  3. Owner: cslim
  4. Copyright (c) 1997-1999 Microsoft Corporation
  5. IME PAD wrapper functions
  6. History:
  7. 10-APR-1999 cslim Created
  8. *****************************************************************************/
  9. #include "precomp.h"
  10. #include "cpadsvr.h"
  11. #include "pad.h"
  12. #include "cimecb.h"
  13. BOOL BootPad(HWND hUIWnd, UINT uiType, LPARAM lParam)
  14. {
  15. LPCImePadSvr lpCImePadSvr;
  16. HIMC hIMC;
  17. IImeIPoint1* pIP;
  18. INT iRet;
  19. BOOL fVisible;
  20. BOOL fRet = fFalse;
  21. Dbg(DBGID_IMEPAD, TEXT("BootPad() : hUIWnd = 0x%04X, uiType = 0x%04X, lParam = 0x%08lX"), hUIWnd, uiType, lParam);
  22. lpCImePadSvr = CImePadSvr::LoadCImePadSvr(CIMEPADSVR_SHAREDMEM);
  23. if(lpCImePadSvr)
  24. {
  25. // Check if already visible state. Toggle IME Pad
  26. lpCImePadSvr->IsVisible(&fVisible);
  27. if (fVisible)
  28. {
  29. lpCImePadSvr->ShowUI(fFalse);
  30. // CImePadSvr::DestroyCImePadSvr();
  31. return fTrue;
  32. }
  33. iRet = lpCImePadSvr->Initialize(MAKELANGID(LANG_KOREAN, SUBLANG_DEFAULT), 0, NULL);
  34. DbgAssert(iRet == 0);
  35. if (iRet ==0) // Succeeded
  36. {
  37. hIMC = GethImcFromHwnd(hUIWnd);
  38. pIP = GetImeIPoint(hIMC);
  39. if (pIP)
  40. {
  41. lpCImePadSvr->SetIUnkIImeIPoint((IUnknown *)pIP);
  42. lpCImePadSvr->SetIUnkIImeCallback((IUnknown *)CImeCallback::Fetch());
  43. lpCImePadSvr->ShowUI(fTrue);
  44. }
  45. else
  46. {
  47. DbgAssert(0);
  48. return fFalse;
  49. }
  50. fRet = fTrue;
  51. }
  52. else
  53. CImePadSvr::DestroyCImePadSvr();
  54. }
  55. return fRet;
  56. }