imm32: Only unregister the IME class if it was registered.

This commit is contained in:
Patrik Stridvall 2007-01-08 00:16:02 +01:00 committed by Alexandre Julliard
parent aea09ade58
commit 4ef65b1e26
1 changed files with 5 additions and 2 deletions

View File

@ -60,6 +60,7 @@ static InputContextData *root_context = NULL;
static HWND hwndDefault = NULL; static HWND hwndDefault = NULL;
static HANDLE hImeInst; static HANDLE hImeInst;
static const WCHAR WC_IMECLASSNAME[] = {'I','M','E',0}; static const WCHAR WC_IMECLASSNAME[] = {'I','M','E',0};
static ATOM atIMEClass = 0;
/* MSIME messages */ /* MSIME messages */
static UINT WM_MSIME_SERVICE; static UINT WM_MSIME_SERVICE;
@ -109,12 +110,14 @@ static void IMM_Register(void)
wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW +1);
wndClass.lpszMenuName = 0; wndClass.lpszMenuName = 0;
wndClass.lpszClassName = WC_IMECLASSNAME; wndClass.lpszClassName = WC_IMECLASSNAME;
RegisterClassW(&wndClass); atIMEClass = RegisterClassW(&wndClass);
} }
static void IMM_Unregister(void) static void IMM_Unregister(void)
{ {
UnregisterClassW(WC_IMECLASSNAME, NULL); if (atIMEClass) {
UnregisterClassW(WC_IMECLASSNAME, NULL);
}
} }
static void IMM_RegisterMessages(void) static void IMM_RegisterMessages(void)