|
You last visited: Today at 07:54
Advertisement
Spy++ how it works?
Discussion on Spy++ how it works? within the C/C++ forum part of the Coders Den category.
01/09/2012, 17:29
|
#1
|
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
|
Spy++ how it works?
Can anyone tell me how this works?
I need to get two things from an application I am running:
Quote:
HWND hNotepad = FindWindow(TEXT("Notepad"), NULL);
HWND hEdit = FindWindowEx(hNotepad, NULL, TEXT("Edit"), NULL);
|
So I would love to learn how to get for example those two names from a game called "Serious Sam" for example.
How would I be able to retrieve the Window and WindowEx name?
yours sincerely,
|
|
|
01/09/2012, 20:18
|
#2
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,909
Received Thanks: 25,409
|
EnumWindows
|
|
|
01/09/2012, 21:23
|
#3
|
elite*gold: 0
Join Date: May 2009
Posts: 827
Received Thanks: 471
|
Quote:
Yes I thought of EnumWindows, too, but how do you know which Handle is the right one to work with?
|
|
|
01/09/2012, 21:42
|
#4
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,909
Received Thanks: 25,409
|
What do you mean?
You can read the window information and thus filter the right one out, cant you?
|
|
|
01/10/2012, 15:38
|
#5
|
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
|
Still no clue what you guys mean lol, enum = programming?. I am talking about using the Spy++ program to get the window handle and windowex (as stated and needed in the code).
See this screenshot of the program:
As stated in my first post, I need to learn (would like to lol) how to get names like here:
HWND hNotepad = FindWindow(TEXT("Notepad"), NULL);
HWND hEdit = FindWindowEx(hNotepad, NULL, TEXT("Edit"), NULL);
They have two different handles. Both of the type HWND but still totally different names.
|
|
|
01/10/2012, 18:11
|
#6
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,909
Received Thanks: 25,409
|
Oh I thought you want to know how Spy++ works, the headline is a bit confusing.
|
|
|
01/10/2012, 19:45
|
#7
|
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
|
no no lol my apologies 
I want to know how to use spy++, because I have this game (Final Fantasy XIV) and I would like to get both values:
HWND hNotepad = FindWindow(TEXT("Notepad"), NULL);
HWND hEdit = FindWindowEx(hNotepad, NULL, TEXT("Edit"), NULL);
Because I dont know how to use Spy++ lol
|
|
|
01/10/2012, 19:55
|
#8
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,909
Received Thanks: 25,409
|
What do you need this hEdit for? It seems to be the handle to the input field of notepad; do you need something similar in your target game? oO
If you open Spy++ it shows a list of all open windows in a list and shows their titles and window classes.
Right-click on an entry and choose properties to get all information about the Window.
|
|
|
01/10/2012, 20:38
|
#9
|
elite*gold: 20
Join Date: May 2007
Posts: 1,166
Received Thanks: 82
|
@MrSm!th dont know for sure, I dont think so but someone told me it was better to get both handles then to only get one single handle. So I have been trying to figure out how to get both for quite some time now lol.
I just want to send keystrokes to the game, but unfortunately I have to hook the game first (way beyond my knowledge) but someone on EPVP gave me a nice link which I will try out soon to learn how to hook :P
|
|
|
01/11/2012, 02:34
|
#10
|
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,909
Received Thanks: 25,409
|
Actually you dont have to, if it does not have any anti-cheat :O
If there is no hEdit window, you cant get the handle to it ;P
|
|
|
01/17/2012, 11:14
|
#11
|
elite*gold: 0
Join Date: Jan 2009
Posts: 8
Received Thanks: 1
|
Quote:
Originally Posted by DarkTwilight
Can anyone tell me how this works?
I need to get two things from an application I am running:
So I would love to learn how to get for example those two names from a game called "Serious Sam" for example.
How would I be able to retrieve the Window and WindowEx name?
yours sincerely,
|
And especilly for games its mostly not necessary to find any child windows to interact with them. So in this case it should be enough to get the handle of the window named "Serious Sam" to send any messages or key strokes e.g.
and like Mr Smith said it could cause many problems if youre searching for child windows if they dont even exist ^^
So try to catch the right handle by FindWindow(NULL, "Serious Sam"); and then send your keystrokes by PostMessage or SendMessage
|
|
|
All times are GMT +1. The time now is 07:56.
|
|