Label Position

 
How do I find out the size of the window/chart so that I can place the label in the desired position on the right side of the chart.

For example if I place the Y & X distance to 10 & 10 it will fix the position of the label to the left of screen. I want to do the same to the right side. So when the window is maximised calculate the chart width - desired position. So if the chart width is 480pix I want to place it at 480-10.

Hope this makes sense.
 
See "MQL4: Object properties"

Use OBJPROP_CORNER property. Upper-right corner is 1
 
See "MQL4: Object properties"

Use OBJPROP_CORNER property. Upper-right corner is 1


This still doesn't produce what I am after as it defaults the X=200 and Y=50 and it doesn't respect the chart shift.

What I need is to be able to get the window rect so I can place it exactly where I want it. I have tried getting the window handle using WindowHandle() and passing that to a dll where I call the winapi call GetWindowRect. The problem is that when I step through the code it gets me back the rect values but as soon as the program exits MT crashes and I can't figure out why as this is pretty simple stuff. All my other api calls work fine, is there something special about this window handle or do I need to get the parent window?
 
Hi,

Please disregard this. I found the solutions. I followed as you said and set the corner property but then had to also set the X and Y value and hey presto it worked. Also on a side not I also got my api to get the window rect as well, I had a problem in the way I was declaring the exports in the DLL.

Thanks for your help
Reason: