Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

Getting Active Processes Of OS using Windows32 API in Visual Basic.Net

Author: Zunnair

This Article has Windows32 demonstrations of Active Process. This is the Part one of win32 API Usage.

Whenever we want to Access the windows authentication we have to use Win32 APIs .because Microsoft Gives us his own way because Microsoft wants no disturbance in its Performance due to your access. 

Each of the Win32 API functions and constants have been wrapped up in the Win32API class for use in each demonstration.

  • Active processes: This fills a list view with all running Windows processes. The emphasis of this example is how to use a Win32 callback function, EnumWindows by using a delegate.

Lets start Understanding by using Code it is recommended that with this explanation please run application First. And try to understand because helpful Comments are written there.

I place the main function of processes in Refresh button.

 

Private Sub btnRefreshActiveProcesses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefreshActiveProcesses.Click

 

  lvwProcessList.Items.Clear()

  Win32API.EnumWindows(New Win32API.EnumWindowsCallback(AddressOf _

FillActiveProcessList), 0)

 

End Sub

That function Call WinAPI function EnumWindows, specifying FillActive ProcessList function as the function to be called once per active process.  Since EnumWindows is unmanaged code, it is necessary to create a delegate to allow it to call FillActiveProcessList which is managed code.

In this Article just Focus on Concept And Active Process Showing I will Explain Other Code in Later Parts.

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Implementing Parent Form with Colorful Background on Run Time Using Visual Basic .Net

Disclaimer - Privacy
© 2002-2017 DevASP.net