possible to 'get at' main window's sub-windows?

 

your ref: https://www.mql5.com/en/code/9198 which determines pixel height of main window and any sub-windows
.
I have read on a c programmers forum http://cboard.cprogramming.com/game-programming/59870-getpixel-hdc-heartattacks.html#post422934
that GetPixel() (from gdi32.dll) may cause performance issues.
.
Since the ref'd codebase item above works by calling GetPixel() once per each pixel in Y.axis of main window this amounts to at least >1000 calls (on my 17in monitor)
.
Added to this is a requirement to repeatedly monitor physical screen positions of label objects (pixel unit) in order to translate to price units.
.
The repeat could be fractions of a second, upwards.
.
The code could also be running on any number of charts.
.
My idea?
if poss to get sub-window.1's HWND, then via GetClientRect() and making allowance for the borders etc, the Y.axis height of the main window could be simply and more importantly, quickly determined.
.
My research?
not knowing windows does not help... eg, have spent 8hrs creeping up on the codebase design, flipping back and forwards btwn msdn docs and my many Print()'s to eventually/finally understand the functionality of the code and what it actually does. (an aside - for us thicker than mud types, it sure would be cool it the clever hackers that post code would actually put some efforts into concise/relevant documentation - although, I'd admit to having issues even reading at times :-)
Actually, the comments were surprisingly well laid out on this codebase item - but generally speaking...
.
Anyways... I have called GetWindow() with all possible GW_xyz cmd flags and end result is that GW_HWND[FIRST,LAST] were only cmd flags to elicit an HWND datum.
This datum was equiv to WindowHandle().
.
Since I have no real sense of the futility or not of this search, I really need some inputs - there are those here that [from what I've read] eat Win API stuff for breakies... :)
.
Would be great if either you could say 'forget it dude!' not able to do it in a better more concise way or... maybe you can actually suggest that better more concise way!
.
Cheers

 
fbj:

My idea?
if poss to get sub-window.1's HWND, then via GetClientRect() and making allowance for the borders etc, the Y.axis height of the main window could be simply and more importantly, quickly determined.
[...]
Would be great if either you could say 'forget it dude!' [...]

Forget it, dude! The sub-windows aren't windows (in the sense of being things with their own hWnd, hDC and a window procedure).

Each chart is in fact only ever one window. It's basically a single canvas onto which MT4 draws stuff, not separate canvases for the main chart plus each indicator. That's why you're not having any success with GetWindow() etc. I've not looked to see exactly what https://www.mql5.com/en/code/9198 is doing, but it must be scanning down the single canvas trying to detect where the tell-tale dividers are.

 

Ya, kinda as expected...! was hoping you'd reply cuz your KB on many areas is extensive imho.
Fine, then I use the existing codebase idea and craft into what I personally require, which is just the Y.axis height of main window xlat'd into pixel(s) per price unit (at moment of call...)

You divined correctly jjc, it was this method that took me so long to 'get it'. The code cruises down the left single colour border (which all pseudo windows:) have. The 'tell-tale' dividers are met when RGB values differ.


Thank you

Reason: