src/video/windows/SDL_windowskeyboard.c
changeset 5090 327f181542f1
parent 5086 c2539ff054c8
child 5108 d68e9722ff4d
     1.1 --- a/src/video/windows/SDL_windowskeyboard.c	Mon Jan 24 17:47:18 2011 -0800
     1.2 +++ b/src/video/windows/SDL_windowskeyboard.c	Mon Jan 24 21:20:30 2011 -0800
     1.3 @@ -312,15 +312,15 @@
     1.4          CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr);
     1.5      }
     1.6      videodata->ime_initialized = SDL_TRUE;
     1.7 -    videodata->ime_himm32 = LoadLibraryA("imm32.dll");
     1.8 +    videodata->ime_himm32 = SDL_LoadObject("imm32.dll");
     1.9      if (!videodata->ime_himm32) {
    1.10          videodata->ime_available = SDL_FALSE;
    1.11          return;
    1.12      }
    1.13 -    videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))GetProcAddress(videodata->ime_himm32, "ImmLockIMC");
    1.14 -    videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))GetProcAddress(videodata->ime_himm32, "ImmUnlockIMC");
    1.15 -    videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))GetProcAddress(videodata->ime_himm32, "ImmLockIMCC");
    1.16 -    videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))GetProcAddress(videodata->ime_himm32, "ImmUnlockIMCC");
    1.17 +    videodata->ImmLockIMC = (LPINPUTCONTEXT2 (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMC");
    1.18 +    videodata->ImmUnlockIMC = (BOOL (WINAPI *)(HIMC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMC");
    1.19 +    videodata->ImmLockIMCC = (LPVOID (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmLockIMCC");
    1.20 +    videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC");
    1.21  
    1.22      IME_SetWindow(videodata, hwnd);
    1.23      videodata->ime_himc = ImmGetContext(hwnd);
    1.24 @@ -383,7 +383,7 @@
    1.25      videodata->ime_hwnd_main = 0;
    1.26      videodata->ime_himc = 0;
    1.27      if (videodata->ime_himm32) {
    1.28 -        FreeLibrary(videodata->ime_himm32);
    1.29 +        SDL_UnloadObject(videodata->ime_himm32);
    1.30          videodata->ime_himm32 = 0;
    1.31      }
    1.32      if (videodata->ime_threadmgr) {
    1.33 @@ -606,7 +606,7 @@
    1.34  IME_SetupAPI(SDL_VideoData *videodata)
    1.35  {
    1.36      char ime_file[MAX_PATH + 1];
    1.37 -    HMODULE hime = 0;
    1.38 +    void* hime = 0;
    1.39      HKL hkl = 0;
    1.40      videodata->GetReadingString = 0;
    1.41      videodata->ShowReadingWindow = 0;
    1.42 @@ -617,14 +617,14 @@
    1.43      if (ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1) <= 0)
    1.44          return;
    1.45  
    1.46 -    hime = LoadLibraryA(ime_file);
    1.47 +    hime = SDL_LoadObject(ime_file);
    1.48      if (!hime)
    1.49          return;
    1.50  
    1.51      videodata->GetReadingString = (UINT (WINAPI *)(HIMC, UINT, LPWSTR, PINT, BOOL*, PUINT))
    1.52 -        GetProcAddress(hime, "GetReadingString");
    1.53 +        SDL_LoadFunction(hime, "GetReadingString");
    1.54      videodata->ShowReadingWindow = (BOOL (WINAPI *)(HIMC, BOOL))
    1.55 -        GetProcAddress(hime, "ShowReadingWindow");
    1.56 +        SDL_LoadFunction(hime, "ShowReadingWindow");
    1.57  
    1.58      if (videodata->ShowReadingWindow) {
    1.59          HIMC himc = ImmGetContext(videodata->ime_hwnd_current);