[Lazarus] Use rare Win32 API in LCLIntf.SetForegroundWindow

Denis Kozlov dezlov at gmail.com
Wed May 24 23:25:35 CEST 2017


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/20111107-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
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170524/13a0759c/attachment.html>


More information about the Lazarus mailing list