0

I have created application and I also have another application which I have no source code of, another application has dialog box with the label which displays progress status of the current job in percentages, it looks like this:

Dialog Box

What I am trying to achieve is to capture status of this label, and keep updating label which I had created within my own application.

As far as I understand I have to use WM_GETTEXT or WM_COPY functions, but I do not even know where to start, by the way I know how to use FindWindow function.

So far I have managed utilising spy++ to capture information about the main window:

  • Handle:0020040A
  • Caption: Import
  • Class: TfrmProgress

And also I could get a class and handle of the window within the main window, highlighted below:

enter image description here

The class and handle are:

  • Handle: 00080610
  • Class: Tpanel

Additional

I have also managed to retrieve handle and class of progress bar:

  • Handle: 00090400
  • Class: TProgressBar

Question

How can I reflect status of the label from this dialog box onto the label within my application or reflect the progress bar?

Reason

I am trying to achieve this because this dialog box is not available all the time e.i. it only appears sometimes and it took me a long time trying to capture it. But I want to see the progress of the given to the application task.

Thank you and any help would be welcome.

o0Lucky0o
  • 91
  • 1
  • 9
  • Are there any windows smaller than Tpanel? If not, you might be out of luck...that entire window may be simply drawn and not comprised of anything that would return anything meaningful to WM_GETTEXT. If you know how to use FindWindow() then get a handle to the main window and pass that to FindWindowEx() to get the child window. Then just see what happens with that handle and WM_GETTEXT. – Idle_Mind Oct 09 '13 at 01:44
  • I have added information to my original post, I have managed using Spy ++ to get progress bar class, is TProgressBar, is this of any help? Because even if I will be able to reflect progress bar if will be awesome. Also I do not have a clue how to use `WM_GETTEXT`, I have tried to start, but do not even know how to do it. Because after finding main window and child window what parameters do I seek for within child window with `WM_GETTEXT` function? Maybe example will clear things out. And also maybe there is another way of doing it,I mean with a use of complete different function? – o0Lucky0o Oct 09 '13 at 21:50
  • Do you know how to use FindWindow() and FindWindowEx()? – Idle_Mind Oct 09 '13 at 22:30
  • Take a look at this [question](http://stackoverflow.com/a/7740920/2330053) for a good example of how to use WM_GETTEXT. – Idle_Mind Oct 09 '13 at 22:30
  • Yes, I know how to use FindWindow() and FindWindowEx(), I have actually implemented within my application, the question you directed me, I had already seen it, and the only thing it explains is how to get title name of the window. But I sill confused of how to get TProgressBar handle and display it within my application?!?! – o0Lucky0o Oct 09 '13 at 23:43
  • "But I sill confused of how to get TProgressBar handle" Then you don't know how to use FindWindow() and FindWindowEx()! You use FindWindow() to get a handle to the main window. Next pass that handle to FindWindowEx() with the child class name to get the first child handle. Repeat the process to get grandchildren, etc. If the handle is not a direct child, but a sibling, then you need to call FindWindowEx() slightly differently. This is all based on interpreting the hierarchy of the windows as observed using Spy++. The link I gave works for child windows, not just titles. – Idle_Mind Oct 09 '13 at 23:55
  • A simple example can be found [here](http://www.codeproject.com/Articles/14519/Using-Windows-APIs-from-C-again) where the button is a child of the main calculator window. – Idle_Mind Oct 09 '13 at 23:58
  • OK, I will try, and will get back. – o0Lucky0o Oct 10 '13 at 01:18

0 Answers0