display enumeration functions are in coredll.dll and not user32.dll under CE (closes #10189) [backport of r52077]

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@56865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-11-20 17:46:46 +00:00
parent fdeef79bfb
commit 2f86dfdf1e
2 changed files with 19 additions and 11 deletions

View File

@@ -119,6 +119,7 @@ wxMSW:
- Fixed wxArtProvider::GetSizeHint() to return 16x16 for wxART_FRAME_ICON.
- Fixed toolbar buttons so that they don't disappear temporarily when clicked
if the event handler causes window update.
- Fix display enumeration under WinCE (Vince Harron).
wxGTK:

View File

@@ -86,6 +86,13 @@
{ 0xB3A6F3E0, 0x2B43, 0x11CF, { 0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 } };
#endif // wxUSE_DIRECTDRAW
// display functions are found in different DLLs under WinCE and normal Win32
#ifdef __WXWINCE__
static const wxChar displayDllName[] = _T("coredll.dll");
#else
static const wxChar displayDllName[] = _T("user32.dll");
#endif
// ----------------------------------------------------------------------------
// typedefs for dynamically loaded Windows functions
// ----------------------------------------------------------------------------
@@ -511,28 +518,28 @@ wxDisplayFactoryWin32Base::wxDisplayFactoryWin32Base()
{
ms_supportsMultimon = 0;
wxDynamicLibrary dllUser32(_T("user32.dll"));
wxLogNull noLog;
wxDynamicLibrary dllDisplay(displayDllName, wxDL_VERBATIM);
gs_MonitorFromPoint = (MonitorFromPoint_t)
dllUser32.GetSymbol(wxT("MonitorFromPoint"));
dllDisplay.GetSymbol(wxT("MonitorFromPoint"));
if ( !gs_MonitorFromPoint )
return;
gs_MonitorFromWindow = (MonitorFromWindow_t)
dllUser32.GetSymbol(wxT("MonitorFromWindow"));
dllDisplay.GetSymbol(wxT("MonitorFromWindow"));
if ( !gs_MonitorFromWindow )
return;
gs_GetMonitorInfo = (GetMonitorInfo_t)
dllUser32.GetSymbolAorW(wxT("GetMonitorInfo"));
dllDisplay.GetSymbolAorW(wxT("GetMonitorInfo"));
if ( !gs_GetMonitorInfo )
return;
ms_supportsMultimon = 1;
// we can safely let dllUser32 go out of scope, the DLL itself will
// we can safely let dllDisplay go out of scope, the DLL itself will
// still remain loaded as all Win32 programs use it
}
}
@@ -598,9 +605,9 @@ wxDisplayFactoryMultimon::wxDisplayFactoryMultimon()
{
wxLogNull noLog;
wxDynamicLibrary dllUser32(_T("user32.dll"));
wxDynamicLibrary dllDisplay(displayDllName, wxDL_VERBATIM);
pfnEnumDisplayMonitors = (EnumDisplayMonitors_t)
dllUser32.GetSymbol(wxT("EnumDisplayMonitors"));
dllDisplay.GetSymbol(wxT("EnumDisplayMonitors"));
if ( !pfnEnumDisplayMonitors )
return;
}
@@ -743,11 +750,11 @@ bool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode)
static ChangeDisplaySettingsEx_t pfnChangeDisplaySettingsEx = NULL;
if ( !pfnChangeDisplaySettingsEx )
{
wxDynamicLibrary dllUser32(_T("user32.dll"));
if ( dllUser32.IsLoaded() )
wxDynamicLibrary dllDisplay(displayDllName, wxDL_VERBATIM);
if ( dllDisplay.IsLoaded() )
{
pfnChangeDisplaySettingsEx = (ChangeDisplaySettingsEx_t)
dllUser32.GetSymbolAorW(_T("ChangeDisplaySettingsEx"));
dllDisplay.GetSymbolAorW(_T("ChangeDisplaySettingsEx"));
}
//else: huh, no user32.dll??