MB/s scope grab MS Win

Just starting out? Need help? Post your questions and find answers here.
Simo_na
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Mar 03, 2013 9:01 am

MB/s scope grab MS Win

Post by Simo_na »

Hello
During the operations of file copy carried by MS Windows 10/11 OS is possible to capture the MB/S scope in real time ? if yes ...how do it ?
Image
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: MB/s scope grab MS Win

Post by Mijikai »

Try to locate the window control that is responsible for the text you may be able to read it by sending a #WM_GETTEXT message.
Simo_na
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Mar 03, 2013 9:01 am

Re: MB/s scope grab MS Win

Post by Simo_na »

I understand what you mean...about...
Find ID of 'copy window'
and then request the 64K
converting the pointer buffer to unicode...

right ?

I thought there was something more immediate way... 8)

Thank you
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: MB/s scope grab MS Win

Post by Mijikai »

With window/message functions like FindWindow_(), FindWindowEx_(), EnumWindows_(), SendMessage_(), ...
I dont have an example but you would need to go through all windows/controls and see if it is stored somewhere.
You could also look for it in memory but that is even more complicated.
The easy solution would be to code a custom copy routine and expose what you need.
BarryG
Addict
Addict
Posts: 4225
Joined: Thu Apr 18, 2019 8:17 am

Re: MB/s scope grab MS Win

Post by BarryG »

You won't be able to use #WM_GETTEXT or FindWindow_() with it, because it's not a standard window. I note that WinSpy says the class name for the progress display is "RateChartOverlayWindow", and it seems to be generated on-the-fly. See screenshot below.

However, you can get the speed by doing the math yourself: the window title shows the % complete, so you just repeatedly test this percentage over one second of time and the file's size. The difference would be the MB/s of progress, which would match the speed in the overlay. Just don't ask me how to do the math, lol. I may try when I have some spare time and motivation, if nobody else does it.

Image
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: MB/s scope grab MS Win

Post by Mijikai »

It is a standard window and FindWindow_() works!?
The only problem is that the contend of "RateChartOverlayWindow" is drawn, there is just no child window/control holding the MB/s value itself.
On the other hand you can read out the progressbar "msctls_progress32" just fine so no need to read the window title.
BarryG
Addict
Addict
Posts: 4225
Joined: Thu Apr 18, 2019 8:17 am

Re: MB/s scope grab MS Win

Post by BarryG »

I meant that "RateChartOverlayWindow" isn't a standard window (or child window) that can be read with #WM_SETTEXT and FindWindow_().
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: MB/s scope grab MS Win

Post by Mijikai »

It is a normal window that is registered in the system and can be located through FindWindowEx_() and other window functions.
If there is no text associated with the window #WM_GETTEXT will return nothing.
BarryG
Addict
Addict
Posts: 4225
Joined: Thu Apr 18, 2019 8:17 am

Re: MB/s scope grab MS Win

Post by BarryG »

You're preaching to the choir... that's what I'm saying (or mean). That the text isn't found using #WM_GETTEXT with a window handle, because it's not a standard window with text to be read. It's drawn.
Simo_na
Enthusiast
Enthusiast
Posts: 177
Joined: Sun Mar 03, 2013 9:01 am

Re: MB/s scope grab MS Win

Post by Simo_na »

I thought there was a pointer where peek the value.
i didn't know WinSpy. Thank you
since in my opinion it is a very reliable calculation.
I am trying to write a simple 'backup' application and I would have liked to use it value since using the #FO_COPY...
Bitblazer
Enthusiast
Enthusiast
Posts: 766
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: MB/s scope grab MS Win

Post by Bitblazer »

Or use brute force - https://www.purebasic.fr/english/viewtopic.php?t=77835 ;)
But i follow this topic to see which better way is found by the windows experts here.
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: MB/s scope grab MS Win

Post by breeze4me »

It is possible to read the information, but the update interval is about 10 seconds, so it seems useless.
See the post.
https://www.purebasic.fr/english/viewtopic.php?t=79544
Post Reply