Re: [Lazarus] Use rare Win32 API in LCLIntf.SetForegroundWindow

2017-05-24 Thread Denis Kozlov via Lazarus


I would advise strongly against the use of SwitchToThisWindow API 
function in Lazarus. Mainly because it states in the docs: /This 
function is not intended for general use. It may be altered or 
unavailable in subsequent versions of Windows./


Read more in Raymond Chen's blog - The life story of the 
SwitchToThisWindow function:

https://blogs.msdn.microsoft.com/oldnewthing/2007-00/?p=9183

Denis


On 23/05/2017 18:38, Alexey via Lazarus wrote:
What do you think about using this rare API [beginning from WinXP] in 
LCLIntf fnction? It will make LCL function work more stable: window 
will always go to foreground. I used it in CudaText. It works.


https://github.com/Alexey-T/CudaText/blob/master/app/fix_focus_window.pas



-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Use rare Win32 API in LCLIntf.SetForegroundWindow

2017-05-23 Thread Alexey via Lazarus

On 23.05.2017 20:43, Ondrej Pokorny via Lazarus wrote:

What are the equivalents for Qt, Qt5, Gtk2, Carbon, Cocoa?


I meaned - to use in _inside_ LCLIntf.SetForegrondWindow, not making new 
LCL func.


--
Regards,
Alexey

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Use rare Win32 API in LCLIntf.SetForegroundWindow

2017-05-23 Thread Graeme Geldenhuys via Lazarus

On 2017-05-23 18:43, Ondrej Pokorny via Lazarus wrote:

What are the equivalents for Qt, Qt5, Gtk2, Carbon, Cocoa?


For anything running under X11 I have never had a problem with

  XRaiseWindow(xapplication.display, FWinHandle);

So Qt and GTK could you that, if they aren't already.


Regards,
  Graeme

--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Use rare Win32 API in LCLIntf.SetForegroundWindow

2017-05-23 Thread Ondrej Pokorny via Lazarus

On 23.05.2017 19:38, Alexey via Lazarus wrote:
What do you think about using this rare API [beginning from WinXP] in 
LCLIntf fnction? It will make LCL function work more stable: window 
will always go to foreground. I used it in CudaText. It works.


https://github.com/Alexey-T/CudaText/blob/master/app/fix_focus_window.pas


What are the equivalents for Qt, Qt5, Gtk2, Carbon, Cocoa?

Ondrej
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Use rare Win32 API in LCLIntf.SetForegroundWindow

2017-05-23 Thread Alexey via Lazarus
What do you think about using this rare API [beginning from WinXP] in 
LCLIntf fnction? It will make LCL function work more stable: window will 
always go to foreground. I used it in CudaText. It works.


https://github.com/Alexey-T/CudaText/blob/master/app/fix_focus_window.pas

--
Regards,
Alexey

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus