Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


pID vb.net

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Aug 15, 2008 8:31 pm    Post subject: pID vb.net Reply with quote

How would I get the pID of an external address in vb.net? I tried searching it but then it came up with this thing like this
Code:

Dim instance As Process
Dim value As Integer

value = instance.Id


but the ".id" part isn't part of an array or something.

Thanks!

_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Aug 15, 2008 10:14 pm    Post subject: Reply with quote

Code:
Dim p As Process() = Process.GetProcessesByName("notepad")

p(0).Id
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Aug 15, 2008 10:44 pm    Post subject: Reply with quote

i got this as an error on the p(0).Id

Error 2 Identifier expected

yea.
any ideas?

_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Fri Aug 15, 2008 10:55 pm    Post subject: Reply with quote

paste your code.
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Fri Aug 15, 2008 11:15 pm    Post subject: Reply with quote

well it doesn't really matter but here:
Code:

    Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
'you part's here
        Dim p As Process() = Process.GetProcessesByName("notepad")

        p(0).Id
'end of it
        Dim myProcess As Process() = Process.GetProcessesByName("winmine")
        If myProcess.Length = 0 Then
            Exit Sub
        End If
        myProcess.
        Dim processHandle As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, myProcess(0).Id)

        If processHandle = IntPtr.Zero Then
           Exit Sub
        End If


    End Sub

I already have it hooked, but I want the pID. Thanks

_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Aug 16, 2008 12:22 am    Post subject: Reply with quote

You don't need to use OpenProcess, you get can the handle from your process array as well.
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Sat Aug 16, 2008 2:16 am    Post subject: Reply with quote

wait, what? Umm... I got confused x]
_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Aug 16, 2008 2:58 am    Post subject: Reply with quote

hacksign23 wrote:
well it doesn't really matter but here:
Code:

    Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
'you part's here
        Dim p As Process() = Process.GetProcessesByName("notepad")

        p(0).Id
'end of it
        Dim myProcess As Process() = Process.GetProcessesByName("winmine")
        If myProcess.Length = 0 Then
            Exit Sub
        End If
        myProcess.
        Dim processHandle As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, myProcess(0).Id)

        If processHandle = IntPtr.Zero Then
           Exit Sub
        End If


    End Sub

I already have it hooked, but I want the pID. Thanks


You were already well on your way before I posted. You just need to take a good look at the Process class.

Basically, just remove what I posted. I didn't know what you had so far.

myProcess(0).Id IS the process ID of minesweeper.
However, look at the other methods, and you will find that you don't need to use OpenProcess, as the Process class also takes care of that for you.

myProcess(0).Handle will yield a valid handle for you to Read / Write / do whatever you want.
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Sat Aug 16, 2008 12:52 pm    Post subject: Reply with quote

so then I did that, but I got this error
Code:

Error   1   Property access must assign to the property or use its value.      609   9   


_________________
Back to top
View user's profile Send private message AIM Address
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Sat Aug 16, 2008 3:34 pm    Post subject: Reply with quote

p(0).Id

must have a assignment

like

Msgbox p(0).Id

or assuming Id is a int

Public MyPID as integer

MyPID = p(0).Id

Msgbox MyPID
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Sat Aug 16, 2008 10:33 pm    Post subject: Reply with quote

Okay, assume i do this
Code:

Dim myProcess As Process() = Process.GetProcessesByName("winmine")
        If myProcess.Length = 0 Then
            Exit Sub
        End If
        myProcess.ID
        Dim processHandle As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, myProcess(0).Id)

        If processHandle = IntPtr.Zero Then
           Exit Sub
        End If


MyPID would be a process in your post, not an int.
For mine, if i did myProcess.ID, then it would show up as an error as
Quote:

Property access must assign to the property or use its value.

_________________
Back to top
View user's profile Send private message AIM Address
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sat Aug 16, 2008 10:48 pm    Post subject: Reply with quote

hacksign23 wrote:
Okay, assume i do this
Code:

Dim myProcess As Process() = Process.GetProcessesByName("winmine")
        If myProcess.Length = 0 Then
            Exit Sub
        End If
        myProcess.ID
        Dim processHandle As IntPtr = OpenProcess(PROCESS_ALL_ACCESS, 0, myProcess(0).Id)

        If processHandle = IntPtr.Zero Then
           Exit Sub
        End If


MyPID would be a process in your post, not an int.
For mine, if i did myProcess.ID, then it would show up as an error as
Quote:

Property access must assign to the property or use its value.


What the hell are you doing? Are you even reading the responses?

myProcess(0).Id is the process ID, yes. So why are you just randomly putting it in the middle of your code? It's becoming increasing obvious that you just copy and pasted some code with no idea what you're doing.

You're not doing anything with myProcess(0).Id other than just randomly placing it.

Code:
Dim i As Integer = 0
i = myProcess(0).Id


And once again, you don't need OpenProcess. You already have the handle.
Back to top
View user's profile Send private message
hacksign23
Master Cheater
Reputation: 0

Joined: 26 Nov 2006
Posts: 404

PostPosted: Mon Aug 18, 2008 1:45 pm    Post subject: Reply with quote

OH WAIT WTF LOL IT WORKS NOW. THANKS PEOPLE!

i think it was because i forgot to do the

bla = myProcess(0).ID whatever lol

_________________
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites