View previous topic :: View next topic |
Author |
Message |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Fri Nov 23, 2007 5:39 pm Post subject: How do you attach to window??? |
|
|
I dont get it...
When I use GetForeGroundWindow It works and keys are sent. But when I use GetWIndow it it doesn't get it...
|
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Nov 23, 2007 8:50 pm Post subject: |
|
|
If GetForegroundWindow is working fine then whats the problem?
Also you are probably using the API wrong:
GetWindow:
The GetWindow function retrieves a handle to a window that has the specified relationship (Z-Order or owner) to the specified window.
GetForegroundWindow:
The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.
If you need to "attach" to the process for its handle use OpenProcess. You can locate the process ID a number of ways, the easier one being the use of CreateToolhelp32Snapshot using Process32First / Process32Next. There are a few examples already posted on the forums that you can look for.
_________________
- Retired. |
|
Back to top |
|
 |
ZenX Grandmaster Cheater Supreme
Reputation: 1
Joined: 26 May 2007 Posts: 1021 Location: ">>Pointer<<" : Address 00400560 Offset :1FE
|
Posted: Fri Nov 23, 2007 10:09 pm Post subject: |
|
|
Depends on the language.
_________________
CEF Moderator since 2007 ^_^
ZenX-Engine |
|
Back to top |
|
 |
Blagg How do I cheat?
Reputation: 0
Joined: 13 Jul 2007 Posts: 4
|
Posted: Sat Nov 24, 2007 3:22 am Post subject: for c++ wind |
|
|
Not sure ur lang but here is how i get a window when i create a trainer in c++
HWND hwnd;
HANDLE phandle;
DWORD pid;
hwnd = FindWindow(NULL,"Window Name");
if (hwnd != 0)
{
GetWindowThreadProcessId(hwnd,&pid);
phandle = OpenProcess(PROCESS_ALL_ACCESS,0,pid);
} else {
cout << " No way Jose!"<<endl;
}
if (phandle != 0)
{
// your stuff when you have the pid and handle to window !!! XD
}
else
{
cout << " Sigh...."<<endl;
}
}
// just void main and make the above a function your set
// btw this is for everyone........You can WriteProcessMemory after these
// steps
// good info here
|
|
Back to top |
|
 |
dnsi0 I post too much
Reputation: 0
Joined: 04 Jan 2007 Posts: 2674
|
Posted: Sat Nov 24, 2007 6:12 pm Post subject: |
|
|
Language is Delphi 7...
I ment for sendkeys or the dispatch method. It doesn't work for some reason...
|
|
Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Sat Nov 24, 2007 7:07 pm Post subject: |
|
|
Make a call to user32.dll and set the focus to the window.
I don't know the Delphi code for importing functions, so I can't help you there.
_________________
|
|
Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sun Nov 25, 2007 4:54 am Post subject: |
|
|
In delphi there is a unit called SndKey32.
You Can use it this way:
Code: | procedure TForm1.SendKeyStroksClick(Sender: TObject);
begin
AppActivate('Untitled - Notepad') ;
sleep(1000);
SendKeys('Blah Rulz!', True) ;
end; |
Remember to include SndKey32 in your uses lust and if the compiler doesn't find it here is the the file: Link
|
|
Back to top |
|
 |
|