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 


[Help (C#) ] PMX.dll - how to Call the function in C#
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
MyFeel
Expert Cheater
Reputation: 0

Joined: 04 Jun 2007
Posts: 143

PostPosted: Mon Dec 03, 2007 12:18 pm    Post subject: [Help (C#) ] PMX.dll - how to Call the function in C# Reply with quote

Hello ,
i have saw the topic:
http://forum.cheatengine.org/viewtopic.php?p=1637734&sid=8bce1a4af01b0e0c031b8f284e97809c

hmm an i want to ask how i can call this function it C#?

thanks.
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Dec 03, 2007 12:48 pm    Post subject: Reply with quote

well this is just a wild guess cuz i dont really know anything about the pmx dll expect for the link where u download it and the functions

soo

Code:
using System.Runtime.InteropServices;

[DllImport("PMX.Dll")]
public static extern void PostMessageX(HWND hWnd, UINT MSG, WPARAM wParam, LPARAM lParam);


pretty sure u can just call the function with that after u define it.. iunno Rolling Eyes

someone correct me if im wrong plz

iunno.. that might be it, try it out? cuz i dont really do much coding for dll importing..

total guess, flame me or correct me if u want, idc

_________________
Back to top
View user's profile Send private message
MyFeel
Expert Cheater
Reputation: 0

Joined: 04 Jun 2007
Posts: 143

PostPosted: Mon Dec 03, 2007 1:12 pm    Post subject: Reply with quote

lurc wrote:
well this is just a wild guess cuz i dont really know anything about the pmx dll expect for the link where u download it and the functions

soo

Code:
using System.Runtime.InteropServices;

[DllImport("PMX.Dll")]
public static extern void PostMessageX(HWND hWnd, UINT MSG, WPARAM wParam, LPARAM lParam);


pretty sure u can just call the function with that after u define it.. iunno Rolling Eyes

someone correct me if im wrong plz

iunno.. that might be it, try it out? cuz i dont really do much coding for dll importing..

total guess, flame me or correct me if u want, idc


hey dude it may working but not for C#, but thank you anyway =]

someone something else..?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Dec 03, 2007 1:16 pm    Post subject: Reply with quote

lol i tried

try googling how to import external dll's to gain a function in C# or like "importing dlls C#"

_________________
Back to top
View user's profile Send private message
MyFeel
Expert Cheater
Reputation: 0

Joined: 04 Jun 2007
Posts: 143

PostPosted: Mon Dec 03, 2007 1:38 pm    Post subject: Reply with quote

ok i found how to call this function
but now how i use it?
i tried to do like:

PostMessageX(0x09);

or

PostMessageX(0x09, 0, 0, 0);

and that things not working =\

and that how i called the function (it was close to what you said ):

[DllImport("PMX.DLL", EntryPoint = "PostMessageX")]
public static extern IntPtr PostMessageX(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);


hmm so someone know how to use it?

thanks =]
Back to top
View user's profile Send private message
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Mon Dec 03, 2007 3:02 pm    Post subject: Reply with quote

hWnd = handle to the window
msg = the message you want to sent
wParam = additional message specific information
lParam = same as wParam

So, you should use it like
Code:

IntPtr something = PostMessageX(handle, WM_KEYDOWN, VK_SPACE, 0);
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Mon Dec 03, 2007 4:44 pm    Post subject: Reply with quote

killersamurai wrote:
hWnd = handle to the window
msg = the message you want to sent
wParam = additional message specific information
lParam = same as wParam

So, you should use it like
Code:

IntPtr something = PostMessageX(handle, WM_KEYDOWN, VK_SPACE, 0);


WM_KEYDOWN and VK_SPACE wont work with C# cuz there included in the library "windows.h" so u have to go into it and define them yourself within ur project

just to let u know

_________________
Back to top
View user's profile Send private message
killersamurai
Expert Cheater
Reputation: 0

Joined: 10 Sep 2007
Posts: 197
Location: Colorado

PostPosted: Mon Dec 03, 2007 6:07 pm    Post subject: Reply with quote

I assumed he (the topic creator) knew what WM_KEYDOWN and VK_(key) were and how to find their value, so I didn't bother mentioning that. Anyways, you can find the key codes here
or you can just use Keys.(key)
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Mon Dec 03, 2007 7:01 pm    Post subject: Reply with quote

don't use PMX there's tons of shit in it.
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Dec 03, 2007 7:09 pm    Post subject: Reply with quote

use sponge's hookHop!
_________________
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Mon Dec 03, 2007 7:28 pm    Post subject: Reply with quote

No, it's not ready yet. I still haven't fixed the bug w/ the OS version check yet.
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Dec 03, 2007 7:41 pm    Post subject: Reply with quote

still leaps and bounds over PMX.DLL
_________________
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Mon Dec 03, 2007 7:43 pm    Post subject: Reply with quote

sponge wrote:
don't use PMX there's tons of shit in it.


shit is good Very Happy

Edit:just to note that pmx.dll was just an example, so i don't really mind which one they use
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Mon Dec 03, 2007 8:27 pm    Post subject: Reply with quote

and the sky cried at the arrival of hookHop.

hookHop [x]

Supported OS:
  • Windows Vista
  • Windows XP (Service Pack 2)
  • If not supported API will return 01234h.


ReadMe will clear some stuff up.

_________________
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Dec 03, 2007 9:49 pm    Post subject: Reply with quote

Try this:

Code:

[System.Runtime.InteropServices.DLLImport("PMX.dll")]
private static extern void PostMessageX(IntPtr hWnd , UINT msg, IntPtr wParam, IntPtr lParam);

//Lalaa....
//Later...

System.Diagnostics.Process[] myprocs = System.Diagnostics.Process.GetByName("MyApp"); //I think that's how it is, it's been a little while
IntPtr hWnd = myprocs[0].ID; //First instance of the application

PostMessageX(hWnd,0x09,0,0); //I'm guessing that 0x09 is the message that you want to send

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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