Time/Price to window coords and vice versa - page 2

 

As I have finally managed to go live experimenting, can you spot an error preventing the two MessageBox calls from being successful, while both Alerts display proper values?:

  if(IsDllsAllowed()){
      GetWindowRect(WindowHandle(Symbol(), Period()), WindowDims);
      SizeX = WindowDims[2] - WindowDims[0];
      SizeY = WindowDims[3] - WindowDims[1];
      Alert(SizeX);
      Alert(SizeY);
      MessageBox("SizeX: " + SizeX, "SizeX");
      MessageBox("SizeY: " + SizeY, "SizeY");
   }else err = GetLastError();

 This is driving me nuts at the moment ...

 
Oh yes ..I just recalled that a MessgeBox cannot be called from an indicator code ...
 
Martinigue:
Oh yes ..I just recalled that a MessgeBox cannot be called from an indicator code ...
Yup . . .   MessageBox()   "The function cannot be called from custom indicators since they are executed within interface thread and may not decelerate it."
 

Great thread!! But - it is function for only clear window (only graph).

But what if I have main window + subwindow with indicator? What do I find x,y subwindow? 

 
endy5:

Great thread!! But - it is function for only clear window (only graph).

But what if I have main window + subwindow with indicator? What do I find x,y subwindow? 

No simple solution as far as i know . . .  http://www.forexfactory.com/showthread.php?t=194861
Reason: