Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

Interaction Class

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

System::Object
  Microsoft.VisualBasic::Interaction

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
[StandardModuleAttribute]
public ref class Interaction sealed

The Interaction type exposes the following members.

  NameDescription
Public methodStatic memberAppActivate(Int32)Activates an application that is already running.
Public methodStatic memberAppActivate(String)Activates an application that is already running.
Public methodStatic memberBeepSounds a tone through the computer's speaker.
Public methodStatic memberCallByNameExecutes a method on an object, or sets or returns a property on an object.
Public methodStatic memberChooseSelects and returns a value from a list of arguments.
Public methodStatic memberCommandReturns 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.
Public methodStatic memberCreateObjectCreates 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.
Public methodStatic memberDeleteSettingDeletes 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 .
Public methodStatic memberEnviron(Int32)Returns the string associated with an operating-system environment variable.
Public methodStatic memberEnviron(String)Returns the string associated with an operating-system environment variable.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberGetAllSettingsReturns 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.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodStatic memberGetObjectReturns a reference to an object provided by a COM component.
Public methodStatic memberGetSettingReturns 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.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberIIfReturns one of two objects, depending on the evaluation of an expression.
Public methodStatic memberInputBoxDisplays 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.
Public methodStatic memberMsgBoxDisplays 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.
Public methodStatic memberPartitionReturns a string representing the calculated range that contains a number.
Public methodStatic memberSaveSettingSaves 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.
Public methodStatic memberShellRuns an executable program and returns an integer containing the program's process ID if it is still running.
Public methodStatic memberSwitchEvaluates a list of expressions and returns an Object value corresponding to the first expression in the list that is True.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

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)
' The preceding path is for Windows XP.
' The Windows 2000 path is C:\WINNT\system32\calc.exe.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.