U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » TopWindow&PopUp, TrayIcon » Multiple windows and focus
Re: Multiple windows and focus [message #10386 is a reply to message #10369] Thu, 05 July 2007 07:36 Go to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
mrjt wrote on Wed, 04 July 2007 08:07

		win->SetForeground();
		win->SetFocus();

Works fine for me. Also you don't need to call LostFocus, this will be done for you.

Now, some other suggestions:
'delete this' should never be used as it relies on the object being created by 'new'. Have the owner set the TopWindow::WhenClose callback to a function that deletes it instead.



Actually, multiple peer windows scenario is one of exceptions to U++ common scope based resource management.

In this case is often the simplest thing to 'new' main windows and to use 'delete this' to close them. See UWord example.

Of course, it is also possible to deal with this using Array of windows or something like that, but we have found that in this particular situation, it is only more complex...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can't get rid of minimize button on Linux, okay on Win32
Next Topic: System tray on windows
Goto Forum:
  


Current Time: Sat May 30 04:29:48 GMT+2 2026

Total time taken to generate the page: 0.00524 seconds