Difference between revisions of "ActivateWindow"

From SCAR Divi Manual
Jump to: navigation, search
(Undo revision 1636 by Freddy (talk))
 
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function GetDesktopWindow: Hwnd;
+
procedure ActivateWindow(const Wnd: Hwnd);
 
</source>
 
</source>
  
Line 8: Line 8:
  
 
==Description==
 
==Description==
Returns the handle to the desktop window.
+
Brings a window specified by the window handle '''Wnd''' to the foreground.
  
 
==Example==
 
==Example==
 
<source lang="scar">
 
<source lang="scar">
 +
var
 +
  Wnds: THwndArray;
 +
 
begin
 
begin
   WriteLn(GetWindowClass(GetDesktopWindow));
+
   Wnds := FindWindowsEx(GetDesktopWindow, 'notepad', '', False, False, True);
 +
  if Length(Wnds) > 0 then
 +
    ActivateWindow(Wnds[0]);
 
end.
 
end.
 
</source>
 
</source>
  
 
==See Also==
 
==See Also==
*[[GetShellWindow]]
+
 
 
*[[GetActiveWindow]]
 
*[[GetActiveWindow]]
*[[GetParentWindow]]
 
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Window Functions]]
 
[[Category:Window Functions]]

Latest revision as of 13:29, 7 August 2012

Definition

procedure ActivateWindow(const Wnd: Hwnd);

Availability

SCAR Divi 3.35 > Current

Description

Brings a window specified by the window handle Wnd to the foreground.

Example

var
  Wnds: THwndArray;

begin
  Wnds := FindWindowsEx(GetDesktopWindow, 'notepad', '', False, False, True);
  if Length(Wnds) > 0 then
    ActivateWindow(Wnds[0]);
end.

See Also