its the windows xp telnet from C:\WINDOWS\system32\telnet.exe
im really new to api.
how do i find the const values for WM_KEYDOWN and WM_KEYUP?
heres what I have so far
public static int GW_HWNDNEXT = 2;
public static int GW_CHILD = 5;
public static int GW_OWNER = 4;
public static int GWL_HWNDPARENT = -8;
public static int WM_SETTEXT = 12;
public const int HWND_MESSAGE = -3;
public const int WM_CHAR = 258;
I also tried to redirect the standard I/O but telnet will not allow it.
I basically need to be able to send text to a telnet.exe process without using appactivate/sendkeys because I will have 30+ telnet processes open at one time. I am trying to automate a tedious process here at my job.
The quickest way is just to do a Google search "#define " followed by the name of the constant. For example, "#define WM_KEYDOWN". And then grab the most common hex value you see. It's pretty easy, in this case you see the text #define WM_KEYDOWN 0x100 all down the page, so that's the value
Error 1 The best overloaded method match for 'Send_Window_Test.Form1.SendMessage(int, int, int, string)' has some invalid arguments Form1.cs 70 13 Send Window Test
Error 2 Argument '4': cannot convert from 'System.Windows.Forms.Keys' to 'string' Form1.cs 70 53 Send Window Test
so then i tried using the .ToString() but that did not work either.
Thanks again for helping.
Is there any way I can get you to take a look at the code cause it still doesnt work after makeing all parms type int
Thanks alot.
the telnet window is nothing more than a comand console window so what works is posting WM_CHAR messages. Here is code for VB6, you'll have to make changes for VB.NET
VB Code:
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String _
) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" ( _