}
}
+typedef struct _WXADllVersionInfo
+{
+ DWORD cbSize;
+ DWORD dwMajorVersion; // Major version
+ DWORD dwMinorVersion; // Minor version
+ DWORD dwBuildNumber; // Build number
+ DWORD dwPlatformID; // DLLVER_PLATFORM_*
+} WXADLLVERSIONINFO;
+
+typedef HRESULT (CALLBACK* WXADLLGETVERSIONPROC)(WXADLLVERSIONINFO *);
+
/* static */
int wxApp::GetComCtl32Version()
{
// do we have it?
HMODULE hModuleComCtl32 = ::GetModuleHandle(wxT("COMCTL32"));
+ BOOL bFreeComCtl32 = FALSE ;
+ if(!hModuleComCtl32)
+ {
+ hModuleComCtl32 = ::LoadLibrary(wxT("COMCTL32.DLL")) ;
+ if(hModuleComCtl32)
+ {
+ bFreeComCtl32 = TRUE ;
+ }
+ }
// if so, then we can check for the version
if ( hModuleComCtl32 )
{
// try to use DllGetVersion() if available in _headers_
- #ifdef DLLVER_PLATFORM_WINDOWS // defined in shlwapi.h
- DLLGETVERSIONPROC pfnDllGetVersion = (DLLGETVERSIONPROC)
+ WXADLLGETVERSIONPROC pfnDllGetVersion = (WXADLLGETVERSIONPROC)
::GetProcAddress(hModuleComCtl32, "DllGetVersion");
if ( pfnDllGetVersion )
{
- DLLVERSIONINFO dvi;
+ WXADLLVERSIONINFO dvi;
dvi.cbSize = sizeof(dvi);
HRESULT hr = (*pfnDllGetVersion)(&dvi);
dvi.dwMinorVersion;
}
}
- #endif
// DllGetVersion() unavailable either during compile or
// run-time, try to guess the version otherwise
if ( !s_verComCtl32 )
}
}
}
+
+ if(bFreeComCtl32)
+ {
+ ::FreeLibrary(hModuleComCtl32) ;
+ }
}
return s_verComCtl32;
// finally do insert it
if ( TabCtrl_InsertItem(m_hwnd, nPage, &tcItem) == -1 )
{
-// Hit test
-int wxNotebook::HitTest(const wxPoint& pt, long& flags)
-{
- TC_HITTESTINFO hitTestInfo;
- hitTestInfo.pt.x = pt.x;
- hitTestInfo.pt.y = pt.y;
- int item = TabCtrl_HitTest( (HWND) GetHWND(), & hitTestInfo ) ;
- flags = 0;
-
- if ((hitTestInfo.flags & TCHT_NOWHERE) == TCHT_NOWHERE)
- flags |= wxNB_HITTEST_NOWHERE;
- if ((hitTestInfo.flags & TCHT_ONITEMICON) == TCHT_ONITEMICON)
- flags |= wxNB_HITTEST_ONICON;
- if ((hitTestInfo.flags & TCHT_ONITEMLABEL) == TCHT_ONITEMLABEL)
- flags |= wxNB_HITTEST_ONLABEL;
-
- return item;
-}
-
wxLogError(wxT("Can't create the notebook page '%s'."), strText.c_str());
return FALSE;
return TRUE;
}
+// Hit test
+int wxNotebook::HitTest(const wxPoint& pt, long& flags)
+{
+ TC_HITTESTINFO hitTestInfo;
+ hitTestInfo.pt.x = pt.x;
+ hitTestInfo.pt.y = pt.y;
+ int item = TabCtrl_HitTest( (HWND) GetHWND(), & hitTestInfo ) ;
+ flags = 0;
+
+ if ((hitTestInfo.flags & TCHT_NOWHERE) == TCHT_NOWHERE)
+ flags |= wxNB_HITTEST_NOWHERE;
+ if ((hitTestInfo.flags & TCHT_ONITEMICON) == TCHT_ONITEMICON)
+ flags |= wxNB_HITTEST_ONICON;
+ if ((hitTestInfo.flags & TCHT_ONITEMLABEL) == TCHT_ONITEMLABEL)
+ flags |= wxNB_HITTEST_ONLABEL;
+
+ return item;
+}
+
// ----------------------------------------------------------------------------
// wxNotebook callbacks
// ----------------------------------------------------------------------------