I'm not trying to be rude, but are you new to programming? The way you structured your IF is just a little weird. No point in calling GetProcID() twice. That's the whole point if if/else

Mistakes happen ofc, but if you don't know basic language functions, programming anything is going to be hard.
Basically to "freeze" a value, you just keep writing a new value into it every second. so technically you're not freezing it, but you write to it often enough, that it looks like the value never changes.
Something along the lines of
Code:
While (true)
WriteProcessMemory(***)
Loop
But you can't just call WriteProcessMemory(), you have to call OpenProcess() first and get a new handle to the process. I wrote a tutorial (more about reading, than writing, but same thing, just easier) just a few threads down. Long read tho :/
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If GetProcessId("proc") = True Then
'Found the process.
Dim procHandle As IntPtr = OpenProcess(***)
If procHandle <> 0 Then
'it worked
WriteProcessMemory(procHandle, &H5C41E8, 3145896, 1, 0)
Else
MsgBox("Unable to call OpenProcess(). Are you admin?")
End If
End If
End Sub
^^ofc that isn't in a loop, so it'd only write the value 1 time. Just showing you the basic logic structure. Also, the way you call RPM(), the declaration looks wrong, it should maybe expect an array of bytes? Maybe read a tutorial on "How to ReadProcessMemory."
http://www.mpgh.net/forum/33-visual-...ory-part1.html There is also a part 2, I included the write functions: if you actually read the tutorial, you should be able to make the functions yourself.