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.

81 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1985 - 1999, Microsoft Corporation
  3. Module Name:
  4. uiwnd.cpp
  5. Abstract:
  6. This file implements the UI Window Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #include "private.h"
  12. #include "uiwnd.h"
  13. #include "globals.h"
  14. #include "cdimm.h"
  15. BOOL
  16. CUIWindow::CreateUIWindow(
  17. HKL hKL
  18. )
  19. {
  20. WCHAR achIMEWndClass[16];
  21. UINT_PTR ulPrivate;
  22. // consider: BOGUS fix: we are sengin WM_IME_SELECT twice on non-fe
  23. // so we get here twice and create two windows, which can ultimately
  24. // crash the process....
  25. // real fix: stop aimm from sending x2 WM_IME_SELECT
  26. if (_hUIWnd != 0)
  27. {
  28. // Assert(0);
  29. return TRUE;
  30. }
  31. CActiveIMM *_this = GetTLS();
  32. if (_this == NULL)
  33. return 0;
  34. if (_this->_GetIMEWndClassName(hKL,
  35. achIMEWndClass,
  36. sizeof(achIMEWndClass)/sizeof(WCHAR),
  37. &ulPrivate) == 0) {
  38. ASSERT(FALSE);
  39. return FALSE;
  40. }
  41. char achMBCS[32];
  42. // consider: probably need to stipulate somewhere that ui class name must be in ascii
  43. // to avoid CP_ACP problems....
  44. AssertE(WideCharToMultiByte(CP_ACP, 0, achIMEWndClass, -1, achMBCS, sizeof(achMBCS), NULL, NULL) != 0);
  45. //
  46. // create the ime's ui window
  47. // we create an ANSI IME UI window because Win9x platform doesn't have Unicode function.
  48. //
  49. _hUIWnd = CreateWindowExA(0,
  50. achMBCS,
  51. achMBCS,
  52. WS_POPUP | WS_DISABLED,
  53. 0, 0, 0, 0,
  54. NULL, 0, g_hInst, (void *)ulPrivate);
  55. if (_hUIWnd == NULL) {
  56. GetLastError();
  57. ASSERT(_hUIWnd);
  58. return FALSE;
  59. }
  60. return TRUE;
  61. }