Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How do i use...

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Wed Aug 08, 2007 5:27 am    Post subject: How do i use... Reply with quote

How do i use GetActiveWindow(); and SetActiveWindow(); in delphi ?

A simple example will be appreacited, thanks.
Back to top
View user's profile Send private message
MadDoom
Cheater
Reputation: 0

Joined: 27 Dec 2006
Posts: 38

PostPosted: Wed Aug 08, 2007 1:12 pm    Post subject: Reply with quote

GetActiveWindow:
Code:
var
  ActiveWindow: HWnd;
begin
  ActiveWindow := GetActiveWindow;
end;


SetActiveWindow:
Code:
SetActiveWindow(form1);//not sure
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Aug 08, 2007 1:19 pm    Post subject: Reply with quote

what if there are 2 opened "form1"'s? O_o
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Aug 08, 2007 1:25 pm    Post subject: Reply with quote

Well then you could do like (I'm not sure about Delphi, but this is C#, and it shouldn't be hard to translate):

Code:

System.Diagnostics.Process[] myprocs = GetProcessesByName(PROCESSNAMEHERE);
<SetActiveWindow equivilent here>(myprocs[0])


Simply, you make an array of processes with the name "PROCESSNAMEHERE", then you can put any number you want in the

myprocs[0]

and that will correspond to which is up. I really don't know much about Delphi, so I couldn't help you there, but Kaspersky made a list of processes in his Process Killer, so you can ask him.
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Wed Aug 08, 2007 1:26 pm    Post subject: Reply with quote

samuri25404 wrote:
Well then you could do like (I'm not sure about Delphi, but this is C#, and it shouldn't be hard to translate):


Actually, it's EXTREMELY HARD TO TRANSLATE BECAUSE NO NON-.NET LANGUAGE HAS ACCESS TO THE .NET LIBRARIES AND TYPES.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Wed Aug 08, 2007 1:58 pm    Post subject: Reply with quote

Appal, I don't think you understand.

The only thing I did was make an array of processes. :roll:

You could easily sort yours by a name, like DB does :

Attatch Window -> Right Click -> Filter -> Process name

Edit:

Kaspersky wrote:

Code:

{taken from the Process Killer's source code. You don't mind, Kaspersky, do you?}
try
MyHandle:=CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS, 0);
Struct.dwSize:=Sizeof(TProcessEntry32);
if Process32First(MyHandle, Struct) then
ListBox1.Items.add(Struct.szExeFile);
while Process32Next(MyHandle, Struct) do
ListBox1.Items.Add(Struct.szExeFile);
except on exception do
ShowMessage('Error showing process list');
end;
end;



I supose that it is kinda complicated, but oh well.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Aug 08, 2007 2:22 pm    Post subject: Reply with quote

oh i get it... it opens the first program was opened (taged as 0? O_o)
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Wed Aug 08, 2007 4:06 pm    Post subject: Reply with quote

@ samuri25404 i used a public source code so i dont mind.

and thanks for the help everyone, ill try.

MadDoom wrote:
GetActiveWindow:
Code:
var
  ActiveWindow: HWnd;
begin
  ActiveWindow := GetActiveWindow;
end;


SetActiveWindow:
Code:
SetActiveWindow(form1);//not sure


I know this allready, im trying to make Soldier Front into a window mode.

like:

var
h: hwnd; //HWND Handle
begin
h:= findwindow(nil, 'Soldier Front');

if h <> 0 then
....(Code to make SF in winmode here)....
end;

any ideas ?
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Aug 08, 2007 5:44 pm    Post subject: Reply with quote

Kaspersky wrote:
@ samuri25404 i used a public source code so i dont mind.

and thanks for the help everyone, ill try.

MadDoom wrote:
GetActiveWindow:
Code:
var
  ActiveWindow: HWnd;
begin
  ActiveWindow := GetActiveWindow;
end;


SetActiveWindow:
Code:
SetActiveWindow(form1);//not sure


I know this allready, im trying to make Soldier Front into a window mode.

like:

var
h: hwnd; //HWND Handle
begin
h:= findwindow(nil, 'Soldier Front');

if h <> 0 then
....(Code to make SF in winmode here)....
end;

any ideas ?


DirectX hooks.
Back to top
View user's profile Send private message MSN Messenger
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Thu Aug 09, 2007 2:38 am    Post subject: Reply with quote

noz3001 wrote:
Kaspersky wrote:
@ samuri25404 i used a public source code so i dont mind.

and thanks for the help everyone, ill try.

MadDoom wrote:
GetActiveWindow:
Code:
var
  ActiveWindow: HWnd;
begin
  ActiveWindow := GetActiveWindow;
end;


SetActiveWindow:
Code:
SetActiveWindow(form1);//not sure


I know this allready, im trying to make Soldier Front into a window mode.

like:

var
h: hwnd; //HWND Handle
begin
h:= findwindow(nil, 'Soldier Front');

if h <> 0 then
....(Code to make SF in winmode here)....
end;

any ideas ?


DirectX hooks.


Shit....i never used DirectX yet, mind giving me a hand Smile ?
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Thu Aug 09, 2007 9:04 am    Post subject: Reply with quote

Is DirectX SDK even available for Delphi?
_________________
Back to top
View user's profile Send private message
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Thu Aug 09, 2007 9:11 am    Post subject: Reply with quote

Dark Byte released a game he made once with a open source, im not sure it will help but its about DirectX library and such, try look at it. (Look some pages back and you should find the game)
Back to top
View user's profile Send private message MSN Messenger
malfunction
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Jan 2007
Posts: 1015
Location: http://www.behindthecorner.com/

PostPosted: Thu Aug 09, 2007 9:16 am    Post subject: Reply with quote

Kevinnn wrote:
Dark Byte released a game he made once with a open source, im not sure it will help but its about DirectX library and such, try look at it. (Look some pages back and you should find the game)

link for the game
http://forum.cheatengine.org/viewtopic.php?t=101086&highlight=game

_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites