Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Read from console rcon in Delphi
#1
Code:
var
Pai,txtbox,console:HWND;
s:array[0..63] of Char;
begin
Pai:=FindWindow(nil,'Call of Duty: Modern Warfare 3 Multiplayer');
txtbox:=FindWindowEx(Pai,0,'Edit',nil);
console:=FindWindowEx(Pai,txtbox,'Edit',nil);
SendMessage(console,WM_GETTEXT,63,Integer(@s));
Edit1.Text:=StrPas(s);

what did I do wrong?
Reply

#2
delphi? wtf
Reply

#3
Delphi 7, whats wrong with using delphi?
Reply

#4
Ask @JariZ about the source code for this: http://www.itsmods.com/forum/Thread-Play...r-MW3.html
[Image: b_560_95_1.png]
Reply

#5
I asked, send pm, not responded.
Reply

#6
(11-30-2012, 01:41)richard1994x Wrote: I asked, send pm, not responded.

Just wait, he will respond asap.

Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
Reply

#7
I used a pointer to get the console window. I think I shared the code several times here.
http://www.itsmods.com/forum/Thread-Help...3#pid85743

You need the pointer though, I got it from @Nukem , not sure how he got it, perhaps I could get it myself but no idea.
I think barata's tool gives it. Not sure.
Reply

#8
You probably don't have to rely on the parent HWND pointer in order to read the console. What you posted should work (I am not farmilar with Delphi, but the parameters seem OK). Instead of relying on the window title, try using the window class name.

Code:
Pai:=FindWindow('IW5 WinConsole', nil);

EDIT - Just tested it in C# externally without using that pointer, worked fine.
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
Reply

#9
Just a few pages back and you get an exactly same thread
CSHARP Code
  1. unsafe string MW3Console
  2. {
  3. get
  4. {
  5. IntPtr form = FindWindow("IW5 WinConsole", "Call of Duty: Modern Warfare 3 Dedicated Server");
  6. IntPtr txtbox = FindWindowEx(form,IntPtr.Zero,"Edit",null);
  7. IntPtr console = FindWindowEx(form, txtbox, "Edit", null);
  8. StringBuilder sb = new StringBuilder(9999999);
  9. int result = SendMessageTimeout(
  10. console,
  11. 0x0D /*WM_GETTEXT*/,
  12. 9999999,
  13. sb,
  14. 10 /*SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG*/,
  15. 500,
  16. IntPtr.Zero);
  17. return sb.ToString();
  18. }
  19. }
  20.  
  21. [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)]
  22. public static extern IntPtr FindWindow(string className, string windowName);
  23. [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)]
  24. public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle);
  25.  
  26. [DllImport("User32.dll", SetLastError = true)]
  27. public static extern int SendMessageTimeout(
  28. IntPtr hWnd,
  29. uint uMsg,
  30. uint wParam,
  31. StringBuilder lParam,
  32. uint fuFlags,
  33. uint uTimeout,
  34. IntPtr lpdwResult);

Should work for all versions
Reply

#10
Guys, i found the error, i need create a program "RCON Advanced" for facilitate manipulation the administration for ADMIN's.

This code above is work for iw5mp_server.exe, i need code for iw5mp.exe, i try this code but not work, the game is protected with function FindWindowEx?

Code:
var
Pai,txtbox,console:HWND;
s:array[0..63] of Char;
begin
Pai:=FindWindow('IW5','Call of Duty: Modern Warfare 3 Multiplayer');
txtbox:=FindWindowEx(Pai,0,'Edit',nil);
console:=FindWindowEx(Pai,txtbox,'Edit',nil);
SendMessage(console,WM_GETTEXT,63,Integer(@s));
Edit1.Text:=StrPas(s);

i need help, i don't speak english, so sorry with for any inconvenience.

Thanks in advance.

Richard Alexander.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help MW3 (External) Console - TeknoMW3? Strazeeh 7 8,711 10-01-2013, 21:54
Last Post: DeHEnergY
  Help MW3 (External) Console - TeknoMW3? Strazeeh 2 4,368 09-30-2013, 19:19
Last Post: surtek
  [Request] MW2 EXTERNAL CONSOLE!!! thomiromi 4 5,711 09-26-2013, 18:02
Last Post: Rendflex
  console or server browser MW2 kerm007 1 3,588 08-30-2013, 21:52
Last Post: Nekochan
  God Mode Plugin - Everyone has rcon admin srskiller 4 6,094 08-28-2013, 19:03
Last Post: phillipito
  [News] T6 Console [PC] zer0w 42 31,561 08-08-2013, 17:27
Last Post: Bandarigoda123
Wink Help MW3 Server Console Bandarigoda123 0 3,210 07-26-2013, 04:01
Last Post: Bandarigoda123
  Help Help in address console Bandarigoda123 2 3,402 07-20-2013, 15:46
Last Post: Bandarigoda123
  [Release] Black Ops 1 "External" Console barata 16 19,128 07-19-2013, 21:15
Last Post: Jakeyellis
  [HELP] bo2 - FD1 - dis-attach the console from the game masis 8 5,880 07-17-2013, 23:01
Last Post: surtek

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.