Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 05:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Help with C# Please

Discussion on Help with C# Please within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
Stongx's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 39
Received Thanks: 3
Help with C# Please

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
Stongx is offline  
Old 12/11/2013, 21:28   #2
 
kissein's Avatar
 
elite*gold: 0
Join Date: Sep 2005
Posts: 427
Received Thanks: 87
If you want to communicate with a game, you typically will have to deal with DirectInput.
kissein is offline  
Old 12/11/2013, 21:32   #3
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
tolio is offline  
Old 12/11/2013, 21:40   #4
 
Stongx's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 39
Received Thanks: 3
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;
Stongx is offline  
Old 12/11/2013, 22:06   #5
 
kissein's Avatar
 
elite*gold: 0
Join Date: Sep 2005
Posts: 427
Received Thanks: 87
Atleast try to use . SendMessage will not do it.

imo best way would be hooking.
kissein is offline  
Old 12/11/2013, 22:10   #6
 
Stongx's Avatar
 
elite*gold: 0
Join Date: Aug 2013
Posts: 39
Received Thanks: 3
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
Stongx is offline  

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.