How to inspect pop up windows/tool tips/hover effects which are designed to hide/close on mouse move with tools like WinSpy++ or Spy++? - c++

Essentially I'm trying to learn more about the Win32 api, how certain classes/elements are created, destroyed, what items make them up etc.. Dissecting windows if you will for a project of mine.
I'm very curious at the moment what popups/tool tips/hover effects ubiquities to all windows applications are made up of. My main goal is to grab text from any tooltip/hover thingy/WS_POPUP?
If someone knows that is great but I'd also like to have the tools to research it myself.
I'm not even sure what to google to be honest to get me on the right path. I've tried some C++ code to print class names and fetch the text from what I think might be a msgbox but no dice so far.

The MiniSpy tool on Codeproject comes in handy in situations like this because it uses the corner of the spy window as the location, not the mouse.

Related

Basic GdkWindow hello world Example?

I'm new to Gtk/Gdk.
I've done some work with GtkWindows, but now I need to work with lower level Gdk Windows.
I understand GdkWindows are used to implement GtkWindows and GtkWidgets in general. It is the drawing area.
I'm kind of not sure where to start. How do I make a shell, with a GdkWindow inside it with something like a label inside that saying hello world?
I've looked around for tutorials, but haven't been able to find anything.
Edit - background for this
I can't get away with just knowing Gtk. The reason I need to work on Gdk.
I'm an SWT/Gtk developer.
SWT is build on top of Gtk/Gdk.
For gtk3, it has a custom container, to allow things like overlapping IDE elements.
The custom container uses low-level Gdk calls, (e.g for realization).
It's buggy. I need to fix it. Thus need to learn Gdk.

Creating GUIs in Win32 C++

I'm developing my first Windows desktop application and I'm trying to figure out what the best approach would be to create the program's GUI.
I know, I know... I feel stupid for asking considering the amount of data on the subject on SO. However most answers seem outdated and I'm not sure if they fit my specific project. Also tutorials for Windows 8 'metro apps' are clogging my Google search results, which is NOT what I'm looking for.
I use Visual Studio. I've followed tutorials. I have basic knowledge of C and Java and extensive experience with PHP. I'm excited to learn C++, so I'm not looking for GUIs to create a GUI (like WinForms). I also don't care about managed code and portability for now, especially since I'm trying to avoid dependencies (i.e. users having to install .NET). As long as it runs smoothly on Vista and up, I'm happy.
The application
The software will teach basic physics to kids. I'd like to create a main area and a sidebar. The main area will feature a physics animation, say a bouncing ball, along with some Q&A. Users can zoom in to the animation to measure some stuff and answer the question. Users can track their progress in the sidebar. That's pretty much it.
What I've found so far
I'm getting a bit frustrated with MSDN. Most of their examples are given in four different languages (C#, C++, etc). I can't seem to get more than a bit of Hello World code from them.
I found a GDI API on MSDN and it seems like a good start for me. However I've read quite a few answers on SO saying creating layouts in pure C++ is really hard, that we're better of using frameworks like ATL and WTL. Since I'm also going to create (somewhat interactive) animations, I've wondered whether I should use gaming-targeted APIs like Direct2D.
Since all of this is new to me, and there are a lot of options, I don't know where to start for my particular application. Any tips would be greatly appreciated!
Using the raw Win32 API (no additional downloads or third-party helpers):
Here's a good primer (introduces dialog boxes, text boxes, buttons, etc): theForger's Win32 API Tutorial
And here's where you go from there (numeric up-downs, list boxes, combo boxes, tooltips, and more): Common Controls on MSDN. Most of these require you to #include <commctrl.h>.
I also found this to be a good resource that covered what the other two didn't: Win32 Developer - Window Assets
But the Win32 API doesn't seem like it does exactly what you want. A physics app for kids should have a more visual GUI than the API can provide. Good luck, though!
If you're ok with adding additional Frameworks, I'd suggest looking at Qt.
It allows to create the GUI from code only, has a good structure, and has an Interface for 2D drawing, if required.
If you are concerned about dependencies, you only have to include the Qt DLLs to your executables; no installation is required for the user.
To get started, see my (old) tutorial "Lessons in Windows API Programming".
But you really need a good book, such as edition 5 or earlier of Charles Petzold's classic "Programming Windows".
The problem with latest edition is that it's for C# and .NET, with Charles grabbing the tail of the "new way" at just the wrong timeā€¦
Disclaimer: I haven't checked the details of edition numbers.
Using the Windows API is the simplest, but producing advanced GUIs can take a very long time. Microsoft Foundation Class is a way to make the Windows API more user friendly and OOP. Does anyone have any experience with MFC?
Why not use some 2D C++ game engine, like HGE: http://hge.relishgames.com/overview.html.

