hw/xwin: Link directly to TrackMouseEvent()

TrackMouseEvent has existed in user32 since at least NT4, so
don't bother with jumping through all the ancient compatibility hoops
of finding if _TrackMouseEvent() exists in comctl32 so it can check
if TrackMouseEvent() exists in user32 to see if it needs to emulate
it...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This commit is contained in:
Jon TURNEY 2011-04-16 23:28:45 +01:00
parent e2e6fab1ef
commit ee19853867
6 changed files with 6 additions and 49 deletions

View File

@ -70,12 +70,6 @@ extern HWND g_hwndClipboard;
extern Bool g_fClipboard;
#endif
/*
module handle for dynamically loaded comctl32 library
*/
static HMODULE g_hmodCommonControls = NULL;
/*
* Function prototypes
*/
@ -235,14 +229,6 @@ ddxGiveUp (enum ExitCode error)
* we are guaranteed to not need the DirectDraw functions.
*/
winReleaseDDProcAddresses();
/* Unload our TrackMouseEvent function pointer */
if (g_hmodCommonControls != NULL)
{
FreeLibrary (g_hmodCommonControls);
g_hmodCommonControls = NULL;
g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
}
/* Free concatenated command line */
free(g_pszCommandLine);
@ -979,27 +965,6 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[])
/* Detect supported engines */
winDetectSupportedEngines ();
/* Load common controls library */
g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0);
/* Load TrackMouseEvent function pointer */
g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls,
"_TrackMouseEvent");
if (g_fpTrackMouseEvent == NULL)
{
winErrorFVerb (1, "InitOutput - Could not get pointer to function\n"
"\t_TrackMouseEvent in comctl32.dll. Try installing\n"
"\tInternet Explorer 3.0 or greater if you have not\n"
"\talready.\n");
/* Free the library since we won't need it */
FreeLibrary (g_hmodCommonControls);
g_hmodCommonControls = NULL;
/* Set function pointer to point to no operation function */
g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
}
/* Store the instance handle */
g_hInstance = GetModuleHandle (NULL);

View File

@ -673,7 +673,6 @@ extern DeviceIntPtr g_pwinKeyboard;
extern FARPROC g_fpDirectDrawCreate;
extern FARPROC g_fpDirectDrawCreateClipper;
extern FARPROC g_fpTrackMouseEvent;
/*

View File

@ -78,13 +78,6 @@ Bool g_fSoftwareCursor = FALSE;
Bool g_fSilentDupError = FALSE;
Bool g_fNativeGl = FALSE;
/*
* Global variables for dynamically loaded libraries and
* their function pointers
*/
FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA;
#ifdef XWIN_CLIPBOARD
/*

View File

@ -549,8 +549,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
tme.hwndTrack = hwnd;
/* Call the tracking function */
if (!(*g_fpTrackMouseEvent) (&tme))
ErrorF ("winTopLevelWindowProc - _TrackMouseEvent failed\n");
if (!TrackMouseEvent(&tme))
ErrorF ("winTopLevelWindowProc - TrackMouseEvent failed\n");
/* Flag that we are tracking now */
s_fTracking = TRUE;

View File

@ -547,8 +547,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
tme.hwndTrack = hwnd;
/* Call the tracking function */
if (!(*g_fpTrackMouseEvent) (&tme))
ErrorF ("winMWExtWMWindowProc - _TrackMouseEvent failed\n");
if (!TrackMouseEvent(&tme))
ErrorF ("winMWExtWMWindowProc - TrackMouseEvent failed\n");
/* Flag that we are tracking now */
s_fTracking = TRUE;

View File

@ -776,8 +776,8 @@ winWindowProc (HWND hwnd, UINT message,
tme.hwndTrack = hwnd;
/* Call the tracking function */
if (!(*g_fpTrackMouseEvent) (&tme))
ErrorF ("winWindowProc - _TrackMouseEvent failed\n");
if (!TrackMouseEvent(&tme))
ErrorF ("winWindowProc - TrackMouseEvent failed\n");
/* Flag that we are tracking now */
s_fTracking = TRUE;