This documentation is archived and is not being maintained.
ProcessModule Class
Visual Studio 2010
Represents a.dll or .exe file that is loaded into a particular process.
System::Object
System::MarshalByRefObject
System.ComponentModel::Component
System.Diagnostics::ProcessModule
System::MarshalByRefObject
System.ComponentModel::Component
System.Diagnostics::ProcessModule
Assembly: System (in System.dll)
The ProcessModule type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | BaseAddress | Gets the memory address where the module was loaded. |
![]() | CanRaiseEvents | Gets a value indicating whether the component can raise an event. (Inherited from Component.) |
![]() | Container | Gets the IContainer that contains the Component. (Inherited from Component.) |
![]() | DesignMode | Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component.) |
![]() | EntryPointAddress | Gets the memory address for the function that runs when the system loads and runs the module. |
![]() | Events | Gets the list of event handlers that are attached to this Component. (Inherited from Component.) |
![]() | FileName | Gets the full path to the module. |
![]() | FileVersionInfo | Gets version information about the module. |
![]() | ModuleMemorySize | Gets the amount of memory that is required to load the module. |
![]() | ModuleName | Gets the name of the process module. |
![]() | Site | Gets or sets the ISite of the Component. (Inherited from Component.) |
| Name | Description | |
|---|---|---|
![]() | CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) |
![]() | Dispose() | Releases all resources used by the Component. (Inherited from Component.) |
![]() | Dispose(Boolean) | Releases the unmanaged resources used by the Component and optionally releases the managed resources. (Inherited from Component.) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | GetService | Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) |
![]() | MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) |
![]() | ToString | Converts the name of the module to a string. (Overrides Component::ToString().) |
The following code sample demonstrates how to use the ProcessModule class to get and display information about all the modules that are used by the Notepad.exe application.
Process^ myProcess = gcnew Process; // Get the process start information of notepad. ProcessStartInfo^ myProcessStartInfo = gcnew ProcessStartInfo( "notepad.exe" ); // Assign 'StartInfo' of notepad to 'StartInfo' of 'myProcess' Object*. myProcess->StartInfo = myProcessStartInfo; // Create a notepad. myProcess->Start(); System::Threading::Thread::Sleep( 1000 ); ProcessModule^ myProcessModule; // Get all the modules associated with 'myProcess'. ProcessModuleCollection^ myProcessModuleCollection = myProcess->Modules; Console::WriteLine( "Properties of the modules associated with 'notepad' are:" ); // Display the properties of each of the modules. for ( int i = 0; i < myProcessModuleCollection->Count; i++ ) { myProcessModule = myProcessModuleCollection[ i ]; Console::WriteLine( "The moduleName is {0}", myProcessModule->ModuleName ); Console::WriteLine( "The {0}'s base address is: {1}", myProcessModule->ModuleName, myProcessModule->BaseAddress ); Console::WriteLine( "The {0}'s Entry point address is: {1}", myProcessModule->ModuleName, myProcessModule->EntryPointAddress ); Console::WriteLine( "The {0}'s File name is: {1}", myProcessModule->ModuleName, myProcessModule->FileName ); } myProcessModule = myProcess->MainModule; // Display the properties of the main module. Console::WriteLine( "The process's main moduleName is: {0}", myProcessModule->ModuleName ); Console::WriteLine( "The process's main module's base address is: {0}", myProcessModule->BaseAddress ); Console::WriteLine( "The process's main module's Entry point address is: {0}", myProcessModule->EntryPointAddress ); Console::WriteLine( "The process's main module's File name is: {0}", myProcessModule->FileName ); myProcess->CloseMainWindow();
- LinkDemand
for full trust for the immediate caller. This class cannot be used by partially trusted code.
- InheritanceDemand
for full trust for inheritors. This class cannot be inherited by partially trusted code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show:
