C# Class SebWindowsClient.SebWindowsClientForm

Inheritance: System.Windows.Forms.Form
显示文件 Open project: SafeExamBrowser/seb-win Class Usage Examples

Public Properties

Property Type Description
closeSebClient bool
permittedProcessesCalls List
permittedProcessesIconImages List
permittedProcessesReferences List
sebPassword string
xulRunner System.Diagnostics.Process

Public Methods

Method Description
CloseSEBForm ( ) : void

Close SEB Form.

ExitApplication ( bool showLoadingScreen = true ) : void

Central code to exit the application Closes the form and asks for a quit password if necessary

GetApplicationPath ( string executable, string executablePath = "" ) : string

Get the full path of an application from which we know the executable name by searching the application paths which are set in the Registry.

GetPermittedApplicationPath ( Dictionary,System.Collections.Generic permittedProcess ) : string

Get the full path of an application from which we know the executable name by searching the application paths which are set in the Registry.

HideApplicationChooserForm ( ) : void

Hide SEB Application Chooser Form.

LoadFile ( string file ) : bool
OpenSEBForm ( ) : bool

Open SEB form.

SEBToForeground ( ) : void

Move SEB to the foreground.

SebWindowsClientForm ( ) : System

Constructor - initialise components.

SebWindowsClientForm_FormClosing ( object sender, FormClosingEventArgs e ) : void

Close form, if Quit Password is correct.

SebWindowsClientForm_Load ( object sender, EventArgs e ) : void

Load form.

SelectNextListItem ( ) : void

Show SEB Application Chooser Form.

SetVisibility ( bool show ) : void

Hide or show the Windows taskbar and startmenu.

ShowApplicationChooserForm ( ) : void

Show SEB Application Chooser Form.

ShowCloseDialogForm ( ) : void

Show SEB Close Form.

ShowCloseDialogFormConfirmation ( ) : void

Protected Methods

Method Description
OnLoad ( EventArgs e ) : void

OnLoad: Get the file name from command line arguments and load it.

ToolStripButton_Click ( object sender, EventArgs e ) : void

Handle click on permitted process in SEB taskbar: If process isn't running, it is started, otherwise the click is ignored.

Private Methods

Method Description
CreateProcessWithExitHandler ( string fullPathArgumentsCall ) : Process

Create a new process and add an exited event handler.

EnumThreadCallback ( IntPtr hWnd, IntPtr lParam ) : bool
EnumThreadWindows ( int threadId, EnumThreadProc pfnEnum, IntPtr lParam ) : bool
FindWindow ( string lpClassName, string lpWindowName ) : IntPtr
FindWindowEx ( IntPtr parentHwnd, IntPtr childAfterHwnd, IntPtr className, string windowText ) : IntPtr
FindWindowEx ( IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle ) : IntPtr
GetActiveWindowOfProcess ( Process proc ) : IntPtr

Returns the handle of the active window of a process

GetApplicationIcon ( string fullPath ) : Icon

Get icon for an application specified by a full path.

GetDesktopWindow ( ) : IntPtr
GetProcessIcon ( Process process ) : Icon

Get icon for a running process.

GetVistaStartMenuWnd ( IntPtr taskBarWnd ) : IntPtr

Returns the window handle of the Vista start menu orb.

GetWindowText ( IntPtr hWnd, StringBuilder text, int count ) : int
GetWindowThreadProcessId ( IntPtr hwnd, int &lpdwProcessId ) : uint
InitClientRegistryAndKillProcesses ( ) : bool

Set registry values and close prohibited processes.

IsIconic ( IntPtr handle ) : bool
MyEnumThreadWindowsForProcess ( int pid, IntPtr lParam ) : bool

Callback method that is called from 'EnumThreadWindows' in 'GetVistaStartMenuWnd'.

MyEnumThreadWindowsProc ( IntPtr hWnd, IntPtr lParam ) : bool

Callback method that is called from 'EnumThreadWindows' in 'GetVistaStartMenuWnd'.

OnXULRunnerShutdDownRequested ( object sender, EventArgs e ) : void
OnXulRunnerQuitLinkPressed ( object sender, EventArgs e ) : void
PlaceFormOnDesktop ( bool KeyboardShown, bool isInitial = false ) : void
SetForegroundWindow ( IntPtr hWnd ) : IntPtr
SetFormOnDesktop ( ) : bool

Set form on Desktop.

SetParent ( IntPtr hWndChild, IntPtr hWndNewParent ) : IntPtr
SetWindowPos ( IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags ) : bool
ShowWindow ( IntPtr hwnd, int nCmdShow ) : int
StartXulRunner ( string userDefinedArguments ) : bool

Start xulRunner process.

addPermittedProcessesToTS ( ) : void

Add permitted process names and icons to the SEB task bar (ToolStrip control) and start permitted processes which have the autostart option set

noSelectButton1_Click ( object sender, EventArgs e ) : void

Show dialog asking whether SEB should be closed

permittedProcess_Exited ( object sender, System e ) : void

Handle xulRunner_Exited event and display process information.

xulRunner_Exited ( object sender, System e ) : void

Handle xulRunner_Exited event and display process information.

Method Details

CloseSEBForm() public method

Close SEB Form.
public CloseSEBForm ( ) : void
return void

ExitApplication() public method

Central code to exit the application Closes the form and asks for a quit password if necessary
public ExitApplication ( bool showLoadingScreen = true ) : void
showLoadingScreen bool
return void

GetApplicationPath() public method

Get the full path of an application from which we know the executable name by searching the application paths which are set in the Registry.
public GetApplicationPath ( string executable, string executablePath = "" ) : string
executable string
executablePath string
return string

GetPermittedApplicationPath() public method

Get the full path of an application from which we know the executable name by searching the application paths which are set in the Registry.
public GetPermittedApplicationPath ( Dictionary,System.Collections.Generic permittedProcess ) : string
permittedProcess Dictionary,System.Collections.Generic
return string

HideApplicationChooserForm() public method

Hide SEB Application Chooser Form.
public HideApplicationChooserForm ( ) : void
return void

LoadFile() public method

public LoadFile ( string file ) : bool
file string
return bool

OnLoad() protected method

OnLoad: Get the file name from command line arguments and load it.
protected OnLoad ( EventArgs e ) : void
e System.EventArgs
return void

OpenSEBForm() public method

Open SEB form.
public OpenSEBForm ( ) : bool
return bool

SEBToForeground() public static method

Move SEB to the foreground.
public static SEBToForeground ( ) : void
return void

SebWindowsClientForm() public method

Constructor - initialise components.
public SebWindowsClientForm ( ) : System
return System

SebWindowsClientForm_FormClosing() public method

Close form, if Quit Password is correct.
public SebWindowsClientForm_FormClosing ( object sender, FormClosingEventArgs e ) : void
sender object
e System.Windows.Forms.FormClosingEventArgs
return void

SebWindowsClientForm_Load() public method

Load form.
public SebWindowsClientForm_Load ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

SelectNextListItem() public method

Show SEB Application Chooser Form.
public SelectNextListItem ( ) : void
return void

SetVisibility() public static method

Hide or show the Windows taskbar and startmenu.
public static SetVisibility ( bool show ) : void
show bool true to show, false to hide
return void

ShowApplicationChooserForm() public method

Show SEB Application Chooser Form.
public ShowApplicationChooserForm ( ) : void
return void

ShowCloseDialogForm() public method

Show SEB Close Form.
public ShowCloseDialogForm ( ) : void
return void

ShowCloseDialogFormConfirmation() public method

public ShowCloseDialogFormConfirmation ( ) : void
return void

ToolStripButton_Click() protected method

Handle click on permitted process in SEB taskbar: If process isn't running, it is started, otherwise the click is ignored.
protected ToolStripButton_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

Property Details

closeSebClient public_oe property

public bool closeSebClient
return bool

permittedProcessesCalls public_oe property

public List permittedProcessesCalls
return List

permittedProcessesIconImages public_oe property

public List permittedProcessesIconImages
return List

permittedProcessesReferences public_oe property

public List permittedProcessesReferences
return List

sebPassword public_oe property

public string sebPassword
return string

xulRunner public_oe property

public Process,System.Diagnostics xulRunner
return System.Diagnostics.Process