Difference between revisions of "SetWindowTopMost"

From SCAR Divi Manual
Jump to: navigation, search
(Description)
(Definition)
Line 2: Line 2:
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
 
procedure SetOnTop(Window: Integer; Top: Boolean);
 
procedure SetOnTop(Window: Integer; Top: Boolean);
 +
</source>
 +
 +
==Source Code==
 +
<source lang="scar">
 +
procedure SetTop(Window: Hwnd; Top: Boolean);
 +
begin
 +
  if Window <> 0 then
 +
    if Top then
 +
      SetWindowPos(Window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE)
 +
    else
 +
      SetWindowPos(Window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);
 +
end;
 
</source>
 
</source>
  

Revision as of 10:23, 27 June 2011

Definition

procedure SetOnTop(Window: Integer; Top: Boolean);

Source Code

procedure SetTop(Window: Hwnd; Top: Boolean);
begin
  if Window <> 0 then
    if Top then
      SetWindowPos(Window, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE)
    else
      SetWindowPos(Window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE or SWP_NOSIZE);
end;

Availability

SCAR Divi 3.12 > Current

Description

This function adds the HWND_TOPMOST flag to a window specified by it's handle Window if Top is true. If Top is false, it will add the flag HWND_NOTOPMOST.

Internal Flags[1]

  • HWND_TOPMOST: Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.
  • HWND_NOTOPMOST: Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.

Example

begin
  SetOnTop(GetClientWindowHandle, True);
end.

See Also

References

<references>