hello,
This is my first time to post here, and I need some help with a little problem. I am trying to watch the process of of one application. and show it in a true/false field. here is what i got. I am showing you 2 different ones i have tried.
here is the first one...
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim procname = "notepad.exe"
Dim inum
Dim inum2
End Sub
Sub checkmem()
Dim procname = "notepad.exe"
'Dim procname = "WCAPW32.exe"
'notepade.exe = Process.GetCurrentProcess
Dim inum
'Dim x As Process = Process.GetCurrentProcess
If procname <> "" Then
x = GetCurrentProcess(, procname)
Else
x = GetCurrentProcess(True)
End If
Label1.Text = (Format(x(0, 1), "#,###"))
inum = (Format(x(0, 1), "#,###"))
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
checkmem()
Dim inum2
Dim inum
inum2 = Replace(inum, ",", "")
If (inum2 > 4100) Then
RadioButton1.Checked = True
Else
RadioButton1.Checked = False
End If
here is the 2nd one i tried to make it easier... LOL...
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim processes() As Process
processes = Process.GetProcessesByName("notepad.exe")
'Dim proc = "notepad.exe"
If ("notepade.exe" > 2) Then
RadioButton1.Checked = True
Else
RadioButton1.Checked = False
End If
End Sub
**** if you can tell i am trying to put it with a counter so it will always check to see if the process will start, the first one did it by memmory, and the second one tried it by cpu.
thanks for any help.