Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-05

Use rare Win32 API in LCLIntf.SetForegroundWindow

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Denis Kozlov
to Alexey: What do you think about using this rare API [beginning from WinXP] in LCLIntf fnction? It…

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

Alexey wrote 6 lines
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>

Reply by email