Create stay-on-top

Posted in Forms

Try to use SetWindowPos WinAPI function to make a Delphi-form to stay on top: And for lose stay on top, you should change HWND_BOTTOM to HWND_TOPMOST in this function.

SetWindowPos(
  Handle,
  HWND_TOPMOST,
  0, 
  0, 
  0, 
  0, 
  SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE);