Interaction Class

Definition

The Interaction module contains procedures used to interact with objects, applications, and systems.

public ref class Interaction sealed
[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class Interaction
[<Microsoft.VisualBasic.CompilerServices.StandardModule>]
type Interaction = class
Public Module Interaction
Inheritance
Interaction
Attributes

Examples

The following example uses the Shell function to run an application specified by the user. Specifying AppWinStyle.NormalFocus as the second argument opens the application in normal size and gives it the focus.

Dim procID As Integer  
' Run calculator.  
procID = Shell("C:\Windows\system32\calc.exe", AppWinStyle.NormalFocus)  

Remarks

This module supports the Visual Basic language keywords and run-time library members that run other programs, call a method or property, sound a beep from the computer, provide a command-line string, manipulate COM objects, and control dialog boxes.

Methods

AppActivate(Int32)

Activates an application that is already running.

AppActivate(String)

Activates an application that is already running.

Beep()

Sounds a tone through the computer's speaker.

CallByName(Object, String, CallType, Object[])

Executes a method on an object, or sets or returns a property on an object.

Choose(Double, Object[])

Selects and returns a value from a list of arguments.

Command()

Returns the argument portion of the command line used to start Visual Basic or an executable program developed with Visual Basic. The My feature provides greater productivity and performance than the Command function. For more information, see CommandLineArgs.

CreateObject(String, String)

Creates and returns a reference to a COM object. CreateObject cannot be used to create instances of classes in Visual Basic unless those classes are explicitly exposed as COM components.

DeleteSetting(String, String, String)

Deletes a section or key setting from an application's entry in the Windows registry. The My feature gives you greater productivity and performance in registry operations than the DeleteSetting function. For more information, see Registry .

Environ(Int32)

Returns the string associated with an operating-system environment variable.

Environ(String)

Returns the string associated with an operating-system environment variable.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAllSettings(String, String)

Returns a list of key settings and their respective values (originally created with SaveSetting) from an application's entry in the Windows registry. Using the My feature gives you greater productivity and performance in registry operations than GetAllSettings. For more information, see Registry.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetObject(String, String)

Returns a reference to an object provided by a COM component.

GetSetting(String, String, String, String)

Returns a key setting value from an application's entry in the Windows registry. The My feature gives you greater productivity and performance in registry operations than GetAllSettings. For more information, see Registry.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
IIf(Boolean, Object, Object)

Returns one of two objects, depending on the evaluation of an expression.

InputBox(String, String, String, Int32, Int32)

Displays a prompt in a dialog box, waits for the user to input text or click a button, and then returns a string containing the contents of the text box.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MsgBox(Object, MsgBoxStyle, Object)

Displays a message in a dialog box, waits for the user to click a button, and then returns an integer indicating which button the user clicked.

Partition(Int64, Int64, Int64, Int64)

Returns a string representing the calculated range that contains a number.

SaveSetting(String, String, String, String)

Saves or creates an application entry in the Windows registry. The My feature gives you greater productivity and performance in registry operations than SaveSetting. For more information, see Registry.

Shell(String, AppWinStyle, Boolean, Int32)

Runs an executable program and returns an integer containing the program's process ID if it is still running.

Switch(Object[])

Evaluates a list of expressions and returns an Object value corresponding to the first expression in the list that is True.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also