ecore_win32: use AddClipboardFormatListener and RemoveClipboardFormatListener explicitely
authorVincent Torri <vincent.torri@gmail.com>
Wed, 17 Apr 2019 21:31:21 +0000 (17:31 -0400)
committerYeongjong Lee <yj34.lee@samsung.com>
Wed, 24 Apr 2019 05:24:47 +0000 (14:24 +0900)
instead of loading them from user32.dll

Summary: current mingw-w64 declare these functions

Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8644

src/lib/ecore_win32/ecore_win32.c

index 657f9b8..f2f0dc6 100644 (file)
@@ -37,9 +37,6 @@ DEFINE_OLEGUID(IID_IUnknown,       0x00000000L, 0, 0);
 
 #define IDI_ICON 101
 
-typedef BOOL WINAPI (*efl_AddClipboardFormatListener)(_In_ HWND hwnd);
-typedef BOOL WINAPI (*efl_RemoveClipboardFormatListener)(_In_ HWND hwnd);
-
 static int _ecore_win32_init_count = 0;
 
 LRESULT CALLBACK
@@ -199,31 +196,17 @@ _ecore_win32_window_procedure(HWND   window,
        /* Window notifications */
      case WM_CREATE:
        {
-          efl_AddClipboardFormatListener acfl;
-
           INF("create window message");
-
-          acfl = (efl_AddClipboardFormatListener)GetProcAddress(GetModuleHandle("user32.dll"),
-                                                                "AddClipboardFormatListener");
-          if (acfl)
-            {
-               if (!acfl(window))
-                 INF("can not create clipboard format listener; no clipboard notification will be sent");
-            }
+          if (!AddClipboardFormatListener(window))
+            INF("can not create clipboard format listener; no clipboard notification will be sent");
        _ecore_win32_event_handle_create_notify(data);
        return 0;
        }
      case WM_DESTROY:
        {
-          efl_RemoveClipboardFormatListener rcfl;
-
           INF("destroy window message");
           _ecore_win32_event_handle_destroy_notify(data);
-
-          rcfl = (efl_RemoveClipboardFormatListener)GetProcAddress(GetModuleHandle("user32.dll"),
-                                                                   "RemoveClipboardFormatListener");
-          if (rcfl)
-            rcfl(window);
+          RemoveClipboardFormatListener(window);
           return 0;
        }
      case WM_SHOWWINDOW: