forked from AuroraMiddleware/gtk
Just use TrackMouseEvent directly
TrackMouseEvent is present in user32.dll in all Windows versions we support. No need to look it up dynamically. No need to fallback to _TrackMouseEvent from comctrl32.dll.
This commit is contained in:
parent
00ce32d940
commit
f42814168c
@ -152,40 +152,19 @@ static void
|
|||||||
track_mouse_event (DWORD dwFlags,
|
track_mouse_event (DWORD dwFlags,
|
||||||
HWND hwnd)
|
HWND hwnd)
|
||||||
{
|
{
|
||||||
typedef BOOL (WINAPI *PFN_TrackMouseEvent) (LPTRACKMOUSEEVENT);
|
TRACKMOUSEEVENT tme;
|
||||||
static PFN_TrackMouseEvent p_TrackMouseEvent = NULL;
|
|
||||||
static gboolean once = FALSE;
|
|
||||||
|
|
||||||
if (!once)
|
tme.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||||
{
|
tme.dwFlags = dwFlags;
|
||||||
HMODULE user32;
|
tme.hwndTrack = hwnd;
|
||||||
HINSTANCE commctrl32;
|
tme.dwHoverTime = HOVER_DEFAULT; /* not used */
|
||||||
|
|
||||||
user32 = GetModuleHandle ("user32.dll");
|
if (!TrackMouseEvent (&tme))
|
||||||
if ((p_TrackMouseEvent = (PFN_TrackMouseEvent)GetProcAddress (user32, "TrackMouseEvent")) == NULL)
|
WIN32_API_FAILED ("TrackMouseEvent");
|
||||||
{
|
else if (dwFlags == TME_LEAVE)
|
||||||
if ((commctrl32 = LoadLibrary ("commctrl32.dll")) != NULL)
|
GDK_NOTE (EVENTS, g_print(" (TrackMouseEvent %p)", hwnd));
|
||||||
p_TrackMouseEvent = (PFN_TrackMouseEvent)
|
else if (dwFlags == TME_CANCEL)
|
||||||
GetProcAddress (commctrl32, "_TrackMouseEvent");
|
GDK_NOTE (EVENTS, g_print(" (cancel TrackMouseEvent %p)", hwnd));
|
||||||
}
|
|
||||||
once = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p_TrackMouseEvent)
|
|
||||||
{
|
|
||||||
TRACKMOUSEEVENT tme;
|
|
||||||
tme.cbSize = sizeof(TRACKMOUSEEVENT);
|
|
||||||
tme.dwFlags = dwFlags;
|
|
||||||
tme.hwndTrack = hwnd;
|
|
||||||
tme.dwHoverTime = HOVER_DEFAULT; /* not used */
|
|
||||||
|
|
||||||
if (!p_TrackMouseEvent (&tme))
|
|
||||||
WIN32_API_FAILED ("TrackMouseEvent");
|
|
||||||
else if (dwFlags == TME_LEAVE)
|
|
||||||
GDK_NOTE (EVENTS, g_print(" (TrackMouseEvent %p)", hwnd));
|
|
||||||
else if (dwFlags == TME_CANCEL)
|
|
||||||
GDK_NOTE (EVENTS, g_print(" (cancel TrackMouseEvent %p)", hwnd));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gulong
|
gulong
|
||||||
|
Loading…
Reference in New Issue
Block a user