Table of Contents

Class GuiMessageWindow

Namespace
SapGui.Wrapper
Assembly
SapGui.Wrapper.dll

Wraps a SAP GUI modal message / popup dialog (GuiMessageWindow). These appear when SAP shows a system message that requires user confirmation, e.g. "Document saved", "Are you sure?", error dialogs.

public class GuiMessageWindow : GuiComponent
Inheritance
GuiMessageWindow
Inherited Members

Properties

IsError

Returns true if the message type is Error (E) or Abort (A).

public bool IsError { get; }

Property Value

bool

IsInfo

Returns true if the message type is Information (I).

public bool IsInfo { get; }

Property Value

bool

IsSuccess

Returns true if the message type is Success (S).

public bool IsSuccess { get; }

Property Value

bool

IsWarning

Returns true if the message type is Warning (W).

public bool IsWarning { get; }

Property Value

bool

MessageType

Message type: "S"=Success, "W"=Warning, "E"=Error, "A"=Abort, "I"=Info.

public string MessageType { get; }

Property Value

string

Text

The message body text displayed inside the popup. Reads SAP's inner text fields (usr/txtMESSTXT1usr/txtMESSTXT4) and joins non-empty lines with a space. Falls back to the window title text if no inner fields are found (e.g. when the popup is a GuiModalWindow without standard message fields).

public override string Text { get; }

Property Value

string

Title

Title bar text of the popup window.

public string Title { get; }

Property Value

string

Methods

ClickButton(string)

Clicks the first button whose text contains textFragment (case-insensitive). Useful for "Yes" / "No" / "OK" / "Cancel" buttons.

public void ClickButton(string textFragment)

Parameters

textFragment string

ClickCancel()

Clicks "Cancel" / "No" (VKey 12).

public void ClickCancel()

ClickOk()

Clicks the "OK" / "Continue" / "Enter" button (VKey 0). Use this to confirm or dismiss most message popups.

public void ClickOk()

GetButtons()

Returns typed GuiButton wrappers for all buttons in the popup. Useful when the popup has non-standard buttons (Yes/No, etc.).

public IReadOnlyList<GuiButton> GetButtons()

Returns

IReadOnlyList<GuiButton>

SendVKey(int)

Sends an arbitrary virtual key to the popup window.

public void SendVKey(int vKey)

Parameters

vKey int

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.