Discussion:
[Foxgui-users] FxRootWindow::getDefaultWidth/Height() on Windows
Frank Weimer
2017-03-02 13:48:09 UTC
Permalink
Hi Jeroen,

the current Windows-specific implementations of

* FxRootWindow::getDefaultWidth(), and
* FxRootWindow::getDefaultHeight()

seem to return the size of the primary display, not the size of the
complete desktop (as in the Non-Windows implementations).

This approach works fine for me (see GetSystemMetrics
<https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385%28v=vs.85%29.aspx>
documentation):

// Get default width
FXint FXRootWindow::getDefaultWidth(){
#ifdef WIN32
* return GetSystemMetrics(SM_CXVIRTUALSCREEN);*
#else
return
DisplayWidth(DISPLAY(getApp()),DefaultScreen(DISPLAY(getApp())));
#endif
}

// Get default height
FXint FXRootWindow::getDefaultHeight(){
#ifdef WIN32
* return GetSystemMetrics(SM_CYVIRTUALSCREEN);*
#else
return
DisplayHeight(DISPLAY(getApp()),DefaultScreen(DISPLAY(getApp())));
#endif
}

Do you plan to use this approach in future FOX versions?

Kind regards,
Frank
--
\ / Sol-3 GmbH & Co. KG Frank Weimer
--o-- Sol-3 An der KlostermÃŒhle 1 Phone: +49 6123 7029 24
/ \ D-65399 Kiedrich Fax: +49 6123 7029 29
USt-ID: DE 204978307 eMail: ***@sol-3.de
Register: WI HRA 6607
KomplementÀr: Sol-3 Verwaltungs-GmbH
Register: WI HRB 117786
GeschÀftsfÌhrer: Norbert Geus, Dirk Zoller
JVZ
2017-03-02 14:27:00 UTC
Permalink
On Thu, 2 Mar 2017 14:48:09 +0100
Post by Frank Weimer
Hi Jeroen,
the current Windows-specific implementations of
* FxRootWindow::getDefaultWidth(), and
* FxRootWindow::getDefaultHeight()
seem to return the size of the primary display, not the size of the
complete desktop (as in the Non-Windows implementations).
This approach works fine for me (see GetSystemMetrics
<https://msdn.microsoft.com/en-us/library/windows/desktop/ms724385%28v=vs.85%29.aspx>
// Get default width
FXint FXRootWindow::getDefaultWidth(){
#ifdef WIN32
* return GetSystemMetrics(SM_CXVIRTUALSCREEN);*
#else
return
DisplayWidth(DISPLAY(getApp()),DefaultScreen(DISPLAY(getApp())));
#endif
}
// Get default height
FXint FXRootWindow::getDefaultHeight(){
#ifdef WIN32
* return GetSystemMetrics(SM_CYVIRTUALSCREEN);*
#else
return
DisplayHeight(DISPLAY(getApp()),DefaultScreen(DISPLAY(getApp())));
#endif
}
Do you plan to use this approach in future FOX versions?
OK,
I updated this technique in FOX 1.7; next snapshot should have the new code.

Left the old method commented out for now, in case it doesn't work for some
people.



-- JVZ



+----------------------------------------------------------------------------+
| Copyright (C) 08:20 03/ 2/2017 Jeroen van der Zijp. All Rights Reserved. |
+----------------------------------------------------------------------------+
Loading...