how to programmatically arrange windows as non-overlapping tiles

 

Dear all, 

  May i know  how to programmatically arrange windows as non-overlapping tiles? Since MT5 provide a toolbar(by pressing ALT+R) for or this. I searched the MT5 manual but cannnot find the API. 

Many thanks for your help. 

taozemin

 
taozemin:

Dear all, 

  May i know  how to programmatically arrange windows as non-overlapping tiles? Since MT5 provide a toolbar(by pressing ALT+R) for or this. I searched the MT5 manual but cannnot find the API. 

Many thanks for your help. 

taozemin

You can't do that with mql5. Only possible way is with WINAPI.
 

 Interesting. If i know message ID for arranging the windows as non-overlapping tiles, the problem will be almost solved..... Would you please give some hints on this issue? thank you.

   
 
taozemin:

 Interesting. If i know how an EA or indicator can post a message to the terminal MDI, the problem is partly solved..... Would you please give some hints on this issue? thank you.

   
Search mql4.com forum with PostMessageA. You can do similar things with MT5/mql5.
 
angevoyageur:
Search mql4.com forum with PostMessageA. You can do similar things with MT5/mql5.

Dear angevoyageur,

   THank you for your instruction. I've already done that. and from the materials I got. I composed the following script which is suggested to make the charts cascased.But after I compiled and ran the script, it produces no reponse! I am not familiar with windows messaging API, and I'am completely puzzled by the phenomenon! Is there anything that i have missed?! Many thanks for your time and consideration.

taozemin.

 

#import "user32.dll"
   int GetParent(int hWnd);
  int GetAncestor(int, int);
   int SendMessageA(int hWnd, int Msg, int wParam, int lParam);
   int PostMessageA(int hWnd, int Msg, int wParam, int lParam);
#import

#define WM_MDITILE    0x226
#define WM_MDICASCADE 0x0227


void OnStart()
{
   int hMDI = GetParent(GetParent(ChartWindowFind()));
   //int hMDI = GetAncestor(ChartWindowFind(),2);
   int ret=SendMessageA(hMDI, WM_MDICASCADE, 0, 0);
}
 
taozemin:

Dear angevoyageur,

   THank you for your instruction. I've already done that. and from the materials I got. I composed the following script which is suggested to make the charts cascased.But after I compiled and ran the script, it produces no reponse! I am not familiar with windows messaging API, and I'am completely puzzled by the phenomenon! Is there anything that i have missed?! Many thanks for your time and consideration.

taozemin.

 

You are confusing subwindows number with Window handle.

   int wHandle=(int)ChartGetInteger(0,CHART_WINDOW_HANDLE);
   int hMDI = GetParent(GetParent(wHandle));
 
angevoyageur:

You are confusing subwindows number with Window handle.

Dear angevoyageur:

  So wonderful the solutiion is! Thank you so much!

taozemin.