| View previous topic :: View next topic |
| Author |
Message |
Kalookakoo Expert Cheater
Reputation: 0
Joined: 03 Mar 2008 Posts: 117
|
Posted: Tue Aug 12, 2008 7:46 pm Post subject: Window Detection for delphi? 2 other questions also... |
|
|
How do you make an application detect a window open and do whatever function I specify.
And also, is it possible to get the black box to appear and text to appear as if I were writing in C++ without an interface? (The cmd box)
And how exactly do I write a code so that when a user clicks/writes something, that window closes and calls a new one up?
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Tue Aug 12, 2008 7:55 pm Post subject: |
|
|
1. FindWindow ();
2. WHAT?
3. WHAT?
Please be more specific.
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Tue Aug 12, 2008 8:13 pm Post subject: |
|
|
He's saying is there anyway for him to create a CUI (Console User Interface) in delphi and is there any way for him to make a command that closes that console and opens up another.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
kitterz Grandmaster Cheater Supreme
Reputation: 0
Joined: 24 Dec 2007 Posts: 1268
|
Posted: Tue Aug 12, 2008 8:23 pm Post subject: |
|
|
| oib111 wrote: | | He's saying is there anyway for him to create a CUI (Console User Interface) in delphi and is there any way for him to make a command that closes that console and opens up another. |
I program in C++...
but try
system ();
|
|
| Back to top |
|
 |
lurc Grandmaster Cheater Supreme
Reputation: 2
Joined: 13 Nov 2006 Posts: 1900
|
Posted: Tue Aug 12, 2008 9:30 pm Post subject: |
|
|
AllocConsole();
| Quote: | | And how exactly do I write a code so that when a user clicks/writes something, that window closes and calls a new one up? |
Uhh... Constantly read the buffer, if anything is found, FreeConsole and AllocConsole again?
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Tue Aug 12, 2008 11:20 pm Post subject: |
|
|
Delphi has got a built in console application.
Go to File -> New -> Other... -> Console Application.
|
|
| Back to top |
|
 |
Slugsnack Grandmaster Cheater Supreme
Reputation: 71
Joined: 24 Jan 2007 Posts: 1857
|
Posted: Wed Aug 13, 2008 2:11 am Post subject: |
|
|
| Quote: | | How do you make an application detect a window open and do whatever function I specify. |
To detect a window:
- FindWindow
If you want to call an in-game function:
- GetWindowThreadProcessId
- OpenProcess
- WriteProcessMemory to write your hooks or inject your DLL
If you plan on injecting a DLL you will also need to use a few other APIs (well strictly you can do it with just those above actually).
| Quote: | | And also, is it possible to get the black box to appear and text to appear as if I were writing in C++ without an interface? (The cmd box) |
AllocConsole to make the "black box" appear and FreeConsole to get rid of it properly.
And how exactly do I write a code so that when a user clicks/writes something, that window closes and calls a new one up?
Simple IO and string comparisons. Let the user enter input and read it (an easy way is ReadFile) although I'm sure Delphi actually has a built in function for reading a string to a buffer.
Anyway that is more beginner's stuff. To make it close the old console (make sure you saved a handle to it in a variable when you created it since you will need it to close it again) just call FreeConsole.
@Moller : Better to use AllocConsole/FreeConsole if he wants to keep opening and closing different consoles
|
|
| Back to top |
|
 |
|