ZennoLab Assemblies Documentation
ActiveWindow Method
See Also  Example Send Feedback
ZennoLab.Emulation Assembly > ZennoLab.Emulation Namespace > Emulator Class : ActiveWindow Method
name

Type: System.String !

The header of the window.

topMost

Type: System.Boolean

true if need to show the window on top of all; otherwise, false. Default value is false.

Glossary Item Box

Sets the active window.

Syntax

C# 
public static string ActiveWindow( 
   string name,
   bool topMost
)

Parameters

name

Type: System.String !

The header of the window.

topMost

Type: System.Boolean

true if need to show the window on top of all; otherwise, false. Default value is false.

Return Value

Type: System.String

The answer with information about the success of the current command's execution. If current command was successful then this answer is "ok"; otherwise message describing the error.

Remarks

There are several ways of calling this method. The parameter topMost have the default value and you can call the method without this parameter. See examples.

This method calls automatically every time when you use methods from ZennoLab.Emulation.

Example

The following code example demonstrates uses of the ActiveWindow method. In this code activated the three windows. The first and the second are shown without parameter topMost (topMost is false). But the third window is shown on top of all.
C#Copy Code
// activate the first window just show it
string result = Emulator.ActiveWindow("First window");
// if was not any errors 
if (result == "ok" && !Emulator.ErrorDetected)
{
    // also activate the second window just show it but set the parameters topMost == false
    result = Emulator.ActiveWindow("Second window", false);
    // if was not any errors 
    if (result == "ok" && !Emulator.ErrorDetected)
    {
        // also activate the third window and show on top of all. Set the parameters topMost == true
        result = Emulator.ActiveWindow("Third window", true);
        // if all nice
        if (result == "ok" && !Emulator.ErrorDetected) return "All in openwork boss!";
        // if bad
        else return "Fail: The third window";
    }
    else return "Fail: The second window";
}
else return "Fail: The first window";
PHPCopy Code
// activate the first window just show it
$result = ZennoLab\Emulation\Emulator::ActiveWindow("First window");
// if was not any errors 
if ($result == "ok" && !ZennoLab\Emulation\Emulator::ErrorDetected)
{
    // also activate the second window just show it but set the parameters topMost == false
    $result = ZennoLab\Emulation\Emulator::ActiveWindow("Second window", false);
    // if was not any errors 
    if ($result == "ok" && !ZennoLab\Emulation\Emulator::ErrorDetected)
    {
        // also activate the third window and show on top of all. Set the parameters topMost == true
        $result = ZennoLab\Emulation\Emulator::ActiveWindow("Third window", true);
        // if all nice
        if ($result == "ok" && !ZennoLab\Emulation\Emulator::ErrorDetected) return "All in openwork boss!";
        // if bad
        else return "Fail: The third window";
    }
    else return "Fail: The second window";
}
else return "Fail: The first window";

Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2014 All Rights Reserved.