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.

78 lines
2.4 KiB

  1. /****************************************************************************
  2. FOCUS.CPP : CKorIMX's Candidate UI member functions implementation
  3. History:
  4. 08-FEB-2000 CSLim Created
  5. ****************************************************************************/
  6. #include "private.h"
  7. #include "korimx.h"
  8. #include "immxutil.h"
  9. #include "globals.h"
  10. /*---------------------------------------------------------------------------
  11. CKorIMX::OnSetThreadFocus (Called from Activate)
  12. This methods is called when the user switches focus between threads.
  13. TIP should restore its ui (status windows, etc.) in this case.
  14. ---------------------------------------------------------------------------*/
  15. STDAPI CKorIMX::OnSetThreadFocus()
  16. {
  17. TraceMsg(TF_GENERAL, "ActivateUI: (%x) fActivate = %x, wnd thread = %x",
  18. GetCurrentThreadId(), TRUE, GetWindowThreadProcessId(GetOwnerWnd(), NULL));
  19. if (m_pCandUI != NULL)
  20. {
  21. ITfCandUICandWindow *pCandWindow;
  22. if (SUCCEEDED(m_pCandUI->GetUIObject(IID_ITfCandUICandWindow, (IUnknown**)&pCandWindow)))
  23. {
  24. pCandWindow->Show(fTrue);
  25. pCandWindow->Release();
  26. }
  27. }
  28. if (m_pToolBar)
  29. m_pToolBar->SetUIFocus(fTrue);
  30. if (IsSoftKbdEnabled())
  31. SoftKbdOnThreadFocusChange(fTrue);
  32. return S_OK;
  33. }
  34. /*---------------------------------------------------------------------------
  35. CKorIMX::OnKillThreadFocus (Called from Deactivate)
  36. This methods is called when the user switches focus between threads.
  37. TIP should hide its ui (status windows, etc.) in this case.
  38. ---------------------------------------------------------------------------*/
  39. STDAPI CKorIMX::OnKillThreadFocus()
  40. {
  41. TraceMsg(TF_GENERAL, "DeactivateUI: (%x) wnd thread = %x",
  42. GetCurrentThreadId(), GetWindowThreadProcessId(GetOwnerWnd(), NULL));
  43. if (m_pCandUI != NULL)
  44. {
  45. ITfCandUICandWindow *pCandWindow;
  46. if (SUCCEEDED(m_pCandUI->GetUIObject(IID_ITfCandUICandWindow, (IUnknown**)&pCandWindow)))
  47. {
  48. pCandWindow->Show(fFalse);
  49. pCandWindow->Release();
  50. }
  51. }
  52. #if 0
  53. m_pStatusWnd->Show(FALSE);
  54. #endif
  55. if (m_pToolBar)
  56. m_pToolBar->SetUIFocus(fFalse);
  57. if (IsSoftKbdEnabled())
  58. SoftKbdOnThreadFocusChange(fFalse);
  59. return S_OK;
  60. }