Object level (non-pixel dependent) automation for QT-based GUIs?

I'm looking for some advice and insight on how people approach creating Object-level GUI automation. Technically the type of functionality I am trying to achieve is easily described by Squish software. I want to be able to simulate Key-Press and Mouse Click events without relying on Platform-specific pixel displays, and screen sizes. I've tried to use tools like Sikuli, but unfortunately my application varies too from platform to platform to make reliably re-repeatable tests.
Basically what I am looking for is some advice as to where to look at how 3rd Part (EXTERNAL) programs hook into properties of QT Widgets and other objects. I know a long time ago there was something call QtObjectInspector, but this software required you making Source-Level changes to your Qt code to be compatible on top of being unavailable.
If companies like Squish can do it, how are they doing it? Where do you start? I doubt they are looking at very low level memory interactions, sniffing for "Traffic" that looks like QT on each different system, but I may be wrong.
I'm sorry for such a vague question, but I've been researching for over a day and all I can find now is articles about how amazing Squish is.
Thanks!
EDIT:
I looked into QtTestLib, however this doesn't have the "From the outside" kind of access that I am looking for.

Can I access the Unity background elements?

I'm not very familiar with Linux, but have some experience with C and C++. I would like to get in touch with some Visual FX and/or UI development (either C or C++). I was wondering if there is a possibility to access the GUI elements of the Desktop on Ubuntu's Unity UI.
What I especially would like to do, is to render animations on the desktop or windows or all over the screen. (particle effects when clicking with the mouse or so).
Can anyone point me in the right direction? (Libraries, Documents, ...)
I think Desktop Effects have to be designed specific for the corresponding Window Manager.
I think unity uses (some sort of) compiz, so you should look into compiz plugin development.
A lot of "i thinks" so i am not really sure if that'll help you, but good luck.
You want to learn a lot more about GTK. There are lot of documentation on line (and some books also). You might code in C++ using GtkMM (but you could consider Qt also). GTK itself is coded in C, with well designed coding style and convention. Looking inside its source code is worthwhile.

What's the easiest way to find a given control in a external program's window?

What is the best way for, using WinApi, find a given control in a external program window?
For example, I'm trying to change Internet Explorer's url text box. I am having trouble getting programatically the handle to the text box. I know its type is "Edit" but I'd like to avoid having to search through all the child windows for the "Edit" control (that's how I'm currently doing).
Is there any kind of unique identifier for a given control on a window? I tried using "Control ID" but it doesn't seem to be working.
Thanks
When you're delving into the windows of another application that wasn't designed to give you any particular special access to its windows, then you don't really have any simple solution. Functions like FindWindowEx, GetWindow, EnumChildWindows, and the rest are what you have to work with.
However, it's often not a great idea to even do this. Internet Explorer may have certain types of windows in a certain hierarchy in the particular version that you're developing against right now. But those windows and hierarchy may be different in previous versions and could be considerably different in future versions. You have no guarantee about these things.
In some cases, you might do well to investigate if there are alternative and more official ways to control the other program. For instance, Internet Explorer exposes a COM object that can be used for many purposes. Because this is an official interface, you have better guarantees about what previous versions this will be supported on and that it won't break for future versions.
The best way to do it is find it step by step.. E.g. Find the IE window with FindWindow, then find the child of that with FindWindowEx, then find the child of that with FindWindowEx ... until you get down to the textbox.
There is 1 program I can think of that will generate VB code from dragging a icon from the application to any part of any other application.. VB is way old but it'll give you a very good idea how to do it!
It's called API Spy, found under 'Downloadable Applications (Windows Only)' on http://patorjk.com/blog/software/