| View previous topic :: View next topic |
| Author |
Message |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Wed Aug 08, 2007 5:27 am Post subject: How do i use... |
|
|
How do i use GetActiveWindow(); and SetActiveWindow(); in delphi ?
A simple example will be appreacited, thanks.
|
|
| Back to top |
|
 |
MadDoom Cheater
Reputation: 0
Joined: 27 Dec 2006 Posts: 38
|
Posted: Wed Aug 08, 2007 1:12 pm Post subject: |
|
|
GetActiveWindow:
| Code: | var
ActiveWindow: HWnd;
begin
ActiveWindow := GetActiveWindow;
end; |
SetActiveWindow:
| Code: | SetActiveWindow(form1);//not sure
|
|
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Aug 08, 2007 1:19 pm Post subject: |
|
|
| what if there are 2 opened "form1"'s? O_o
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Wed Aug 08, 2007 1:25 pm Post subject: |
|
|
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 |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Wed Aug 08, 2007 1:26 pm Post subject: |
|
|
| 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 |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Wed Aug 08, 2007 1:58 pm Post subject: |
|
|
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 |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Aug 08, 2007 2:22 pm Post subject: |
|
|
| oh i get it... it opens the first program was opened (taged as 0? O_o)
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Wed Aug 08, 2007 4:06 pm Post subject: |
|
|
@ 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 |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Wed Aug 08, 2007 5:44 pm Post subject: |
|
|
| 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 |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Thu Aug 09, 2007 2:38 am Post subject: |
|
|
| 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 ?
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Thu Aug 09, 2007 9:04 am Post subject: |
|
|
Is DirectX SDK even available for Delphi?
_________________
|
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Thu Aug 09, 2007 9:11 am Post subject: |
|
|
| 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 |
|
 |
malfunction Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Jan 2007 Posts: 1015 Location: http://www.behindthecorner.com/
|
Posted: Thu Aug 09, 2007 9:16 am Post subject: |
|
|
| 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 |
|
 |
|