Is there one? Is there a tool for Linux which does the same thing as Spy++ (at least to see messages for foreign apps)?
I used MS Spy++ to see messages from foreign apps. Then I create a "hook" under MS VC++ to have my app monitor when that message is received. Is there an equivalent technique in Linux using signals and slots?
I fear that my code will not be portable to Linux due to this "hook" concept.
Spy++ "hook" equivalent in Linux
-
- In need of some credit
- Posts: 6
- Joined: Mon Sep 12, 2005 8:10 pm
- Location: In a cube
Spy++ "hook" equivalent in Linux
[Linker error] undefined reference to `wxNewbster'
ld returned 1 exit status
ld returned 1 exit status
-
- In need of some credit
- Posts: 6
- Joined: Mon Sep 12, 2005 8:10 pm
- Location: In a cube
Spy++ is an app on MS Windows that allows you to select another app by pointing to its window, then monitor which messages are sent to that window. Such as painting or mouse clicking. It also provides the handle and class name, rectangle size, etc of the window you want to monitor.
Let's say there is an app with a button and a text box. When the button is clicked, it takes the text in the text box and changes the window title to have that text. Spy++ would say that the window received a WM_SETTEXT message. Or if you just passed the mouse over that window, it could report WM_MOUSEMOVE messages.
My app (a second app that I program) could send a message to the first app to set its title text directly (or even set the text box text and send a click message to the button) and it would be as if the first app set its own text.
Let's say there is an app with a button and a text box. When the button is clicked, it takes the text in the text box and changes the window title to have that text. Spy++ would say that the window received a WM_SETTEXT message. Or if you just passed the mouse over that window, it could report WM_MOUSEMOVE messages.
My app (a second app that I program) could send a message to the first app to set its title text directly (or even set the text box text and send a click message to the button) and it would be as if the first app set its own text.
[Linker error] undefined reference to `wxNewbster'
ld returned 1 exit status
ld returned 1 exit status
-
- Can't get richer than this
- Posts: 802
- Joined: Mon Dec 27, 2004 10:46 am
- Location: Estonia, Tallinn
- Contact:
You can check properties on the windows with the X11 tool called xprop.
You can get event spam from wxGTK by having a full debug build of GTK+, and launching the application with the --gtk-debug=events command line argument (or GDK_DEBUG="events" environment variable), and --gtk-debug=geometry might be useful too. There are more, --gdk-debug=all --gtk-debug=all showing all the stuff.
Not sure if that is helpful to you.
You can get event spam from wxGTK by having a full debug build of GTK+, and launching the application with the --gtk-debug=events command line argument (or GDK_DEBUG="events" environment variable), and --gtk-debug=geometry might be useful too. There are more, --gdk-debug=all --gtk-debug=all showing all the stuff.
Not sure if that is helpful to you.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
OS's: Gentoo Linux, WinXP; WX: CVS HEAD
Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/
Spy++ sounds windows proprietary.
If you wanted to something similar in linux, I suggest you take a look at the wxEvtHandler and the ways you can manipulate it's events; to pass them to other windows.
with something like the following:
netEvtHandler is an inherieted class of type wxEvtHandler.
Now events specified either statically (in BEGIN_EVENT_TABLE tables) or events processed by
will first go to the nethandler window, but if that event object has specified
then it will then hit mainhandler's event stack and be processed by that window (where you can tell it to change the title based on the event arguments)
custom events are a must if you take this route; however it only works for the same wx application, I'm not really sure what you use the 'hook' method for, but this will only work within the same application.
If you wanted to something similar in linux, I suggest you take a look at the wxEvtHandler and the ways you can manipulate it's events; to pass them to other windows.
with something like the following:
Code: Select all
nethandler = new netEvtHandler();
nethandler->SetEvtHandlerEnabled(true);
wxEvtHandler *mainhandler;
mainhandler = frame->GetEventHandler();
mainhandler->SetNextHandler(nethandler);
mainhandler->SetPreviousHandler(NULL);
nethandler->SetNextHandler(NULL);
nethandler->SetPreviousHandler(mainhandler);
Now events specified either statically (in BEGIN_EVENT_TABLE tables) or events processed by
Code: Select all
nethandler->ProcessEvent( P )
Code: Select all
event.Skip(true);
event.ResumePropagation(1);
custom events are a must if you take this route; however it only works for the same wx application, I'm not really sure what you use the 'hook' method for, but this will only work within the same application.
-
- In need of some credit
- Posts: 6
- Joined: Mon Sep 12, 2005 8:10 pm
- Location: In a cube
Wow, I don't know why I didn't come back to this thread after the last two replies. the funny thing is I just visited http://www.wxwidgets.org/ and this forum and a lot of wx links today and I get a private message from someone.
leio,
Yes, "event spam" was what I was interested in.
koderpat,
Unfortunately I was interested in "outside" of an application I wrote, not "within" the same application I wrote. I believe that is why the term "hook" is used.
I just noticed my signature and that is exactly why I will be posting a new thread (and probably why I haven't touched wxWidgets in a while).
leio,
Yes, "event spam" was what I was interested in.
koderpat,
Unfortunately I was interested in "outside" of an application I wrote, not "within" the same application I wrote. I believe that is why the term "hook" is used.
I just noticed my signature and that is exactly why I will be posting a new thread (and probably why I haven't touched wxWidgets in a while).
[Linker error] undefined reference to `wxNewbster'
ld returned 1 exit status
ld returned 1 exit status