Originally Posted by TGForums
PostMessage only sends the string/character value, though. Not the actual keypress. So regardless of what bypass is used, I can't see that working in any way, shape, or form.
|
You obviously don't know much about programing. PostMessage is exactly what you are looking for.
It's simple enough to achieve what you want, just send the WM_KEYDOWN message to MapleStory via it's windows process name (wndproc for short)
There are several ways to send a PostMessage instruction to it's wndproc, and one of which I will demonstrate (which is in C#)
First of all you will need to import the following into your project imports "
System.Runtime.InteropServices;" This allows you to import and use dynamic link library files (also known as dll's).
Second you will need to import the FindWindow function and the PostMessage function which will be shown bellow;
//////////////////////////////////
////////
FINDWINDOW /////////
//////////////////////////////////
Code:
[DllImport("user32.dll", SetLastError = true)]
static extern IntPtr FindWindow(
string lpClassName,
string lpWindowName);
IntPtr hWnd = FindWindow(
null,
"MapleStory");
//////////////////////////////////
////////
POSTMESSAGE ////////
//////////////////////////////////
Code:
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("user32.dll", SetLastError = true)]
static extern bool PostMessage(
IntPtr hWnd,
uint Msg,
int wParam,
int lParam);
Thirdly you need to define the WM_KEYDOWN event. Add this piece of code to your form coding (under public partial class)
Code:
const int WM_KEYDOWN = 0x100;
Now that we've got all the functions and imports sorted, all thats needed to do is call the PostMessage event using our parameters. For an example of the usage of PostMessage I will attempt to send the "A" Key to MapleStory' wndproc, the following is done so like:
Code:
PostMessage(hWnd, WM_KEYDOWN, 0x41, 0x1e0001);
Here I will list each Parameter of the PostMessage event so you can get a better understanding.
hWnd - Is the destination parameter (basically where the message will be delivered to in la mans terms)
WM_KEYDOWN - As stated before this is the KEY_DOWN event, it signifies a key being held down. Alternatively you can also use the KEY_PRESS event.
0x41 - Is the wParam which signifies what key is being used
0x1e0001 - Is the lParam which signifies what key is being used
You can find a list of wParameters and lParameters here:
[Only Registered and Activated Users Can See Links. Click Here To Register...]
Ofcourse none of the above will work if you have not attached your program to MapleStory' wndproc, or in this case "hWnd". To do this, simply put the following code in your form_load events:
Code:
FindWindow(null, "MapleStory");
An alternative to this would be to put "MapleStoryClass" instead of MapleStory. If you are using "MapleStory" as the window name, you will only be able to use your program if you start it up before you start MapleStory. Using "MapleStoryClass" as the window to find will allow you to open up your program after MapleStory has been opened.
Thats all I have to say.