Class GuiMainWindow
Represents a SAP GUI window (main window, modal dialog, etc.).
Equivalent to VBA GuiFrameWindow / GuiMainWindow.
public class GuiMainWindow : GuiComponent
- Inheritance
-
GuiMainWindow
- Inherited Members
Properties
Handle
Win32 window handle (HWND) of this SAP window.
public IntPtr Handle { get; }
Property Value
IsDialog
Returns true if this window is a modal dialog.
public bool IsDialog { get; }
Property Value
IsMaximized
Returns true if the window is currently maximized.
Determined via the Win32 IsZoomed API on the window handle,
which is reliable across all SAP GUI versions (the SAP COM property
IsMaximized is not consistently updated after Maximize()).
public bool IsMaximized { get; }
Property Value
Title
The window title bar text.
public string Title { get; }
Property Value
Methods
Close()
Closes the window (equivalent to the X button).
public void Close()
HardCopy(string, string)
Takes a screenshot and saves it to a file. Format is determined by the file extension (.png, .bmp, .jpg).
public void HardCopy(string filePath, string format = "PNG")
Parameters
Iconify()
Minimizes (iconifies) the window to the taskbar.
public void Iconify()
Maximize()
Maximises the window.
public void Maximize()
Restore()
Restores the window to normal size.
public void Restore()
SendVKey(int)
Sends a virtual key to the window.
| 0 | Enter |
| 3 | Back (F3) |
| 4 | Input Help (F4) |
| 5 | Matchcode (Search) |
| 8 | Execute (F8) |
| 11 | Save (Ctrl+S) |
| 12 | Exit (F12 / Shift+F4) |
| 15 | Cancel (F15 / Shift+F3) |
| 71 | Scroll to top |
| 82 | Scroll to bottom |
public void SendVKey(int vKey)
Parameters
vKeyint