Help with C# Please

12/11/2013 18:07 Stongx#1
HI everyone
how are you^^?
I wanted to put my program problem here maybe I find solve and that what I hope^^
the problem is:
I have program his job that send keyboard keys command to windows
it work like the code
SendKeys.Send();
but I used the codes:
SendMessage();
PostMessage()
because send keys must to show the window
I want to send to mini sized window
I want to make this program to game
I wanted to make program send shortcut keys of the game
the two codes doesn't work on the game it's works on normal notepad just!!
waiting for you....
thanks , Goodbye :)
12/11/2013 21:28 kissein#2
If you want to communicate with a game, you typically will have to deal with DirectInput.
12/11/2013 21:32 tolio#3
[Only registered and activated users can see links. Click Here To Register...]
12/11/2013 21:40 Stongx#4
Thank guys
but the problem in the link that i cant to select the game widnow
there is code was worked but not like what i need
i put codes SetForeGround and SendKeys.Send()
that's what i found
this is the code that i use it
(this code works on normal notepad - and i saw this codes in programs and works on another programs but it's didn't work with me@@)
the code:

static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
Process[] procs = Process.GetProcessesByName(textBox1.Text);
foreach (Process proc in procs)
{
// look for untitled Sframe window

// get handle to Sframe's edit window
IntPtr hWnd = FindWindowEx(proc.MainWindowHandle, IntPtr.Zero, "Edit", null);
// post "hello" to Sframe
string s = key1_key.Text.ToString();
const int WM_KEYDOWN = 0x100;


for (int i = 0; i < s.Length; i++)
{
SendMessage(proc.MainWindowHandle, WM_KEYDOWN, VkKeyScan(s[i]), 0);

}

break;
12/11/2013 22:06 kissein#5
Atleast try to use [Only registered and activated users can see links. Click Here To Register...]. SendMessage will not do it.

imo best way would be hooking.
12/11/2013 22:10 Stongx#6
I saw it but i didn't try it hhh
thank you man i will try it

I have small problem if you can help me
i understood the code but i don't know how to use it with the code FindWIndowex
there are no space for intpr
if you know how to select the window tha t i want to sendinput for it let me know plz
thank you again man ... for help

It's didn't work the code wont work with me
any one have any another solve plz......
i want just the program send keys 1 or key 2 or like that to the game window it's didn't must to be special i want the program to work on any program ... so i think if it's worked it's will work on the game...
so any one have an idea plz tell me:)