Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » win32 multiscreen / multimonitor problem fix
win32 multiscreen / multimonitor problem fix [message #19509] Tue, 09 December 2008 23:28 Go to next message
mst99 is currently offline  mst99
Messages: 1
Registered: December 2008
Junior Member
I'm new u++ user and I'm very impressed by it. Smile

Working under win32 with multiscreen / monitors and running theide or testapps on my right (extended) screen I found little problem that some menu items, popups and top windows was shown on the left (main) and not on the right (extended) screen.

Here is a small, perhaps dirty hack which resolved my problem.

martin

modified CtrlCore/Win32Wnd.cpp:
<----------- snip ---------------->
Rect Ctrl::GetWorkArea() const
{
// return MonitorRectForHWND(GetHWND());
// mst:2008-12-08, hack for better multimonitor support.
HWND hwnd = GetHWND();
if (!hwnd && parent)
hwnd = parent->GetTopCtrl()->GetHWND();
if (!hwnd && top && top->owner)
hwnd = top->owner->GetTopCtrl()->GetHWND();
if (!hwnd)
hwnd = ::GetFocus();
return MonitorRectForHWND(hwnd);
}
Re: win32 multiscreen / multimonitor problem fix [message #19511 is a reply to message #19509] Wed, 10 December 2008 00:25 Go to previous message
rylek is currently offline  rylek
Messages: 79
Registered: November 2005
Member
Hello!

Thanks, accepted into the live U++ tree with slight code compression and avoiding to use internal Ctrl variables, please check for errors ;-):

Rect Ctrl::GetWorkArea() const
{
// return MonitorRectForHWND(GetHWND());
// mst:2008-12-08, hack for better multimonitor support.
	const Ctrl *topctl = GetTopCtrl();
	HWND hwnd = topctl->GetHWND();
	if(!hwnd && !((topctl = topctl->GetOwnerCtrl()) && (hwnd = topctl->GetHWND())))
		hwnd = ::GetFocus();
	return MonitorRectForHWND(hwnd);
}


Regards

Tom
Previous Topic: Propose a slight change to DropCoice/WithDropChoice
Next Topic: Context menu in a embedded class?
Goto Forum:
  


Current Time: Wed Apr 24 04:47:08 CEST 2024

Total time taken to generate the page: 0.03306 seconds